/* LUXXO GARAGE · IVORY & GOLD DESIGN SYSTEM */
:root {
  --bg-main: #f6f1e6;
  --bg-card: #ffffff;
  --bg-card-sub: #fbf8f1;
  --bg-input: #ffffff;
  --border-gold: #a8842f;
  --border-gold-subtle: rgba(168, 132, 47, 0.25);
  --border-dark: rgba(120, 95, 40, 0.15);
  --gold-primary: #a8842f;
  --gold-glow: rgba(168, 132, 47, 0.4);
  --gold-light: #8a6a1c;
  --text-white: #1c1a17;
  --text-muted: #6b614f;
  --text-dim: #8a7f6a;
  --color-green: #10b981;
  --color-red: #ef4444;
  --color-orange: #f59e0b;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --watermark: url('../assets/patterns/luxxo-watermark.png');
  /* Native selects, dropdown popups and scrollbars render light on Windows Chrome */
  color-scheme: light;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-white);
  font-family: var(--font-family);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* LUXXO GARAGE watermark grid: the logo tilted 45° repeating behind the whole studio */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--watermark) 0 0 / 200px 200px repeat;
  opacity: 0.05;
}

body > * {
  position: relative;
  z-index: 1;
}

/* Form controls: consistent on Windows / macOS */
select option,
select optgroup {
  background-color: #ffffff;
  color: #1c1a17;
}

input::placeholder,
textarea::placeholder {
  color: #9a8f7a;
  opacity: 1;
}

:focus-visible {
  outline: 2px solid var(--gold-primary);
  outline-offset: 2px;
}

::selection {
  background: #e9d9a8;
  color: #1c1a17;
}

/* TOPBAR */
.topbar {
  background: linear-gradient(180deg, #ffffff 0%, #fbf8f1 100%);
  border-bottom: 1.5px solid var(--border-gold);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(120, 95, 40, 0.13);
  gap: 14px;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(168, 132, 47, 0.3));
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-title h1 {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #1c1a17;
  text-transform: uppercase;
  line-height: 1.1;
}

.brand-title span {
  font-size: 10px;
  color: var(--gold-primary);
  letter-spacing: 1.5px;
  font-weight: 700;
  text-transform: uppercase;
}

/* UNIFIED TOPBAR CONTROL BAR */
.unified-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fbf8f1;
  border: 1px solid var(--border-gold-subtle);
  border-radius: 8px;
  padding: 4px 8px;
  flex: 1;
  max-width: 660px;
}

.topbar-car-select {
  background: #ffffff;
  border: 1px solid rgba(168, 132, 47, 0.35);
  color: #1c1a17;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  flex: 1;
  min-width: 200px;
  outline: none;
  cursor: pointer;
}

.divider-or {
  font-size: 9.5px;
  font-weight: 900;
  color: var(--gold-primary);
  opacity: 0.8;
  letter-spacing: 0.5px;
}

.topbar-search-input {
  background: #ffffff;
  border: 1px solid rgba(120, 95, 40, 0.21);
  color: #1c1a17;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  flex: 1;
  min-width: 170px;
  outline: none;
}

.topbar-search-input:focus, .topbar-car-select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(168, 132, 47, 0.25);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* QUICK CAR PILLS STRIP */
.quick-car-pills-strip {
  background: #fbf8f1;
  border-bottom: 1px solid rgba(120, 95, 40, 0.15);
  padding: 6px 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(120, 95, 40, 0.08);
}

.pill-strip-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-primary);
  white-space: nowrap;
  letter-spacing: 0.8px;
  margin-right: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.magic-input {
  border: 1.5px solid rgba(168, 132, 47, 0.3);
  color: #1c1a17;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  outline: none;
  transition: all 0.2s;
}

.magic-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(168, 132, 47, 0.3);
  background: #ffffff;
}

.magic-btn {
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(168, 132, 47, 0.25);
}

.quick-car-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pill-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-primary);
  white-space: nowrap;
  margin-right: 4px;
}

.pill-btn {
  background: rgba(120, 95, 40, 0.08);
  border: 1px solid rgba(120, 95, 40, 0.18);
  color: #3a342b;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.pill-btn:hover {
  background: rgba(168, 132, 47, 0.15);
  border-color: var(--gold-primary);
  color: #ffffff;
}

.pill-btn.active {
  background: linear-gradient(135deg, #a8842f 0%, #8a6a1c 100%);
  border-color: #c9a54e;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(168, 132, 47, 0.45);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  user-select: none;
}

.btn-gold {
  background: linear-gradient(135deg, #a8842f 0%, #8a6a1c 100%);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(168, 132, 47, 0.3);
}

.btn-gold:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 15px rgba(168, 132, 47, 0.5);
  transform: translateY(-1px);
}

.btn-dark {
  background: #ffffff;
  color: #1c1a17;
  border: 1px solid var(--border-dark);
}

.btn-dark:hover {
  background: #f4ecd9;
  border-color: rgba(120, 95, 40, 0.34);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

/* MAIN STUDIO LAYOUT */
.studio-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* LEFT CONTROLS PANE */
.editor-pane {
  width: 48%;
  background: rgba(255, 255, 255, 0.9);
  border-right: 1.5px solid var(--border-dark);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-tabs {
  display: flex;
  background: #fbf8f1;
  border-bottom: 1px solid var(--border-dark);
  padding: 0 12px;
  overflow-x: auto;
  flex-shrink: 0;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #1c1a17;
}

.tab-btn.active {
  color: var(--gold-primary);
  border-bottom-color: var(--gold-primary);
  background: rgba(168, 132, 47, 0.05);
}

.editor-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* LIVE BIDDING FETCHER BOX */
.live-bidding-fetcher-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(168, 132, 47, 0.08) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(120, 95, 40, 0.08);
}

.fetcher-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #047857;
  letter-spacing: 0.8px;
  font-weight: 800;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseGreen 1.5s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.fetcher-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-car-dropdown {
  flex: 1;
  background: #ffffff;
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  font-weight: 700;
  color: #1c1a17;
}

.live-car-dropdown:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

/* SECTION CARDS */
.form-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
}

.form-card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-primary);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-textarea, .form-select {
  background: var(--bg-input);
  border: 1px solid var(--border-dark);
  border-radius: 6px;
  color: #1c1a17;
  padding: 8px 12px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 2px rgba(168, 132, 47, 0.2);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.4;
}

/* EXPERTISE TOOLBAR & BRUSHES */
.brush-toolbar {
  display: flex;
  gap: 8px;
  background: #fbf8f1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-dark);
  margin-bottom: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.brush-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-primary);
  margin-right: 6px;
  text-transform: uppercase;
}

.brush-btn {
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #1c1a17;
  transition: all 0.2s;
}

.brush-btn .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.brush-btn.original .dot { background: #ffffff; box-shadow: inset 0 0 0 1.5px #8a7d64; }
.brush-btn.painted .dot { background: var(--gold-primary); }
.brush-btn.replaced .dot { background: var(--color-red); }
.brush-btn.local .dot { background: var(--color-orange); }

.brush-btn.active {
  border-color: #1c1a17;
  box-shadow: 0 2px 8px rgba(120, 95, 40, 0.2);
  transform: scale(1.03);
}

.brush-btn.painted.active {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(168, 132, 47, 0.4);
}

/* CAR SVG BLUEPRINT CONTAINER */
.blueprint-wrapper {
  background: #ffffff;
  border: 1px solid var(--border-gold-subtle);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  text-align: center;
  position: relative;
}

.blueprint-svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* Interactive SVG Panels */
.car-panel {
  cursor: pointer;
  transition: all 0.25s ease;
}

.car-panel:hover {
  filter: brightness(0.97) drop-shadow(0 0 6px rgba(168, 132, 47, 0.6));
}

.status-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-pill.original {
  background: rgba(120, 95, 40, 0.15);
  color: #1c1a17;
  border: 1px solid rgba(120, 95, 40, 0.34);
}

.status-pill.painted {
  background: rgba(168, 132, 47, 0.15);
  color: var(--gold-light);
  border: 1px solid var(--gold-primary);
}

.status-pill.replaced {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
  border: 1px solid var(--color-red);
}

/* RIGHT PREVIEW PANE */
.preview-pane {
  width: 52%;
  background: transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-toolbar {
  background: #fffdf8;
  border-bottom: 1px solid var(--border-dark);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.preview-badge .live-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.6; transform: scale(0.9); }
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preview-canvas-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 18px;
  background-color: rgba(239, 232, 216, 0.6);
}

/* TOAST NOTIFICATION */
.toast-msg {
  position: fixed !important;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, #fffdf8 0%, #fbf8f1 100%);
  border: 1.5px solid var(--gold-primary);
  color: #1c1a17;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(120, 95, 40, 0.2), 0 0 20px rgba(168, 132, 47, 0.3);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}

/* SCROLLBAR: standard properties for Chrome 121+ (Windows) and Firefox, WebKit fallback for Safari */
* {
  scrollbar-width: thin;
  scrollbar-color: #d6c49a #f1eadb;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1eadb;
}

::-webkit-scrollbar-thumb {
  background: #d6c49a;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

/* STUDIO MODAL BACKDROP & DIALOG */
.studio-modal-backdrop {
  position: fixed !important;
  inset: 0;
  background: rgba(246, 241, 230, 0.78);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.studio-modal {
  background: #ffffff;
  border: 1.5px solid var(--border-gold);
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(120, 95, 40, 0.21), 0 0 30px rgba(168, 132, 47, 0.2);
  overflow: hidden;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.studio-modal-header {
  padding: 18px 24px;
  background: linear-gradient(180deg, #fffdf8 0%, #fbf8f1 100%);
  border-bottom: 1px solid var(--border-gold-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.studio-modal-title h3 {
  font-size: 16px;
  font-weight: 800;
  color: #1c1a17;
  margin-bottom: 4px;
}

.studio-modal-title p {
  font-size: 11.5px;
  color: var(--text-muted);
}

.studio-modal-close {
  background: rgba(120, 95, 40, 0.15);
  border: 1px solid rgba(120, 95, 40, 0.26);
  color: #1c1a17;
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.studio-modal-close:hover {
  background: var(--gold-primary);
  color: #ffffff;
}

.studio-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.embed-asset-selector {
  background: rgba(120, 95, 40, 0.05);
  border: 1px solid var(--border-dark);
  padding: 12px 14px;
  border-radius: 10px;
}

.embed-asset-btn.active {
  background: var(--gold-primary) !important;
  color: #ffffff !important;
  font-weight: 800;
}

.embed-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.embed-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: #2a2620;
}

.embed-input-code {
  font-family: 'Space Grotesk', monospace, monospace;
  font-size: 11.5px;
  color: #8a6a1c;
  background: #fbf8f1;
  border: 1px solid rgba(120, 95, 40, 0.21);
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.embed-input-code:focus, .embed-input-code:hover {
  border-color: var(--gold-primary);
}

.btn-xs {
  padding: 4px 8px;
  font-size: 10.5px;
  border-radius: 5px;
}

.studio-modal-footer {
  padding: 14px 24px;
  background: #fbf8f1;
  border-top: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* RESPONSIVE: Windows laptops (1366px and 125-150% display scaling) and smaller screens */
@media (max-width: 1280px) {
  .topbar {
    flex-wrap: wrap;
    padding: 8px 14px;
    row-gap: 8px;
  }

  .unified-search-box {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .editor-content {
    padding: 16px;
  }

  .preview-canvas-container {
    padding: 18px 12px;
  }
}

@media (max-width: 1024px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .studio-layout {
    flex-direction: column;
    overflow: visible;
  }

  .editor-pane,
  .preview-pane {
    width: 100%;
    overflow: visible;
  }

  .editor-pane {
    border-right: none;
    border-bottom: 1.5px solid var(--border-dark);
  }

  .editor-content,
  .preview-canvas-container {
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .unified-search-box {
    flex-wrap: wrap;
  }

  .topbar-car-select,
  .topbar-search-input {
    min-width: 0;
    flex-basis: 100%;
  }

  .form-grid,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .form-group.col-span-2 {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
