/* ══ MODALS — add/edit car modal + delete confirm ══ */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease-out;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal {
  display: flex; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.97);
  width: 500px; max-width: calc(100vw - 32px);
  max-height: calc(100dvh / var(--zoom-scale, 1) - 48px);
  background: #141820; border: 1px solid #2a3040; border-radius: 14px;
  z-index: 201; flex-direction: column; overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 16px; border-bottom: 1px solid #1f2530; flex-shrink: 0;
}
.modal-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase; color: #dce3ed;
}
.modal-close {
  background: transparent; border: none; cursor: pointer; color: #7a8a9b; font-size: 14px;
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: #1f2530; color: #dce3ed; }

.modal-body {
  padding: 20px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
}
.modal-body::-webkit-scrollbar       { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: #1f2530; border-radius: 2px; }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid #1f2530; flex-shrink: 0;
}

/* Photo upload */
.photo-upload-area {
  border: 2px dashed #1f2530; border-radius: 10px;
  height: 130px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  position: relative; overflow: hidden;
}
.photo-upload-area:hover           { border-color: #d4f542; background: rgba(212,245,66,0.03); }
.photo-upload-area.has-photo       { border-style: solid; border-color: #2a3040; }
.photo-upload-area img             { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.photo-upload-area input[type=file]{ position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.photo-upload-label { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: #7a8a9b; pointer-events: none; z-index: 1; }
.photo-upload-icon  { font-size: 24px; pointer-events: none; z-index: 1; }
.photo-upload-hint  { font-size: 11px; color: #2a3040; pointer-events: none; z-index: 1; }
.photo-remove-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(10,12,15,0.8); border: 1px solid #2a3040;
  color: #7a8a9b; font-size: 11px; cursor: pointer; border-radius: 5px;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.photo-remove-btn:hover { background: rgba(239,68,68,0.2); color: #ef4444; border-color: #ef4444; }

/* Form elements */
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: #7a8a9b;
  display: flex; align-items: center; gap: 6px;
}
.form-required { color: #d4f542; }
.form-hint     { color: #2a3040; font-weight: 600; }

.form-input {
  background: #0f1318; border: 1px solid #1f2530; border-radius: 8px;
  padding: 9px 12px; font-family: 'Barlow', sans-serif; font-size: 13px;
  color: #dce3ed; outline: none; transition: border-color 0.15s; width: 100%;
}
.form-input:focus        { border-color: #d4f542; }
.form-input::placeholder { color: #2a3040; }
.form-input-readonly     { color: #d4f542; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; letter-spacing: 1px; cursor: default; }

.fuel-options { display: flex; flex-wrap: wrap; gap: 8px; }
.fuel-btn {
  background: #0f1318; border: 1px solid #1f2530; border-radius: 8px;
  padding: 8px 14px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px; font-weight: 600; color: #7a8a9b; cursor: pointer; transition: all 0.15s;
}
.fuel-btn:hover    { border-color: #2a3040; color: #dce3ed; }
.fuel-btn.selected { background: rgba(212,245,66,0.1); border-color: #d4f542; color: #d4f542; }

.form-error { font-size: 12px; color: #ef4444; min-height: 16px; }

/* Delete confirm modal */
.confirm-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 299;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease-out;
}
.confirm-backdrop.open { opacity: 1; pointer-events: auto; }

.confirm-modal {
  display: flex; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.97);
  width: 380px; max-width: calc(100vw - 32px);
  background: #141820; border: 1px solid #ef4444;
  border-radius: 14px; z-index: 300; flex-direction: column; overflow: hidden;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}
.confirm-modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.confirm-header   { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.confirm-icon     { font-size: 22px; }
.confirm-title    { font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #ef4444; }
.confirm-body     { padding: 12px 20px 20px; font-size: 13px; color: #8899aa; line-height: 1.5; }
.confirm-car-name { color: #dce3ed; font-weight: 600; }
.confirm-warning  {
  margin-top: 10px; padding: 10px 12px; background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2); border-radius: 8px; font-size: 12px; color: #ef4444;
}
.confirm-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid #1f2530; }

.btn-delete-confirm {
  background: #ef4444; border: none; border-radius: 8px; padding: 8px 20px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase; color: #fff;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-delete-confirm:hover { opacity: 0.88; }

/* ── Light mode ── */
body.light-mode .modal-backdrop { background: rgba(0,0,0,0.35); }
body.light-mode .modal { background: #ffffff; border-color: #dde2ec; }
body.light-mode .modal-header { border-bottom-color: #e8ecf2; }
body.light-mode .modal-title { color: #1a2030; }
body.light-mode .modal-close:hover { background: #f0f3f8; color: #1a2030; }
body.light-mode .modal-body::-webkit-scrollbar-thumb { background: #dde2ec; }
body.light-mode .modal-footer { border-top-color: #e8ecf2; }
body.light-mode .photo-upload-area { border-color: #dde2ec; }
body.light-mode .photo-upload-area:hover { border-color: #8aaa00; background: rgba(90,122,0,0.03); }
body.light-mode .photo-upload-label { color: #8899aa; }
body.light-mode .photo-upload-hint { color: #b0b8c4; }
body.light-mode .photo-remove-btn { background: rgba(255,255,255,0.9); border-color: #dde2ec; }
body.light-mode .form-label { color: #6b7a8d; }
body.light-mode .form-required { color: #5a7a00; }
body.light-mode .form-hint { color: #b0b8c4; }
body.light-mode .form-input { background: #f0f3f8; border-color: #dde2ec; color: #1a2030; }
body.light-mode .form-input:focus { border-color: #5a7a00; }
body.light-mode .form-input::placeholder { color: #b0b8c4; }
body.light-mode .form-input-readonly { color: #5a7a00; }
body.light-mode .fuel-btn { background: #f0f3f8; border-color: #dde2ec; color: #6b7a8d; }
body.light-mode .fuel-btn:hover { border-color: #b0b8c4; color: #1a2030; }
body.light-mode .fuel-btn.selected { background: rgba(90,122,0,0.08); border-color: #5a7a00; color: #5a7a00; }
body.light-mode .confirm-backdrop { background: rgba(0,0,0,0.35); }
body.light-mode .confirm-modal { background: #ffffff; border-color: #ef4444; }
body.light-mode .confirm-body { color: #6b7a8d; }
body.light-mode .confirm-car-name { color: #1a2030; }
body.light-mode .confirm-warning { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.15); }
body.light-mode .confirm-footer { border-top-color: #e8ecf2; }
