/* ============================================
   CarA2Z – Premium Dark Theme
   Colors: Deep Navy + Electric Cyan + Violet
   ============================================ */

:root {
  --bg: #0B1120;
  --bg-elevated: #111827;
  --bg-card: #1a2332;
  --bg-card-hover: #1f2a3d;
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);
  
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --accent: #22D3EE;
  --accent-dim: rgba(34,211,238,0.15);
  --accent-glow: rgba(34,211,238,0.35);
  
  --violet: #A78BFA;
  --violet-dim: rgba(167,139,250,0.15);
  
  --emerald: #34D399;
  --emerald-dim: rgba(52,211,153,0.15);
  
  --amber: #FBBF24;
  
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  
  --shadow: 0 4px 24px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  
  --font: 'Inter', 'Noto Sans Devanagari', system-ui, -apple-system, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="light"] {
  --bg: #F8FAFC;
  --bg-elevated: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --border: rgba(0,0,0,0.06);
  --border-strong: rgba(0,0,0,0.1);
  
  --text: #0F172A;
  --text-muted: #475569;
  --text-dim: #94A3B8;
  
  --accent: #0891B2;
  --accent-dim: rgba(8,145,178,0.12);
  --accent-glow: rgba(8,145,178,0.25);
  
  --violet: #7C3AED;
  --violet-dim: rgba(124,58,237,0.12);
  
  --emerald: #059669;
  --emerald-dim: rgba(5,150,105,0.12);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

/* App Shell */
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(72px + var(--safe-bottom));
}

/* ========== TOPBAR ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,17,32,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .topbar {
  background: rgba(248,250,252,0.9);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  color: #0B1120;
}

.nav-desktop {
  display: none;
  gap: 6px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: var(--accent-dim);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

#lang-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.menu-btn { display: grid; }

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 20px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 99;
  box-shadow: var(--shadow-lg);
}

.mobile-menu.open { display: flex; }

.mobile-link {
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}

.mobile-link:hover,
.mobile-link.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ========== MAIN ========== */
#main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  display: none;
  padding: 32px 0 48px;
  animation: fadeUp 0.35s ease;
}

.section.active { display: block; }

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

/* ========== HERO ========== */
.hero {
  text-align: center;
  padding: 48px 0 40px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 28px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #06B6D4);
  color: #0B1120;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 40px 0;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.25s;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.feature-icon.cyan { background: var(--accent-dim); color: var(--accent); }
.feature-icon.violet { background: var(--violet-dim); color: var(--violet); }
.feature-icon.emerald { background: var(--emerald-dim); color: var(--emerald); }

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Quick Start */
.quick-start {
  margin-top: 48px;
  text-align: center;
}

.quick-start h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.quick-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.quick-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-weight: 600;
  transition: all 0.2s;
}

.quick-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.qc-num {
  width: 32px;
  height: 32px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Section Header */
.section-header {
  margin-bottom: 32px;
  text-align: center;
}

.section-header h1 {
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Parts Grid */
.parts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.part-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.22s;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.part-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.part-num {
  width: 40px;
  height: 40px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.part-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.part-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.part-card .tag {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  background: var(--emerald-dim);
  color: var(--emerald);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Driving List */
.driving-list {
  display: grid;
  gap: 12px;
}

.drive-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  cursor: pointer;
  transition: all 0.2s;
}

.drive-card:hover {
  border-color: var(--violet);
  background: var(--bg-card-hover);
}

.drive-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.drive-card h3 span {
  width: 28px;
  height: 28px;
  background: var(--violet-dim);
  color: var(--violet);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.drive-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 38px;
}

/* Checklist */
.checklist-container {
  display: grid;
  gap: 20px;
}

.check-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.check-group-header {
  padding: 16px 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-group-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.check-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
}

.check-item:last-child { border-bottom: none; }

.check-item .box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* About */
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  max-width: 640px;
  margin: 0 auto;
}

.about-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.about-card p {
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.7;
}

.about-meta {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(11,17,32,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  z-index: 100;
}

[data-theme="light"] .bottom-nav {
  background: rgba(255,255,255,0.92);
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 64px;
}

.bn-item.active {
  color: var(--accent);
}

.bn-item svg {
  stroke-width: 2;
}

/* ========== DETAIL MODAL / PAGE ========== */
.detail-view {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  overflow-y: auto;
  padding-bottom: 40px;
}

.detail-view.open { display: block; }

.detail-header {
  position: sticky;
  top: 0;
  background: rgba(11,17,32,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 10;
}

[data-theme="light"] .detail-header {
  background: rgba(248,250,252,0.92);
}

.detail-back {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.15s;
}

.detail-back:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.detail-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.detail-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px;
}

.detail-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--accent);
}

.detail-content h3:first-child { margin-top: 0; }

.detail-content p {
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.7;
}

.detail-content ul {
  list-style: none;
  margin: 12px 0 20px;
}

.detail-content li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: var(--text-muted);
  line-height: 1.6;
}

.detail-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.9rem;
}

.detail-table th,
.detail-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.detail-table th {
  background: var(--bg-elevated);
  font-weight: 600;
  color: var(--text);
}

.detail-table td {
  color: var(--text-muted);
}

.detail-table tr:hover td {
  background: var(--accent-dim);
}

.warning-box {
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 20px 0;
  color: var(--amber);
  font-size: 0.92rem;
  line-height: 1.6;
}

.tip-box {
  background: var(--emerald-dim);
  border: 1px solid rgba(52,211,153,0.3);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 20px 0;
  color: var(--emerald);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ========== RESPONSIVE ========== */
@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .quick-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .parts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .menu-btn { display: none; }
  .bottom-nav { display: none; }
  #app { padding-bottom: 0; }
  .hero { padding: 64px 0 48px; }
  .parts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Install button */
.btn-install {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(34,211,238,0.25);
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-install:hover {
  background: var(--accent);
  color: #0B1120;
}
@media (max-width: 640px) {
  .btn-install span { display: none; }
  .btn-install { padding: 8px 10px; }
}

.credit-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.credit-link:hover {
  border-bottom-color: var(--accent);
}
