/* ========================================================
   THE PIT STOP: Interactive Garage & 1/4-Mile Drag Simulator
   AdSense Compliant, Accessible, Ultra-Responsive UI
   ======================================================== */

.interactive-garage-section {
  margin: 60px 0 40px 0;
  padding: 36px 28px;
  background: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.1) 0%, rgba(15, 23, 42, 0.98) 75%), #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.garage-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 30px auto;
}

.garage-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #38bdf8;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

.garage-title {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 10px 0;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.garage-subtitle {
  font-size: 15px;
  color: #94a3b8;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

/* Tab Navigation */
.garage-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.garage-tabs {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 4px;
  gap: 4px;
}

.garage-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.garage-tab-btn:hover {
  color: #ffffff;
}

.garage-tab-btn.active {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.35);
}

.sound-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sound-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sound-toggle-btn.sound-on {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
}

/* Tab Panels */
.garage-tab-panel {
  display: none;
  animation: fadeInPanel 0.3s ease;
}

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

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

/* ========================================================
   TAB 1: DRAG RACE SIMULATOR
   ======================================================== */
.drag-selectors-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.drag-car-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
}

.drag-car-card label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 8px;
}

.car-select {
  width: 100%;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #f8fafc;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.car-select:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.vs-badge {
  font-size: 18px;
  font-weight: 900;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Specs Telemetry Table */
.specs-table-wrapper {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.specs-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  padding: 12px 16px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.specs-table th:first-child { text-align: left; }

.specs-table td {
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-weight: 600;
}

.specs-table td:first-child {
  text-align: left;
  color: #94a3b8;
  font-weight: 500;
}

.specs-table td.spec-winner {
  color: #34d399;
  font-weight: 800;
  position: relative;
}

.specs-table td.spec-winner::after {
  content: " ✓";
  font-size: 11px;
}

/* The Drag Strip Arena */
.drag-strip-arena {
  background: #111827;
  border: 2px solid #334155;
  border-radius: 16px;
  padding: 20px 16px;
  position: relative;
  margin-bottom: 24px;
  box-shadow: inset 0 4px 20px rgba(0,0,0,0.8);
}

.confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.tree-lights-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  background: #090d16;
  padding: 8px 16px;
  border-radius: 9999px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tree-light {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #27272a;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
  transition: all 0.15s ease;
}

.tree-light.amber.active {
  background: #facc15;
  box-shadow: 0 0 14px #facc15;
}

.tree-light.green.active {
  background: #22c55e;
  box-shadow: 0 0 18px #22c55e;
}

.track-lanes {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.track-lane {
  position: relative;
  background: linear-gradient(90deg, #1e293b 0%, #0f172a 100%);
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  overflow: hidden;
}

.finish-line-banner {
  position: absolute;
  right: 12px;
  top: 0;
  bottom: 0;
  width: 8px;
  background: repeating-linear-gradient(
    0deg,
    #ffffff,
    #ffffff 8px,
    #000000 8px,
    #000000 16px
  );
  z-index: 2;
  opacity: 0.85;
}

.drag-car-sprite {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  left: 10px;
  z-index: 3;
  will-change: transform;
}

.car-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

.car-tag-mini {
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 12px;
  color: #94a3b8;
  font-family: monospace;
}

/* Launch Action Controls */
.launch-controls-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-launch {
  background: linear-gradient(135deg, #ef4444, #f97316);
  border: none;
  color: #ffffff;
  padding: 14px 36px;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-launch:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(239, 68, 68, 0.55);
}

.btn-launch:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-share-result {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-share-result:hover {
  background: rgba(255, 255, 255, 0.16);
}

.race-result-box {
  display: none;
  text-align: center;
  padding: 14px 20px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 12px;
  color: #34d399;
  font-size: 16px;
  font-weight: 800;
  margin-top: 16px;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ========================================================
   TAB 2: EV FUEL & RANGE SAVINGS CALCULATOR
   ======================================================== */
.calc-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: start;
}

.calc-inputs-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
}

.calc-field {
  margin-bottom: 20px;
}

.calc-field:last-child {
  margin-bottom: 0;
}

.calc-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.calc-label-row label {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
}

.calc-val-badge {
  font-size: 13px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.calc-range-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #334155;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.calc-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #06b6d4;
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
  cursor: pointer;
  transition: transform 0.1s;
}

.calc-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Results Cards Grid */
.calc-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.calc-metric-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.calc-metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.4);
}

.calc-metric-card.highlight {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%), rgba(15, 23, 42, 0.9);
  border-color: rgba(16, 185, 129, 0.4);
}

.metric-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.metric-number {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 4px;
}

.metric-number.emerald {
  color: #34d399;
}

.metric-number.cyan {
  color: #38bdf8;
}

.metric-sub {
  font-size: 12px;
  color: #64748b;
}

.calc-disclaimer {
  grid-column: span 2;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  margin-top: 10px;
  line-height: 1.4;
}

/* Responsive Breakpoints */
@media (max-width: 860px) {
  .drag-selectors-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .vs-badge {
    margin: 0 auto;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .interactive-garage-section {
    padding: 24px 16px;
    margin: 40px 0 30px 0;
  }
  .garage-title {
    font-size: 24px;
  }
  .calc-results-grid {
    grid-template-columns: 1fr;
  }
  .calc-metric-card.highlight {
    grid-column: span 1;
  }
  .specs-table th, .specs-table td {
    padding: 8px 10px;
    font-size: 12px;
  }
}
