/* ── 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 ── */
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: var(--bg-base); }
#sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
#sidebar::-webkit-scrollbar-thumb:hover { background: #3b4260; }

#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
───────────────────────────── */

/* Sidebar collapses to slim nav panel */
body.nav-active #sidebar {
  width: 280px;
  min-width: 280px;
  overflow: hidden;
}

/* Hide normal sidebar sections in nav mode */
body.nav-active #vehicleSection,
body.nav-active #searchSection,
body.nav-active #stopListSection,
body.nav-active #recommendedSection,
body.nav-active #bridgeSection,
body.nav-active #ferrySection,
body.nav-active #navBtnSection {
  display: none !important;
}

/* Show nav panel in nav mode */
body.nav-active #navPanel {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* Nav panel base */
#navPanel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  font-family: system-ui, -apple-system, sans-serif;
}

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

/* Sidebar in nav mode — flex column so nav panel fills remaining height */
body.nav-active #sidebar {
  display: flex;
  flex-direction: column;
}

/* ── 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); }
}

/* ── Map banner transition ── */
#navBannerMap {
  transition: opacity 0.2s;
}

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

body.nav-active #trafficSection { display: none !important; }
