/* ==========================================================================
   ZEVVY MAPS - PROFESSIONAL EV ROUTE PLANNER
   Modern, Clean Design System
   ========================================================================== */

:root {
  /* Zevvy Brand Colors - Green/Teal Theme */
  --primary-50: #e6f7f4;
  --primary-100: #b3e6db;
  --primary-200: #80d5c2;
  --primary-300: #4dc4a9;
  --primary-400: #26b896;
  --primary-500: #00a884;  /* Main Zevvy Green */
  --primary-600: #009874;
  --primary-700: #008564;
  --primary-800: #007254;
  --primary-900: #005f44;

  /* Secondary - Dark Teal */
  --secondary-500: #00695c;
  --secondary-600: #00564a;
  --secondary-700: #004d42;

  /* Success */
  --success-500: #10b981;
  --success-600: #059669;

  /* Warning */
  --warning-500: #f59e0b;
  --warning-600: #d97706;

  /* Error */
  --error-500: #ef4444;
  --error-600: #dc2626;

  /* Neutral Grays - Light Mode */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Background & Text */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #9ca3af;
  --border-color: #e5e7eb;

  /* Typography - Smaller sizes */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --text-xs: 0.688rem;    /* 11px */
  --text-sm: 0.813rem;    /* 13px */
  --text-base: 0.938rem;  /* 15px */
  --text-lg: 1.063rem;    /* 17px */
  --text-xl: 1.125rem;    /* 18px */
  --text-2xl: 1.375rem;   /* 22px */
  --text-3xl: 1.75rem;    /* 28px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Spacing - Tighter spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;

  /* Shadows - Subtle */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 2px 4px -1px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 4px 8px -2px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 8px 16px -4px rgb(0 0 0 / 0.12);
  --shadow-2xl: 0 16px 32px -8px rgb(0 0 0 / 0.15);

  /* Transitions */
  --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-fixed: 1200;
  --z-modal-backdrop: 1300;
  --z-modal: 1400;
  --z-tooltip: 1600;
}

/* ===================== Mobile UI Scaling & De-cluttering ===================== */
@media (max-width: 768px) {
  /* Reduce size of floating UI panels so the map is dominant */
  :root {
    --mobile-layout-gap: 0.5rem;
    --mobile-header-height: 0px;
    --mobile-bottom-nav-height: 0px;
    --mobile-bottom-sheet-height: 0px;
    --mobile-bottom-sheet-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
    --mobile-recenter-bottom: calc(18rem + env(safe-area-inset-bottom, 0px));
    --mobile-search-toolbar-max-height: calc(var(--mobile-vh, 100dvh) - 20rem);
  }

  .mobile-bottom-sheet__panel,
  .glass-panel,
  .glass-sheet,
  .mobile-bottom-sheet,
  .mobile-fab-btn,
  .bottom-nav-rail,
  nav.bottom-nav-rail,
  .mobile-menu-item {
    transform: scale(0.82);
    transform-origin: top center;
  }

  #mobile-explorer-bottom-sheet,
  #mobile-explorer-bottom-sheet .mobile-bottom-sheet__panel {
    transform: none;
  }

  #mobile-search-toolbar {
    left: 0;
    right: 0;
    top: calc(var(--mobile-header-height, 4.5rem) + var(--mobile-layout-gap, 0.875rem));
  }

  #mobile-search-toolbar > div {
    width: min(92vw, 32rem);
    gap: 0.5rem;
    max-height: none;
    overflow: visible;
  }

  #mobile-explorer-bottom-sheet {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: none;
    bottom: var(--mobile-bottom-sheet-bottom, calc(5.75rem + env(safe-area-inset-bottom, 0px)));
    margin: 0;
    z-index: 35;
    max-height: min(42dvh, calc(var(--mobile-vh, 100dvh) - var(--mobile-header-height, 4.5rem) - var(--mobile-bottom-nav-height, 5rem) - var(--mobile-layout-gap, 0.875rem) * 4));
    overflow-y: auto;
  }

  /* Add extra breathing room around floating controls */
  .mobile-search-shell {
    margin: 0;
    padding: 0.4rem 0.6rem;
    transform: none !important;
  }
  .mobile-bottom-sheet { margin-bottom: 0.75rem; }
  .bottom-nav-rail { padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom)); width: 100vw; left: 0; right: 0; transform: none !important; }

  /* Make top inputs more compact */
  #mobile-source-input, #mobile-destination-input { height: 34px; font-size: 12px; }

  #map {
    position: fixed;
    inset: 0;
  }

  /* Hide any legacy center speedometer selectors as a safety net */
  #nav-speed-value, .center-speedometer, .speedometer-overlay { display: none !important; }
}

/* Slightly reduce shadow intensity on mobile to keep map readable */
.shadow-top { box-shadow: 0 -6px 12px rgba(2,6,23,0.08); }

/* Suggestion header style for mobile autocomplete */
.suggest-header {
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

/* Mobile suggestion list: fixed positioning to stay above virtual keyboard and scrollable */
@media (max-width: 768px) {
  #mobile-search-suggestions {
    position: fixed !important;
    margin-top: 0;
    min-height: 220px;
    max-height: min(55dvh, 360px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    box-shadow: 0 8px 24px rgba(2,6,23,0.12);
    border-radius: 12px;
    padding: 4px 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    z-index: 4000;
    box-sizing: border-box;
  }

  .mobile-search-suggestions-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid rgba(0,0,0,0.04);
    color: var(--text-primary);
  }

  .mobile-search-suggestions-item.is-active {
    background: rgba(0, 168, 132, 0.10);
  }

  .mobile-search-suggestions-item:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: -2px;
  }

  .mobile-search-suggestions-item .left {
    display:flex; align-items:center; gap:10px; min-width:0;
  }

  .mobile-search-suggestions-item .icon {
    width:28px; height:28px; display:flex; align-items:center; justify-content:center; border-radius:6px; background:rgba(0,0,0,0.04);
  }

  .mobile-search-suggestions-item .meta { color: var(--text-secondary); font-size: 12px; white-space:nowrap; }
}

/* Mobile segmented control: make active state match desktop brand */
@media (max-width: 768px) {
  .tab-group { background: rgba(255,255,255,0.9); padding: 6px; }
  .tab-group .tab { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
  .tab-group .tab.tab-active {
    background: linear-gradient(120deg, var(--primary-400), var(--primary-600));
    color: #fff;
    box-shadow: 0 6px 16px rgba(2,6,23,0.12);
  }

  #mobile-route-toggle {
    width: 100%;
    z-index: 30;
  }

  #mobile-route-toggle > div {
    width: auto;
    max-width: 18rem;
  }

  #mobile-route-toggle button {
    min-width: 0;
    white-space: nowrap;
    pointer-events: auto;
  }

  #mobile-view-explorer > header,
  #mobile-view-route > header,
  #mobile-view-alerts > header {
    z-index: 60;
  }

  .mobile-recenter-fab {
    position: absolute;
    right: 1rem;
    bottom: var(--mobile-recenter-bottom, calc(6.5rem + env(safe-area-inset-bottom, 0px)));
    z-index: 55;
  }

  .mobile-map-fab {
    position: relative;
    z-index: 40;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.18));
  }
}


/* Dark Mode */
[data-theme="dark"] {
  --gray-50: #1f2937;
  --gray-100: #374151;
  --gray-200: #4b5563;
  --gray-300: #6b7280;
  --gray-400: #9ca3af;
  --gray-500: #d1d5db;
  --gray-600: #e5e7eb;
  --gray-700: #f3f4f6;
  --gray-800: #f9fafb;
  --gray-900: #ffffff;

  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-tertiary: #374151;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-tertiary: #9ca3af;
  --border-color: #374151;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 2px 4px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 4px 8px -2px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 8px 16px -4px rgb(0 0 0 / 0.6);
  --shadow-2xl: 0 16px 32px -8px rgb(0 0 0 / 0.7);
}

/* Apply dark mode globally */
  html[data-theme="dark"] body {
    background: #05070d;
    color: #f3f7fb;
  }

  html[data-theme="dark"] .header,
  html[data-theme="dark"] #sidebar,
  html[data-theme="dark"] #route-planning-controls,
  html[data-theme="dark"] #results-panel,
  html[data-theme="dark"] .map-control-panel,
  html[data-theme="dark"] .desktop-recenter-control,
  html[data-theme="dark"] .card,
  html[data-theme="dark"] .vehicle-card,
  html[data-theme="dark"] .modal,
  html[data-theme="dark"] .toast,
  html[data-theme="dark"] .autocomplete-dropdown,
  html[data-theme="dark"] .tab-group,
  html[data-theme="dark"] .input,
  html[data-theme="dark"] .btn-ghost,
  html[data-theme="dark"] .btn-outline,
  html[data-theme="dark"] .btn-primary,
  html[data-theme="dark"] .btn-secondary {
    background-color: #090f18 !important;
    background-image: none !important;
    border-color: #1b3a4f !important;
    color: #f3f7fb !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35) !important;
  }

  html[data-theme="dark"] #route-planning-controls,
  html[data-theme="dark"] #results-panel {
    background: #070d16 !important;
  }

  html[data-theme="dark"] .bg-white,
  html[data-theme="dark"] .bg-gray-50,
  html[data-theme="dark"] .bg-gray-100,
  html[data-theme="dark"] .bg-gradient-to-r,
  html[data-theme="dark"] .bg-gradient-to-br,
  html[data-theme="dark"] .bg-gradient-to-b {
    background-image: none !important;
    background-color: #0b1320 !important;
  }

  html[data-theme="dark"] [class*="bg-white"],
  html[data-theme="dark"] [class*="bg-gray-50"],
  html[data-theme="dark"] [class*="bg-gray-100"],
  html[data-theme="dark"] [class*="bg-slate-50"],
  html[data-theme="dark"] [class*="bg-slate-100"] {
    background-color: #0b1320 !important;
    background-image: none !important;
  }

  html[data-theme="dark"] [class*="bg-surface-container"],
  html[data-theme="dark"] [class*="bg-neutral-50"],
  html[data-theme="dark"] [class*="bg-neutral-100"],
  html[data-theme="dark"] [class*="bg-blue-50"],
  html[data-theme="dark"] [class*="bg-cyan-50"],
  html[data-theme="dark"] [class*="bg-teal-50"] {
    background-color: #0b1320 !important;
    background-image: none !important;
  }

  html[data-theme="dark"] .glass-panel,
  html[data-theme="dark"] .modal-content,
  html[data-theme="dark"] .modal-body,
  html[data-theme="dark"] .login-modal,
  html[data-theme="dark"] .register-modal,
  html[data-theme="dark"] .maplibregl-popup-content {
    background: #070d16 !important;
    color: #f3f7fb !important;
  }

  html[data-theme="dark"] .maplibregl-popup-tip {
    border-top-color: #070d16 !important;
    border-bottom-color: #070d16 !important;
  }

  html[data-theme="dark"] .maplibregl-popup-close-button {
    color: #f3f7fb !important;
  }



  html[data-theme="dark"] .glass-panel input,
  html[data-theme="dark"] .glass-panel textarea,
  html[data-theme="dark"] .glass-panel select,
  html[data-theme="dark"] .login-modal input,
  html[data-theme="dark"] .register-modal input {
    background: #0a1622 !important;
    border-color: #1f4d68 !important;
    color: #dffcf5 !important;
  }

  html[data-theme="dark"] .border,
  html[data-theme="dark"] .border-b,
  html[data-theme="dark"] .border-t,
  html[data-theme="dark"] .border-l,
  html[data-theme="dark"] .border-r,
  html[data-theme="dark"] .border-gray-100,
  html[data-theme="dark"] .border-gray-200,
  html[data-theme="dark"] .border-gray-300 {
    border-color: #1b3a4f !important;
  }

  html[data-theme="dark"] .text-gray-900,
  html[data-theme="dark"] .text-gray-800,
  html[data-theme="dark"] .text-gray-700,
  html[data-theme="dark"] .text-gray-600,
  html[data-theme="dark"] .text-gray-500,
  html[data-theme="dark"] .text-gray-400 {
    color: #c7d4e3 !important;
  }

  html[data-theme="dark"] .text-gray-300,
  html[data-theme="dark"] .text-gray-200,
  html[data-theme="dark"] .text-white {
    color: #f3f7fb !important;
  }

  html[data-theme="dark"] .shadow-lg,
  html[data-theme="dark"] .shadow-xl,
  html[data-theme="dark"] .shadow-2xl,
  html[data-theme="dark"] .shadow-md,
  html[data-theme="dark"] .shadow-sm {
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32) !important;
  }

  html[data-theme="dark"] .empty-state-icon,
  html[data-theme="dark"] .map-control-btn,
  html[data-theme="dark"] .mobile-fab-btn,
  html[data-theme="dark"] .btn-ghost:hover,
  html[data-theme="dark"] .btn-outline:hover {
    background: #101a28 !important;
  }

    html[data-theme="dark"] .input,
    html[data-theme="dark"] textarea,
    html[data-theme="dark"] select,
    html[data-theme="dark"] .glass-panel input {
      background: #0a1622 !important;
      border-color: #1f4d68 !important;
      color: #dffcf5 !important;
    }

    html[data-theme="dark"] .input::placeholder,
    html[data-theme="dark"] textarea::placeholder,
    html[data-theme="dark"] select::placeholder {
      color: #7aa4b7 !important;
    }

    html[data-theme="dark"] .input:-webkit-autofill,
    html[data-theme="dark"] .input:-webkit-autofill:hover,
    html[data-theme="dark"] .input:-webkit-autofill:focus,
    html[data-theme="dark"] textarea:-webkit-autofill,
    html[data-theme="dark"] select:-webkit-autofill {
      -webkit-box-shadow: 0 0 0 1000px #0a1622 inset !important;
      -webkit-text-fill-color: #dffcf5 !important;
      border-color: #1f4d68 !important;
    }

    html[data-theme="dark"] .modal-body a {
      color: #38e6d0 !important;
    }

    html[data-theme="dark"] #plan-trip-btn,
    html[data-theme="dark"] #mobile-plan-trip-btn {
      border: 1.5px solid rgba(56, 230, 208, 0.42) !important;
      box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28) !important;
    }

    html[data-theme="dark"] #plan-trip-btn:hover,
    html[data-theme="dark"] #mobile-plan-trip-btn:hover {
      border-color: rgba(56, 230, 208, 0.62) !important;
    }

/* ========== GLOBAL RESETS ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--gray-900);
  background: var(--gray-50);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  height: 100%;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  overscroll-behavior: none;
  touch-action: manipulation;
}

/* ========== VIBECON FEATURE START: THEME OVERRIDES ========== */
body.vibecon-mode {
  --primary-50: #051319;
  --primary-100: #08222c;
  --primary-200: #0b3240;
  --primary-300: #0f4a5e;
  --primary-400: #13718f;
  --primary-500: #14b8a6;
  --primary-600: #0ea694;
  --primary-700: #0b8174;
  --primary-800: #086359;
  --primary-900: #064a43;
  --secondary-500: #1f6cff;
  --secondary-600: #1a57d1;
  --secondary-700: #133f9a;
  --bg-primary: #05070d;
  --bg-secondary: #090f18;
  --bg-tertiary: #111b29;
  --text-primary: #dffcf5;
  --text-secondary: #9fd6cc;
  --text-tertiary: #6fa0b5;
  --border-color: #1b3a4f;
  background:
    radial-gradient(circle at 12% 8%, rgba(20, 184, 166, 0.2), transparent 36%),
    radial-gradient(circle at 85% 10%, rgba(31, 108, 255, 0.18), transparent 34%),
    radial-gradient(circle at 78% 88%, rgba(124, 58, 237, 0.14), transparent 38%),
    #02040a;
  color: var(--text-primary);
}

body.vibecon-mode #sidebar,
body.vibecon-mode #mode-toggle-container,
body.vibecon-mode #results-panel,
body.vibecon-mode .map-control-panel,
body.vibecon-mode .desktop-recenter-control,
body.vibecon-mode .card,
body.vibecon-mode .modal,
body.vibecon-mode .vehicle-card,
body.vibecon-mode .toast {
  background: rgba(5, 10, 18, 0.94) !important;
  border-color: rgba(25, 78, 109, 0.8) !important;
  color: var(--text-primary);
}

body.vibecon-mode .header {
  background: linear-gradient(100deg, #0ea694 0%, #1f6cff 58%, #7c3aed 100%);
}

body.vibecon-mode .bg-white,
body.vibecon-mode .bg-gray-50,
body.vibecon-mode .bg-gray-100 {
  background: rgba(7, 16, 26, 0.94) !important;
}

body.vibecon-mode .border,
body.vibecon-mode .border-b,
body.vibecon-mode .border-t,
body.vibecon-mode .border-gray-100,
body.vibecon-mode .border-gray-200,
body.vibecon-mode .border-gray-300 {
  border-color: #1b3a4f !important;
}

body.vibecon-mode .text-gray-900,
body.vibecon-mode .text-gray-800,
body.vibecon-mode .text-gray-700,
body.vibecon-mode .text-gray-600,
body.vibecon-mode .text-gray-500 {
  color: var(--text-secondary) !important;
}

body.vibecon-mode .text-primary-600,
body.vibecon-mode .text-primary-700,
body.vibecon-mode .text-primary-500 {
  color: #38e6d0 !important;
}

body.vibecon-mode .empty-state-icon,
body.vibecon-mode .tab-group,
body.vibecon-mode .btn-ghost:hover,
body.vibecon-mode .map-control-btn,
body.vibecon-mode .mobile-fab-btn,
body.vibecon-mode .autocomplete-dropdown {
  background: #111b29 !important;
  border-color: #1b3b54 !important;
}

body.vibecon-mode .input,
body.vibecon-mode textarea,
body.vibecon-mode select {
  background: #0a1622;
  border-color: #1f4d68;
  color: #dffcf5;
}

body.vibecon-mode .input:focus,
body.vibecon-mode textarea:focus,
body.vibecon-mode select:focus {
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.28);
}

body.vibecon-mode .tab-active {
  background: linear-gradient(120deg, rgba(20, 184, 166, 0.26), rgba(31, 108, 255, 0.28));
  color: #dffcf5;
}

body.vibecon-mode .btn-outline {
  background: rgba(8, 21, 33, 0.94);
  color: #35e8d2;
  border-color: #14b8a6;
}

body.vibecon-mode .btn-outline:hover {
  background: rgba(12, 32, 46, 0.96);
}

body.vibecon-mode .btn-primary {
  background: linear-gradient(135deg, #14b8a6, #1f6cff);
}

body.vibecon-mode .btn-primary:hover {
  background: linear-gradient(135deg, #0ea694, #1a57d1);
}

body.vibecon-mode .btn-secondary {
  background: linear-gradient(135deg, #1f6cff, #7c3aed);
}

body.vibecon-mode .leaflet-popup-content-wrapper,
body.vibecon-mode .leaflet-popup-tip {
  background: #0a1622 !important;
  color: #dffcf5 !important;
}

body.vibecon-mode #map {
  background: #070d16;
}
/* ========== VIBECON FEATURE END: THEME OVERRIDES ========== */

/* ========== VIBECON FEATURE START: FIRST VISIT BANNER ========== */
.first-visit-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 1.5rem));
  z-index: 1700;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(4, 38, 35, 0.2);
  border: 1px solid rgba(0, 168, 132, 0.3);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  animation: slideDown 0.35s ease-out;
}

.first-visit-banner-glow {
  position: absolute;
  inset: -35% -15% auto;
  height: 120%;
  background: radial-gradient(circle at 30% 35%, rgba(0, 168, 132, 0.2), transparent 52%),
              radial-gradient(circle at 80% 32%, rgba(31, 108, 255, 0.14), transparent 56%);
  pointer-events: none;
}

.first-visit-banner-content {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.8rem 1rem;
}

.first-visit-banner-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0a8571;
  background: linear-gradient(145deg, rgba(0, 168, 132, 0.18), rgba(31, 108, 255, 0.14));
  flex-shrink: 0;
}

.first-visit-banner-copy {
  min-width: 0;
  flex: 1;
}

.first-visit-banner-title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: #0f172a;
}

.first-visit-banner-text {
  font-size: var(--text-sm);
  color: #155e54;
}

.first-visit-banner-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

body.vibecon-mode .first-visit-banner {
  border-color: rgba(20, 184, 166, 0.45);
  background: rgba(6, 14, 23, 0.96);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
}

body.vibecon-mode .first-visit-banner-title {
  color: #dffcf5;
}

body.vibecon-mode .first-visit-banner-text {
  color: #98d7cd;
}

@media (max-width: 768px) {
  .first-visit-banner {
    display: none !important;
  }

  .first-visit-banner-content {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-2);
    padding: 0.75rem;
  }

  .first-visit-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
/* ========== VIBECON FEATURE END: FIRST VISIT BANNER ========== */

/* ========== CUSTOM SCROLLBAR ========== */
.custom-scrollbar::-webkit-scrollbar { width: 6px; height: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: var(--gray-100); border-radius: var(--radius-full); }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: var(--radius-full); }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

/* ========== HEADER ========== */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  box-shadow: var(--shadow-md);
}

.logo-container {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.logo-image {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.logo-text {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: white;
  letter-spacing: -0.02em;
}

/* ========== BUTTONS========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.65rem 1.1rem;  /* Compact padding */
  font-weight: var(--font-medium);
  font-size: 0.875rem;  /* 14px */
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid rgba(0, 0, 0, 0.08);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  box-shadow: var(--shadow-md);
}

#plan-trip-btn,
#mobile-plan-trip-btn {
  border: 1.5px solid rgba(0, 168, 132, 0.38);
}

#plan-trip-btn:hover,
#mobile-plan-trip-btn:hover {
  border-color: rgba(0, 168, 132, 0.58);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary-500), var(--secondary-600));
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: linear-gradient(135deg, var(--secondary-600), var(--secondary-700));
  box-shadow: var(--shadow-md);
}

.btn-vibecon {
  background: linear-gradient(120deg, #2258ff 0%, #1ad1b4 45%, #d9ff3f 100%);
  color: #05070d;
  font-weight: var(--font-bold);
  border: 1px solid rgba(34, 88, 255, 0.6);
  box-shadow: 0 6px 18px rgba(34, 88, 255, 0.28);
}

.btn-vibecon:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(26, 209, 180, 0.35);
}

.btn-vibecon.is-active {
  background: linear-gradient(120deg, #2258ff 0%, #11cba9 52%, #7c3aed 100%);
  color: #f5fffd;
  border-color: rgba(124, 58, 237, 0.85);
}

.btn-outline {
  background: white;
  color: var(--primary-600);
  border: 1.5px solid var(--primary-500);
}
.btn-outline:hover {
  background: var(--primary-50);
  border-color: var(--primary-600);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-700);
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-danger {
  background: linear-gradient(135deg, var(--error-500), var(--error-600));
  color: white;
}

.btn-sm { padding: 0.45rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.25rem; font-size: 0.9375rem; }
.btn-icon { padding: 0.5rem; border-radius: var(--radius-full); }

/* ========== CARDS ========== */
.card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--gray-200);
}

.card-body {
  padding: var(--space-5);
}

.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

/* ========== INPUTS ========== */
.input-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Keep icon/input layout stable even if utility classes fail to load */
.input-group .relative {
  position: relative;
}

.input-label {
  font-size: 0.8125rem;  /* 13px */
  font-weight: var(--font-medium);
  color: var(--gray-700);
}

.input {
  width: 100%;
  padding: 0.65rem var(--space-3);  /* Compact padding */
  font-size: 0.875rem;  /* 14px */
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  background: white;
  color: var(--gray-900);
}

.input-group .input {
  display: block;
  box-sizing: border-box;
  line-height: 1.35;
}

.input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

body.vibecon-mode .input:-webkit-autofill,
body.vibecon-mode .input:-webkit-autofill:hover,
body.vibecon-mode .input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0a1622 inset !important;
  -webkit-text-fill-color: #dffcf5 !important;
  border-color: #1f4d68 !important;
}

/* Autofill styling for better form appearance */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px white inset !important;
  -webkit-text-fill-color: var(--gray-900) !important;
  border-color: var(--primary-500) !important;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  width: 1.1rem;
  height: 1.1rem;
}

.input-icon.text-success-500,
.input-icon.text-error-500 {
  width: 13px;
  height: 13px;
}

.input-label .lucide-map-pin {
  width: 13px;
  height: 13px;
}

.input-with-icon {
  padding-left: 2.8rem;
}

.input-group .input-with-icon {
  padding-left: 2.8rem !important;
}

#start-input.input-with-icon {
  padding-right: 2.8rem;
}

/* ========== CHECKBOXES & FORM CONTROLS ========== */
input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
  accent-color: var(--primary-600);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-300);
  transition: all var(--transition-base);
}

input[type="checkbox"]:hover {
  border-color: var(--primary-500);
}

input[type="checkbox"]:checked {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
}

input[type="checkbox"]:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.9375rem;
  color: var(--gray-700);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
}

/* Form improved spacing in modals */
.modal-body form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.modal-body a {
  color: var(--primary-600);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-base);
}

.modal-body a:hover {
  color: var(--primary-700);
  text-decoration: underline;
}

/* ========== MODALS ========== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease-out;
}

.modal {
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  max-width: 95vw;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.2s ease-out;
  position: relative;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.modal-title {
  font-size: 1.25rem;  /* 20px */
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  padding: var(--space-2);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-full);
  color: var(--gray-500);
  transition: all var(--transition-base);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-tooltip);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 360px;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: start;
  gap: var(--space-3);
  animation: slideInRight 0.3s ease-out;
  border-left: 3px solid var(--primary-500);
  pointer-events: auto;
  min-width: 280px;
}

.toast-success { border-left-color: var(--success-500); }
.toast-error { border-left-color: var(--error-500); }
.toast-warning { border-left-color: var(--warning-500); }

.toast-content {
  flex: 1;
  font-size: var(--text-sm);
}

.toast-title {
  font-weight: var(--font-semibold);
  color: var(--gray-900);
  margin-bottom: 0.125rem;
}

.toast-message {
  color: var(--gray-600);
  font-size: var(--text-xs);
}

.toast-close {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  color: var(--gray-600);
}

/* ========== AUTOCOMPLETE ========== */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: var(--space-2);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-height: 240px;  /* Reduced height */
  overflow-y: auto;
  z-index: var(--z-dropdown);
  animation: slideDown 0.15s ease-out;
  border: 1px solid var(--gray-200);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.autocomplete-item {
  padding: var(--space-2) var(--space-4);  /* Tighter padding */
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--gray-100);
  font-size: var(--text-sm);  /* Smaller text */
  color: var(--gray-700);
}

.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

/* ========== PROGRESS BARS ========== */
.progress-bar {
  width: 100%;
  height: 6px;  /* Thinner */
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.188rem var(--space-2);  /* Smaller */
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-success {
  background: var(--success-50);
  color: var(--success-700);
}

.badge-warning {
  background: var(--warning-50);
  color: var(--warning-600);
}

.badge-error {
  background: var(--error-50);
  color: var(--error-600);
}

/* ========== VEHICLE CARD ========== */
.vehicle-card {
  background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: var(--space-3);  /* Tighter */
  cursor: pointer;
  transition: all var(--transition-base);
}

.vehicle-card:hover {
  border-color: var(--primary-500);
  box-shadow: var(--shadow-md);
}

.vehicle-icon {
  width: 40px;  /* Smaller */
  height: 40px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ========== TAB NAVIGATION ========== */
.tab-group {
  display: flex;
  gap: var(--space-2);
  background: var(--gray-100);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
}

.tab {
  flex: 1;
  padding: var(--space-2) var(--space-3);  /* Tighter */
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-weight: var(--font-medium);
  font-size: var(--text-sm);  /* Smaller */
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
}

.tab-active {
  background: white;
  color: var(--primary-600);
  box-shadow: var(--shadow-sm);
}

/* ========== EMPTY STATES ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
  text-align: center;
}

.empty-state-icon {
  width: 48px;  /* Smaller */
  height: 48px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  color: var(--gray-400);
}

.empty-state-title {
  font-size: var(--text-base);  /* Smaller */
  font-weight: var(--font-semibold);
  color: var(--gray-900);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  color: var(--gray-600);
  font-size: var(--text-sm);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ========== MAP ========== */
#map {
  height: 100dvh;
  width: 100%;
  touch-action: none;
  overscroll-behavior: none;
  pointer-events: auto;
}

.map-overlay-controls {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 55;
  pointer-events: none;
}

.map-overlay-controls .mobile-recenter-fab,
.map-overlay-controls .mobile-map-fab {
  pointer-events: auto;
}

@supports (height: 100svh) {
  .map-overlay-controls {
    height: 100svh;
  }
}

#map .maplibregl-canvas,
#map .maplibregl-canvas-container {
  touch-action: none;
  overscroll-behavior: none;
  pointer-events: auto;
}

html[data-theme="dark"] #map .maplibregl-canvas {
  filter: invert(100%) hue-rotate(180deg) brightness(85%) contrast(90%);
}

@media (min-width: 769px) {
  #map,
  #map .maplibregl-canvas,
  #map .maplibregl-canvas-container {
    touch-action: pan-x pan-y;
  }
}

.maplibregl-ctrl-attrib,
.maplibregl-ctrl-logo,
.maplibregl-ctrl-bottom-right {
  display: none !important;
}

.mobile-bottom-sheet {
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  transform-origin: bottom center;
  transition: transform var(--transition-slow), opacity var(--transition-base);
  will-change: transform;
}

.mobile-bottom-sheet.is-dragging {
  transition: none;
}

.mobile-bottom-sheet__panel {
  touch-action: pan-y;
}

.mobile-bottom-sheet__handle {
  width: 48px;
  height: 5px;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.45);
  margin: 0 auto 1rem;
  touch-action: none;
  cursor: grab;
}

.mobile-menu-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2400;
  padding: 0 0.75rem calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
  transform: translate3d(0, 110%, 0);
  transition: transform var(--transition-slow), opacity var(--transition-base);
}

.mobile-menu-sheet.is-open {
  transform: translate3d(0, 0, 0);
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.92);
  color: var(--gray-800);
  font-weight: 600;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.mobile-menu-item--danger {
  color: var(--error-600);
}

.charging-settings-modal .modal-body {
  max-height: min(70dvh, 520px);
}

.user-location-marker {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
}

.user-location-marker__accuracy {
  position: absolute;
  inset: -18px;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.12);
}

.user-location-marker__cone {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.28) 0%, rgba(37, 99, 235, 0.04) 72%, rgba(37, 99, 235, 0) 100%);
  clip-path: polygon(50% 50%, 0% 100%, 100% 100%);
  border-radius: 9999px;
  transform: rotate(var(--marker-heading, 0deg));
  transform-origin: 50% 50%;
}

.user-location-marker__dot {
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15), 0 0 10px rgba(37, 99, 235, 0.55);
  z-index: 1;
}

.map-control-panel {
  position: absolute;
  right: var(--space-3);
  top: var(--space-3);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-dropdown);
}

.desktop-recenter-control {
  position: fixed;
  right: calc(var(--space-3) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-300);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
  color: var(--gray-700);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-dropdown);
  transition: all var(--transition-base);
}

@media (min-width: 769px) {
  .desktop-recenter-control {
    display: inline-flex;
  }
}

.desktop-recenter-control:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
  color: var(--primary-700);
}

.map-control-btn {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-control-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-500);
}

.mobile-fab-rail {
  position: absolute;
  right: var(--space-2);
  bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-fixed);
}

.mobile-fab-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gray-200);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
  color: var(--gray-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  overflow: hidden;
  transition: width var(--transition-base), transform var(--transition-fast), background var(--transition-base);
}

.mobile-fab-btn .mobile-fab-label {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  transition: max-width var(--transition-base), opacity var(--transition-base);
}

.mobile-fab-btn.is-expanded,
.mobile-fab-btn:focus-visible,
.mobile-fab-btn:active {
  width: 126px;
  border-radius: var(--radius-2xl);
  justify-content: flex-start;
  padding-left: var(--space-3);
  background: var(--primary-600);
  color: white;
}

.mobile-fab-btn.is-expanded .mobile-fab-label,
.mobile-fab-btn:focus-visible .mobile-fab-label,
.mobile-fab-btn:active .mobile-fab-label {
  max-width: 72px;
  opacity: 1;
}

/* ========== RESPONSIVE MOBILE FIXES ========== */
@media (max-width: 768px) {
  :root {
    --text-xs: 0.688rem;   /* Even smaller on mobile */
    --text-sm: 0.813rem;
    --text-base: 0.875rem;
    --text-lg: 1rem;
    --text-xl: 1.063rem;
  }

  .modal {
    max-width: 95vw;
    margin: var(--space-2);
  }

  .toast-container {
    left: var(--space-3);
    right: var(--space-3);
    max-width: none;
  }

  .input {
    padding: 0.7rem var(--space-4);  /* Responsive padding for mobile */
    font-size: 0.9rem;
  }

  .input-icon {
    width: 1rem;
    height: 1rem;
  }

  .btn {
    padding: 0.65rem 1rem;  /* Responsive padding for mobile */
    font-size: 0.9rem;
  }

  .btn-lg {
    padding: 0.75rem 1.25rem;
  }

  /* Fix white patch bug - ensure results panel is visible */
  #sidebar {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 92vw;
    max-width: 92vw;
    z-index: 2200;
    box-shadow: var(--shadow-xl);
  }

  .mobile-sidebar-open .map-control-panel,
  .mobile-sidebar-open #mobile-fab-rail {
    display: none !important;
  }
}

/* ========== SKELETON LOADER & SHIMMER ANIMATION ========== */
@keyframes shimmer {
  0% {
    background-position: -1200px 0;
  }
  100% {
    background-position: calc(1200px + 100%) 0;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.shimmer-loader {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 1200px 100%;
  animation: shimmer 2s infinite;
}

/* Route drawing animation */
.leaflet-overlay-pane svg path {
  transition: stroke-dashoffset 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

  .logo-image {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
  }

  .logo-text {
    font-size: 1rem;
  }

  .input {
    font-size: 0.95rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .input-icon {
    width: 0.9rem;
    height: 0.9rem;
    left: 0.8rem;
  }

  .input-with-icon {
    padding-left: 2.4rem;
  }

  #use-location-btn {
    right: 0.45rem;
    padding: 0.3rem;
  }

  .card,
  .vehicle-card {
    border-radius: 0.65rem;
  }

  .mobile-fab-btn {
    width: 38px;
    height: 38px;
  }

  #results-panel {
    flex: 1;
    overflow-y: auto;
    background: white;
    min-height: 120px;
  }

  .map-control-panel {
    right: var(--space-2);
    top: var(--space-2);
    padding: var(--space-1);
  }

  .map-control-btn {
    padding: var(--space-2);
  }

  .map-control-panel {
    display: none;
  }

  #show-sidebar-btn {
    display: none !important;
  }

  .charging-settings-modal {
    align-items: flex-end;
    padding: 0.75rem 0.75rem 0;
  }

  .charging-settings-modal__sheet {
    max-width: 100vw;
    width: 100%;
    margin: 0;
    border-radius: 2rem 2rem 0 0;
    max-height: 90dvh;
  }

  #mobile-app,
  #mobile-views-container {
    height: var(--mobile-vh, 100dvh);
    min-height: var(--mobile-vh, 100dvh);
  }

  body.mobile-keyboard-open #mobile-app,
  body.mobile-keyboard-open #mobile-views-container,
  body.mobile-keyboard-open #sidebar {
    height: var(--mobile-vh, 100dvh) !important;
  }

  body.mobile-keyboard-open .bottom-nav-rail {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 120%);
    transition: transform var(--transition-base), opacity var(--transition-base);
  }

  body.mobile-keyboard-open .mobile-keyboard-hide {
    display: none !important;
  }

  body.mobile-keyboard-open #mobile-search-suggestions,
  body.mobile-keyboard-open .autocomplete-dropdown {
    z-index: 4000 !important;
    max-height: min(55dvh, 360px);
    min-height: 220px;
    overflow-y: auto;
  }

  #mobile-search-suggestions {
    position: fixed;
    z-index: 4000 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-search-shell {
    overflow: visible !important;
  }
}

/* ========== UTILITY CLASSES ========== */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.transition { transition: all var(--transition-base); }

/* ========== LOADING SPINNER ========== */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.route-planning-map-overlay {
  position: absolute;
  inset: 0;
  z-index: 800;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(0, 168, 132, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(5, 7, 13, 0.16), rgba(5, 7, 13, 0.28));
  backdrop-filter: blur(1px);
}

.route-planning-map-overlay.flex {
  display: flex;
}

.route-planning-map-overlay__ring {
  position: absolute;
  width: min(42vw, 420px);
  aspect-ratio: 1;
  border-radius: 9999px;
  border: 1px solid rgba(56, 230, 208, 0.35);
  box-shadow: 0 0 0 1px rgba(56, 230, 208, 0.08), inset 0 0 40px rgba(56, 230, 208, 0.12);
  animation: mapPulse 1.9s ease-out infinite;
}

.route-planning-map-overlay__ring--outer {
  width: min(58vw, 560px);
  border-color: rgba(59, 130, 246, 0.26);
  animation-delay: 0.35s;
}

.route-planning-map-overlay__scanline {
  position: absolute;
  width: min(58vw, 560px);
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(90deg, transparent, rgba(56, 230, 208, 0.95), transparent);
  box-shadow: 0 0 22px rgba(56, 230, 208, 0.45);
  animation: mapScan 2.4s ease-in-out infinite;
}

.route-planning-map-overlay__card {
  position: relative;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.95rem 1.1rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(56, 230, 208, 0.22);
  background: rgba(4, 11, 18, 0.74);
  color: #e7fff9;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
}

.route-planning-map-overlay__title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.route-planning-map-overlay__text {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  color: #95d9cf;
}

@keyframes mapPulse {
  0% { transform: scale(0.9); opacity: 0.4; }
  70% { transform: scale(1.05); opacity: 0.16; }
  100% { transform: scale(1.15); opacity: 0; }
}

@keyframes mapScan {
  0% { transform: translateY(-120px) scaleX(0.76); opacity: 0; }
  20% { opacity: 1; }
  50% { transform: translateY(0) scaleX(1); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(120px) scaleX(0.76); opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== STAR RATING ========== */
.star-rating {
  display: flex;
  gap: var(--space-1);
}

.star {
  color: var(--gray-300);
  font-size: var(--text-2xl);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  background: none;
  padding: 0;
}

.star:hover,
.star.active {
  color: #fbbf24;
}

/* ========== LEAFLET CUSTOMIZATION ========== */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: var(--space-3) !important;
  font-size: var(--text-sm) !important;
}

/* ========== NAVIGATION STATUS ========== */
.navigation-active {
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  border: 2px solid var(--primary-500);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin: var(--space-3) 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* ========== MOBILE VIEW ANIMATIONS ========== */
.fade-view {
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateY(0);
}

.fade-view.fade-hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}
