/* ==========================================================================
   GUBIMAPPA — B2B ENTERPRISE GEOSPATIAL STYLESYSTEM
   Theme: Obsidian (#1A1A1A) & Gubimappa Gold (#FFD700)
   Layout: Unified Left Cockpit & Pristine Map Canvas
   ========================================================================== */

:root {
  --bg-obsidian: #121212;
  --bg-surface: rgba(22, 22, 22, 0.88);
  --bg-surface-elevated: rgba(28, 28, 28, 0.95);
  --bg-card: rgba(14, 14, 14, 0.65);
  --bg-input: rgba(10, 10, 10, 0.75);

  --gold-primary: #FFD700;
  --gold-hover: #FFE433;
  --gold-muted: rgba(255, 215, 0, 0.14);
  --gold-glow: rgba(255, 215, 0, 0.28);
  --gold-border: rgba(255, 215, 0, 0.45);

  --text-primary: #FFFFFF;
  --text-secondary: #A3A3A3;
  --text-muted: #666666;

  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.14);

  --radius-pill: 9999px;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-cockpit: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 1px rgba(255, 255, 255, 0.12);
  --shadow-gold: 0 8px 24px rgba(255, 215, 0, 0.25);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   LIGHT MODE THEME SYSTEM (Obsidian & Burnished Imperial Gold Aesthetic)
   ========================================================================== */
[data-theme="light"],
body.theme-light {
  --bg-obsidian: #F4F6F9;
  --bg-surface: rgba(255, 255, 255, 0.92);
  --bg-surface-elevated: rgba(255, 255, 255, 0.98);
  --bg-card: rgba(240, 243, 248, 0.85);
  --bg-input: #FFFFFF;

  --gold-primary: #C58B02;
  --gold-hover: #A67300;
  --gold-muted: rgba(197, 139, 2, 0.12);
  --gold-glow: rgba(197, 139, 2, 0.22);
  --gold-border: rgba(197, 139, 2, 0.38);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --border-hairline: rgba(15, 23, 42, 0.08);
  --border-subtle: rgba(15, 23, 42, 0.15);

  --shadow-cockpit: 0 20px 48px rgba(15, 23, 42, 0.10), 0 0 1px rgba(0, 0, 0, 0.10);
  --shadow-gold: 0 8px 24px rgba(197, 139, 2, 0.18);
}

[data-theme="light"] .sidebar-cockpit,
body.theme-light .sidebar-cockpit {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .map-controls-pill,
body.theme-light .map-controls-pill {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
}

[data-theme="light"] .v-pill-btn.active,
body.theme-light .v-pill-btn.active {
  color: #FFFFFF;
}

[data-theme="light"] .dest-badge,
body.theme-light .dest-badge {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  color: #FFFFFF;
  border-color: rgba(197, 139, 2, 0.65);
}

[data-theme="light"] .minimal-attribution,
body.theme-light .minimal-attribution {
  color: #64748B;
  opacity: 0.85;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  user-select: none;
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1), width 0.35s cubic-bezier(0.16, 1, 0.3, 1), height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: left, width, height;
}

@media (min-width: 769px) {
  body:not(.sidebar-collapsed) #map {
    left: 412px;
    width: calc(100% - 412px);
  }

  body.sidebar-collapsed #map {
    left: 0;
    width: 100%;
  }

  body:not(.sidebar-collapsed) .minimal-attribution {
    left: calc(412px + (100% - 412px) / 2);
    transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

/* ==========================================================================
   UNIFIED LEFT COCKPIT SIDEBAR
   ========================================================================== */
.sidebar-cockpit {
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 16px;
  width: 380px;
  max-width: calc(100vw - 32px);
  z-index: 20;
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-cockpit);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.4s var(--ease-spring), opacity 0.3s;
  transform: translateZ(0);
  will-change: transform;
}

.sidebar-cockpit.collapsed {
  transform: translateX(-110%) translateZ(0);
  opacity: 0;
  pointer-events: none;
}

/* Re-open Trigger Pill (When sidebar is collapsed) */
.expand-sidebar-pill {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 19;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(22, 22, 22, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
  transform: translateZ(0);
}

.expand-sidebar-pill:hover {
  border-color: var(--gold-border);
  transform: scale(1.04);
}

/* Quick Navigation Action Pill (Top Right on Map Canvas) */
.quick-nav-pill {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 18;
  display: flex;
  align-items: center;
  transition: all 0.3s var(--ease-spring);
}

.quick-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), var(--shadow-gold);
  color: var(--gold-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.quick-nav-btn:hover {
  background: var(--gold-primary);
  color: var(--bg-obsidian);
  transform: translateY(-2px) scale(1.03);
}

.quick-nav-btn.is-active {
  background: rgba(239, 68, 68, 0.15);
  border-color: #EF4444;
  color: #EF4444;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.35);
}

.quick-nav-btn.is-active:hover {
  background: #EF4444;
  color: #FFFFFF;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-hairline);
  flex-shrink: 0;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold-primary);
  line-height: 1.1;
}

.brand-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
  color: var(--gold-primary);
  border-color: var(--gold-border);
  background: var(--gold-muted);
}

/* Sidebar Scrollable Body */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cockpit-view-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.3s ease-in-out;
}

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

/* ==========================================================================
   INPUT LOCATIONS BOX
   ========================================================================== */
.route-inputs-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.location-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
}

.location-input-row:hover {
  border-color: var(--border-subtle);
}

.location-input-row.active-target,
.location-input-row#rowOrigin.active-target {
  border-color: var(--gold-primary);
  background: rgba(255, 215, 0, 0.08);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.25);
}

.location-input-row#rowDestination.active-target {
  border-color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.22);
}

.point-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.origin-badge {
  background: linear-gradient(135deg, #FFE066 0%, #FFD700 100%);
  color: #121212;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.45);
  border: 1px solid rgba(255, 215, 0, 0.8);
}

.dest-badge {
  background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 100%);
  color: #121212;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 215, 0, 0.65);
}

.input-field {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.input-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.input-icon-btn:hover {
  color: var(--gold-primary);
}

.swap-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}

.swap-line {
  flex: 1;
  height: 1px;
  background: var(--border-hairline);
}

.swap-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-hairline);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.swap-action-btn:hover {
  color: var(--gold-primary);
  border-color: var(--gold-border);
  transform: rotate(180deg);
}

.click-hint-box {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  padding: 4px 0 2px;
  letter-spacing: 0.2px;
}

.click-hint-box strong {
  color: var(--gold-primary);
}

/* ==========================================================================
   VEHICLE CONTROLS & RESTRICTIONS
   ========================================================================== */
.vehicle-controls-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vehicle-pills-row {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
}

.v-pill-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.v-pill-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.v-pill-btn.active {
  background: var(--gold-primary);
  color: var(--bg-obsidian);
  box-shadow: 0 2px 10px var(--gold-glow);
}

.restriction-toggle-row {
  display: flex;
  gap: 8px;
}

.rest-chip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.chip-status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}

.rest-chip:hover {
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.rest-chip.active {
  border-color: var(--gold-border);
  background: var(--gold-muted);
  color: var(--gold-primary);
}

.rest-chip.active .chip-status-dot {
  background: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-primary);
}

.rest-chip.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.8);
}

/* ==========================================================================
   ALTERNATIVE ROUTES SELECTOR
   ========================================================================== */
.alt-routes-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.alt-routes-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.alt-routes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alt-route-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.alt-route-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 215, 0, 0.35);
  transform: translateY(-1px);
}

.alt-route-card.active {
  background: rgba(255, 215, 0, 0.08);
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

.alt-route-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alt-route-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.alt-route-card.active .alt-route-name {
  color: var(--gold-primary);
}

.alt-route-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.alt-route-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-hairline);
}

.alt-route-card.active .alt-route-badge {
  background: var(--gold-primary);
  color: var(--bg-obsidian);
  border-color: var(--gold-primary);
}

/* ==========================================================================
   ROUTE SUMMARY METRICS CARD
   ========================================================================== */
.route-metrics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metrics-grid {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}

.metric-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.metric-caption {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.metric-number {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.gold-glow-text {
  color: var(--gold-primary);
}

.metric-divider {
  width: 1px;
  height: 24px;
  background: var(--border-hairline);
}

.primary-gold-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--gold-primary);
  color: var(--bg-obsidian);
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition: all 0.2s var(--ease-spring);
}

.primary-gold-btn:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
}

.primary-gold-btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   MANEUVERS LIST
/* ==========================================================================
   MANEUVERS INSTRUCTIONS CONTAINER (PETUNJUK RUTE)
   ========================================================================== */
.maneuvers-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#planningSection .maneuvers-container {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.maneuvers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.badge-tag {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

[data-theme="light"] .badge-tag,
body.theme-light .badge-tag {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-secondary);
}

.maneuvers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

#planningSection .maneuvers-list {
  max-height: none;
  overflow: visible;
  gap: 8px;
  padding-right: 0;
}

#activeNavSection .maneuvers-container {
  margin-top: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#activeNavSection .maneuvers-list {
  max-height: calc(100vh - 430px);
  min-height: 160px;
  overflow-y: auto;
  padding-right: 4px;
}

.instruction-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  font-size: 12px;
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.35s ease, margin 0.3s ease, padding 0.3s ease;
}

[data-theme="light"] .instruction-item,
body.theme-light .instruction-item {
  background: #FFFFFF;
  border-color: rgba(15, 23, 42, 0.08);
}

.instruction-item.removing,
.instruction-item.traversed {
  overflow: hidden;
  opacity: 0;
  transform: translateX(-24px);
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important;
  pointer-events: none;
}

.instruction-step-num {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

[data-theme="light"] .instruction-step-num,
body.theme-light .instruction-step-num {
  background: rgba(15, 23, 42, 0.06);
  color: #64748B;
}

.instruction-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--gold-muted);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.instruction-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.instruction-road {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.instruction-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

.instruction-text {
  flex: 1;
  color: var(--text-secondary);
  line-height: 1.35;
}

.instruction-text strong {
  color: var(--text-primary);
}

.instruction-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.instruction-dist {
  font-family: 'Outfit', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold-primary);
  white-space: nowrap;
}

.instruction-dur {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ==========================================================================
   VIEW 2: ACTIVE NAVIGATION COCKPIT
   ========================================================================== */
.nav-active-turn-card {
  background: var(--bg-card);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-gold);
}

.turn-top-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.turn-icon-box {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--gold-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.turn-texts {
  display: flex;
  flex-direction: column;
}

.turn-dist-count {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--gold-primary);
  line-height: 1;
}

.turn-road-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 3px;
}

.turn-instruction-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  padding-top: 6px;
  border-top: 1px solid var(--border-hairline);
}

.cockpit-telemetry-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
}

.telemetry-speed-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border-hairline);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  min-width: 80px;
}

.telemetry-speed-digit {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--gold-primary);
  line-height: 1;
}

.telemetry-speed-unit {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-top: 2px;
}

.telemetry-trip-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-actions-row {
  display: flex;
  gap: 8px;
}

.nav-action-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.nav-action-pill:hover {
  background: rgba(255, 255, 255, 0.08);
}

.pause-btn:hover {
  color: var(--gold-primary);
  border-color: var(--gold-border);
}

.stop-btn {
  color: #EF4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.stop-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: #EF4444;
}

/* ==========================================================================
   SIDEBAR FOOTER
   ========================================================================== */
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border-hairline);
  background: rgba(10, 10, 10, 0.4);
  flex-shrink: 0;
}

.sensor-status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #10B981;
}

.sensor-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
}

/* ==========================================================================
   CUSTOM MAP MARKERS (Point A, Point B, Vehicle Puck)
   ========================================================================== */
.custom-marker {
  position: absolute;
  top: 0;
  left: 0;
  cursor: pointer;
  z-index: 10;
  user-select: none;
}

/* --- Simple & Elegant Waypoint Markers (Point A, Point B) --- */
.custom-marker.marker-origin,
.custom-marker.marker-dest {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 42px;
  cursor: grab;
  user-select: none;
  /* Crucial: No transform transition on the root marker element so MapLibre transforms sync synchronously */
}

.custom-marker.marker-origin:active,
.custom-marker.marker-dest:active {
  cursor: grabbing;
}

.custom-marker.marker-non-draggable {
  cursor: default !important;
}

.elegant-pin {
  position: relative;
  width: 32px;
  height: 42px;
}

.elegant-pin svg {
  display: block;
  width: 32px;
  height: 42px;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-marker:hover .elegant-pin svg {
  transform: translateY(-4px);
}

/* Subtle, flat ground shadow and calm ambient ring on road tiles - exactly centered at needle tip */
.waypoint-ground-wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.ground-shadow {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ground-shadow::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 75%);
  filter: blur(1.5px);
}

.ground-pulse-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  pointer-events: none;
  transform-origin: center center;
  animation: calmRingPulse 3.2s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
}

.ground-pulse-ring.ring-gold {
  border: 1.5px solid rgba(255, 215, 0, 0.6);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.18) 0%, transparent 70%);
}

.ground-pulse-ring.ring-plat {
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18) 0%, transparent 70%);
}

@keyframes calmRingPulse {
  0% {
    transform: scale(0.4);
    opacity: 0.85;
  }
  60% {
    opacity: 0.35;
  }
  100% {
    transform: scale(2.0);
    opacity: 0;
  }
}


/* --- Simple & Elegant High-Precision Vehicle Puck --- */
.custom-marker.marker-vehicle {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.elegant-vehicle-marker {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Highly visible, elegant forward headlight beam */
.vehicle-forward-beam {
  position: absolute;
  bottom: 24px;
  left: 50%;
  width: 72px;
  height: 88px;
  margin-left: -36px;
  pointer-events: none;
  z-index: 1;
}

.vehicle-forward-beam svg {
  display: block;
  width: 72px;
  height: 88px;
  animation: beamGlow 2.5s ease-in-out infinite alternate;
}

@keyframes beamGlow {
  0% {
    opacity: 0.85;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.4));
  }
  50% {
    opacity: 1.0;
    filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.75));
  }
  100% {
    opacity: 0.85;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.4));
  }
}

/* Calm, elegant vehicle aura */
.vehicle-calm-aura {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  margin-left: -23px;
  border-radius: 50%;
  border: 1px solid rgba(255, 215, 0, 0.4);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.16) 0%, transparent 72%);
  pointer-events: none;
}

/* Minimalist Navigation Puck Disc */
.vehicle-puck-disc {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #141416;
  border: 2px solid #FFD700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.85), 0 0 10px rgba(255, 215, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.vehicle-puck-arrow {
  display: block;
  width: 24px;
  height: 24px;
}

/* ==========================================================================
   ISOLATED MAP CONTROLS PILL (BOTTOM RIGHT)
   ========================================================================== */
.map-controls-pill {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 15;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-cockpit);
  overflow: hidden;
  transform: translateZ(0);
}

.map-ctrl-btn {
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.map-ctrl-btn:hover {
  color: var(--gold-primary);
  background: rgba(255, 255, 255, 0.06);
}

.map-ctrl-btn:active {
  transform: scale(0.92);
}

.compass-ctrl svg {
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center center;
}

.btn-text-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: var(--gold-primary);
}

.ctrl-divider {
  height: 1px;
  background: var(--border-hairline);
  margin: 0 8px;
}

/* Minimal Attribution */
.minimal-attribution {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
  pointer-events: none;
  letter-spacing: 0.3px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

/* ==========================================================================
   MOBILE & RESPONSIVE BREAKPOINT
   ========================================================================== */
@media (max-width: 768px) {
  body:not(.sidebar-collapsed) #map {
    left: 0;
    width: 100%;
    height: calc(100% - 50vh);
  }

  body.sidebar-collapsed #map {
    left: 0;
    width: 100%;
    height: 100%;
  }

  #activeNavSection .maneuvers-list {
    max-height: 180px;
    min-height: 100px;
  }

  .sidebar-cockpit {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 52vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  }

  .sidebar-cockpit.collapsed {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
  }

  .map-controls-pill {
    bottom: calc(52vh + 16px);
    right: 14px;
    transition: bottom 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* When sidebar is closed / collapsed on mobile, mapControlsPill settles gently to bottom (Item 2) */
  body.sidebar-collapsed .map-controls-pill,
  .sidebar-cockpit.collapsed ~ .map-controls-pill {
    bottom: 24px;
    animation: pillSettle 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes pillSettle {
    0%   { transform: translateY(-12px); opacity: 0.9; }
    70%  { transform: translateY(2px); }
    100% { transform: translateY(0); opacity: 1; }
  }

  .expand-sidebar-pill {
    bottom: 24px;
    top: auto;
    left: 16px;
    transform: none;
  }

  .quick-nav-pill {
    top: 14px;
    right: 14px;
  }
}

/* Incident Road Markers */
.custom-marker.marker-incident {
  cursor: pointer;
  z-index: 9;
}

.incident-marker-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1F2937;
  border: 2px solid #F59E0B;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  transition: transform 0.2s var(--ease-spring);
}

.incident-marker-icon:hover {
  transform: scale(1.15);
}

.incident-marker-icon.type-flood {
  border-color: #3B82F6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.incident-marker-icon.type-closure {
  border-color: #EF4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.maplibregl-popup-content {
  background: #18181B !important;
  color: #F4F4F5 !important;
  border: 1px solid rgba(255, 215, 0, 0.2) !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.8) !important;
  font-family: 'Inter', sans-serif !important;
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip {
  border-bottom-color: #18181B !important;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
  border-top-color: #18181B !important;
}
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: #18181B !important;
}
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: #18181B !important;
}

