/* ── Design tokens ── */
:root {
  --bg-base:       #0f1117;
  --bg-card:       #1a1d27;
  --border:        #2a2d3a;
  --text-primary:  #ffffff;
  --text-secondary:#9ca3af;
  --text-muted:    #6b7280;
  --accent:        #3b82f6;
  --accent-fg:     #ffffff;
  --amber:         #f59e0b;
  --green:         #10b981;
}

/* ── Prevent body scroll; map fills right panel ── */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

/* ── Sidebar custom scrollbar ── */
#sidebarContent {
  overflow-y: scroll;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 #1a1d27;
}

#sidebarContent::-webkit-scrollbar {
  width: 6px;
}

#sidebarContent::-webkit-scrollbar-track {
  background: #1a1d27;
  border-radius: 0;
}

#sidebarContent::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 3px;
  min-height: 40px;
}

#sidebarContent::-webkit-scrollbar-thumb:hover {
  background: #60a5fa;
}

#sidebar::-webkit-scrollbar {
  width: 0;
}

#recommendedList::-webkit-scrollbar { width: 4px; }
#recommendedList::-webkit-scrollbar-track { background: var(--bg-card); }
#recommendedList::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Leaflet map fills its container ── */
#map { width: 100%; height: 100%; }

/* ── Custom Leaflet marker labels ── */
.coach-stop-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2.5px solid #fff;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  font-family: system-ui, sans-serif;
}

.coach-stop-marker.active {
  background: #10b981;
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(16,185,129,0.35);
}

.rec-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid #fff;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* ── Dark leaflet tiles credit bar ── */
.leaflet-control-attribution {
  background: rgba(15,17,23,0.85) !important;
  color: #6b7280 !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: #9ca3af !important; }

/* ── Stop list drag handle cursor ── */
.drag-handle { cursor: grab; }

/* ── Navigate button shake ── */
@keyframes navShake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}
.nav-btn-shake { animation: navShake 0.45s ease; }

/* ─────────────────────────────
   NAVIGATION MODE — full screen
───────────────────────────── */

/* Sidebar disappears entirely in nav mode */
body.nav-active #sidebar {
  display: none !important;
}

/* Map fills entire screen */
body.nav-active #map {
  width: 100vw !important;
  position: fixed !important;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100;
}

/* Map tilt perspective during navigation */
body.nav-active .leaflet-map-pane {
  transform-origin: center bottom;
  transition: transform 0.3s ease;
}

/* Heading-up rotation wrapper */
#mapRotateWrapper {
  width: 100%;
  height: 100%;
  transform-origin: center center;
  transition: transform 0.5s ease-out;
}

/* Floating HUD panels — hidden by default, shown by JS */
#navTopCard,
#navBottomBar,
#navSpeedBadge,
#navRecenterBtn,
#navBusLaneBadge {
  display: none;
}

/* Smooth map heading rotation */
.leaflet-map-pane {
  transition: transform 0.8s ease-out;
}

/* Speed badge pulse when speeding */
@keyframes speedPulse {
  0%, 100% { border-color: #2a2d3a; }
  50%       { border-color: #ef4444; }
}

/* ── User position pulse animation ── */
@keyframes positionPulse {
  0%   { box-shadow: 0 0 0 0 rgba(59,130,246,0.5); }
  70%  { box-shadow: 0 0 0 12px rgba(59,130,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}

/* ── Traffic layer ── */
@keyframes trafficPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
#trafficDot.active { animation: trafficPulse 1.5s infinite; }

/* ── Layer widget repositions during active navigation ── */
body.nav-active #layerWidget {
  bottom: 170px; /* above the bottom nav bar */
}

/* ── Hide coach drop-off sidebar section during active navigation ── */
body.nav-active #coachDropoffSection { display: none !important; }
