/* MotorForge App Styles - Matching landing page design system */
:root {
  --forge-orange: #FF5E1A;
  --forge-amber: #FFB800;
  --steel-dark: #0A0A0F;
  --steel-mid: #14141F;
  --steel-light: #1E1E2E;
  --chrome: #E8E8EC;
  --chrome-dim: #8888A0;
  --glow: rgba(255, 94, 26, 0.15);
  --success: #22C55E;
  --danger: #EF4444;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--steel-dark);
  color: var(--chrome);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

/* === APP NAV === */
.app-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.9);
  border-bottom: 1px solid rgba(255, 94, 26, 0.1);
}

.app-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--chrome);
  text-decoration: none;
}

.app-nav .logo span { color: var(--forge-orange); }

.nav-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.btn-nav {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border: 1px solid rgba(255, 94, 26, 0.3);
  border-radius: 100px;
  color: var(--forge-orange);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-nav:hover {
  background: rgba(255, 94, 26, 0.1);
  border-color: var(--forge-orange);
}

/* === MAIN LAYOUT === */
.app-container {
  display: flex;
  min-height: 100vh;
  padding-top: 52px;
}

/* === UPLOAD SCREEN === */
.upload-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 52px);
  padding: 2rem;
  width: 100%;
  position: relative;
}

.upload-screen::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 94, 26, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.upload-content {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.upload-content h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.upload-content h1 .highlight {
  background: linear-gradient(135deg, var(--forge-orange), var(--forge-amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.upload-content > p {
  color: var(--chrome-dim);
  font-size: 1.05rem;
  font-weight: 300;
  margin-bottom: 2.5rem;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(255, 94, 26, 0.25);
  border-radius: 20px;
  padding: 3rem 2rem;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(20, 20, 31, 0.6);
  position: relative;
  overflow: hidden;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--forge-orange);
  background: rgba(255, 94, 26, 0.05);
  transform: translateY(-2px);
}

.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  opacity: 0.8;
}

.drop-zone h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.drop-zone p {
  font-size: 0.85rem;
  color: var(--chrome-dim);
  font-weight: 300;
}

.file-input { display: none; }

/* Preview */
.upload-preview {
  margin-top: 1.5rem;
  display: none;
  text-align: center;
}

.upload-preview.active { display: block; }

.upload-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.upload-preview .file-name {
  font-size: 0.8rem;
  color: var(--chrome-dim);
  margin-top: 0.5rem;
}

/* Upload Button */
.btn-upload {
  margin-top: 1.5rem;
  padding: 0.85rem 2.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--forge-orange), #FF7A3D);
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  display: none;
  letter-spacing: 0.02em;
}

.btn-upload.active { display: inline-block; }

.btn-upload:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 94, 26, 0.3);
}

.btn-upload:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Loading States */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  flex-direction: column;
}

.loading-overlay.active { display: flex; }

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(255, 94, 26, 0.15);
  border-top-color: var(--forge-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  color: var(--chrome);
  font-weight: 500;
}

.loading-sub {
  font-size: 0.85rem;
  color: var(--chrome-dim);
  margin-top: 0.4rem;
}

/* === STUDIO LAYOUT === */
.studio {
  display: none;
  width: 100%;
  min-height: calc(100vh - 52px);
}

.studio.active { display: flex; }

.studio-viewer {
  flex: 1;
  position: relative;
  background: var(--steel-dark);
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.studio-viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.car-info-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 94, 26, 0.15);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  z-index: 10;
}

.car-info-badge .car-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.car-info-badge .car-details {
  font-size: 0.75rem;
  color: var(--chrome-dim);
  margin-top: 0.15rem;
}

.viewer-controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.viewer-btn {
  padding: 0.4rem 0.8rem;
  background: rgba(10, 10, 15, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--chrome-dim);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Outfit', sans-serif;
}

.viewer-btn:hover {
  border-color: var(--forge-orange);
  color: var(--chrome);
}

/* === CUSTOMIZATION PANEL === */
.studio-panel {
  width: 380px;
  background: var(--steel-mid);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.panel-tab {
  flex: 1;
  padding: 0.9rem 0.5rem;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--chrome-dim);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.panel-tab:hover { color: var(--chrome); }

.panel-tab.active {
  color: var(--forge-orange);
}

.panel-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--forge-orange);
  border-radius: 1px;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.tab-section {
  display: none;
}

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

/* Section headers */
.section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--chrome-dim);
  margin-bottom: 0.75rem;
  margin-top: 1.25rem;
}

.section-label:first-child { margin-top: 0; }

/* === PAINT SECTION === */
.finish-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.finish-btn {
  flex: 1;
  padding: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: transparent;
  color: var(--chrome-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.finish-btn:hover { border-color: rgba(255, 255, 255, 0.2); }

.finish-btn.active {
  border-color: var(--forge-orange);
  color: var(--chrome);
  background: rgba(255, 94, 26, 0.08);
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}

.color-swatch {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.color-swatch::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.color-swatch:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.color-swatch.selected {
  border-color: var(--forge-orange);
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255, 94, 26, 0.3);
}

.color-name {
  font-size: 0.7rem;
  color: var(--chrome-dim);
  text-align: center;
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Metallic shimmer overlay */
.color-swatch[data-finish="metallic"]::after {
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%, rgba(255,255,255,0.15) 100%);
  opacity: 1;
}

.color-swatch[data-finish="matte"]::after {
  background: linear-gradient(135deg, rgba(0,0,0,0.15) 0%, transparent 100%);
  opacity: 1;
}

/* === RIMS SECTION === */
.rim-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.rim-card {
  background: var(--steel-dark);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.rim-card:hover {
  border-color: rgba(255, 94, 26, 0.2);
  transform: translateX(2px);
}

.rim-card.selected {
  border-color: var(--forge-orange);
  background: rgba(255, 94, 26, 0.05);
}

.rim-visual {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--steel-mid);
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.rim-visual svg {
  width: 48px;
  height: 48px;
}

.rim-info {
  flex: 1;
  min-width: 0;
}

.rim-info h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.rim-info .rim-brand {
  font-size: 0.7rem;
  color: var(--forge-orange);
  font-weight: 500;
}

.rim-info .rim-specs {
  font-size: 0.7rem;
  color: var(--chrome-dim);
  margin-top: 0.2rem;
}

.rim-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--forge-amber);
  flex-shrink: 0;
}

/* Filter chips */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.filter-chip {
  padding: 0.3rem 0.7rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  background: transparent;
  color: var(--chrome-dim);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip:hover { border-color: rgba(255, 255, 255, 0.2); }

.filter-chip.active {
  border-color: var(--forge-orange);
  color: var(--forge-orange);
  background: rgba(255, 94, 26, 0.08);
}

/* === TIRES SECTION === */
.tire-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.tire-card {
  background: var(--steel-dark);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tire-card:hover {
  border-color: rgba(255, 94, 26, 0.2);
}

.tire-card.selected {
  border-color: var(--forge-orange);
  background: rgba(255, 94, 26, 0.05);
}

.tire-size {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.tire-type {
  font-size: 0.7rem;
  color: var(--chrome-dim);
}

.tire-badge {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 94, 26, 0.1);
  color: var(--forge-orange);
  font-weight: 500;
}

/* === INTERIOR SECTION === */
.interior-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.interior-card {
  background: var(--steel-dark);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.interior-card:hover {
  border-color: rgba(255, 94, 26, 0.2);
  transform: translateY(-2px);
}

.interior-card.selected {
  border-color: var(--forge-orange);
  background: rgba(255, 94, 26, 0.05);
}

.interior-swatch {
  width: 100%;
  height: 48px;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.interior-card h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.interior-card .interior-material {
  font-size: 0.7rem;
  color: var(--chrome-dim);
}

/* === EDUCATIONAL TOOLTIP === */
.edu-tooltip {
  position: fixed;
  background: var(--steel-light);
  border: 1px solid rgba(255, 94, 26, 0.2);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  max-width: 300px;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.edu-tooltip.visible {
  opacity: 1;
  pointer-events: auto;
}

.edu-tooltip h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--forge-orange);
  margin-bottom: 0.4rem;
}

.edu-tooltip p {
  font-size: 0.8rem;
  color: var(--chrome);
  line-height: 1.5;
  font-weight: 300;
}

.edu-tooltip .edu-tag {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  background: rgba(255, 94, 26, 0.1);
  color: var(--forge-orange);
  border-radius: 4px;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* Info icons */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 94, 26, 0.1);
  color: var(--forge-orange);
  font-size: 0.6rem;
  font-weight: 700;
  cursor: help;
  margin-left: 0.3rem;
  vertical-align: middle;
  flex-shrink: 0;
}

/* === BUILD SUMMARY === */
.build-summary {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--steel-dark);
  flex-shrink: 0;
}

.build-summary h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--forge-orange);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 0.25rem 0;
}

.summary-row .label { color: var(--chrome-dim); }
.summary-row .value { color: var(--chrome); font-weight: 500; }

.btn-save-build {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.65rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--forge-orange), #FF7A3D);
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-save-build:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 94, 26, 0.3);
}

/* === TOAST NOTIFICATIONS === */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.85rem 1.25rem;
  background: var(--steel-light);
  border: 1px solid rgba(255, 94, 26, 0.2);
  border-radius: 10px;
  font-size: 0.85rem;
  z-index: 500;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

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

.toast.success { border-color: rgba(34, 197, 94, 0.3); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); }

/* === SCROLLBAR === */
.panel-content::-webkit-scrollbar,
.studio-panel::-webkit-scrollbar {
  width: 4px;
}

.panel-content::-webkit-scrollbar-track,
.studio-panel::-webkit-scrollbar-track {
  background: transparent;
}

.panel-content::-webkit-scrollbar-thumb,
.studio-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 94, 26, 0.2);
  border-radius: 2px;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .studio {
    flex-direction: column;
  }

  .studio-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    max-height: 50vh;
  }

  .studio-viewer {
    min-height: 40vh;
  }

  .color-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 480px) {
  .upload-content h1 { font-size: 1.75rem; }
  .drop-zone { padding: 2rem 1.5rem; }
  .color-grid { grid-template-columns: repeat(5, 1fr); }
  .interior-grid { grid-template-columns: 1fr; }
}
