/* style.css - Professional Modern Design System */

/* CSS Custom Properties - Modern Design Tokens */
:root {
  /* Brand Colors */
  --brand-primary: #2563eb;
  --brand-secondary: #0ea5e9;
  --brand-accent: #8b5cf6;
  
  /* Semantic Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  /* Neutral Colors - Light Mode */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  
  /* Surface Colors */
  --surface-primary: #ffffff;
  --surface-secondary: var(--gray-50);
  --surface-tertiary: var(--gray-100);
  --surface-elevated: #ffffff;
  --surface-overlay: rgba(255, 255, 255, 0.95);
  
  /* Text Colors */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-500);
  --text-inverse: #ffffff;
  --text-accent: var(--brand-primary);
  
  /* Border Colors */
  --border-primary: var(--gray-200);
  --border-secondary: var(--gray-300);
  --border-focus: var(--brand-primary);
  --border-error: var(--error);
  
  /* Interactive States */
  --interactive-primary: var(--brand-primary);
  --interactive-primary-hover: #1d4ed8;
  --interactive-primary-active: #1e40af;
  --interactive-secondary: var(--gray-100);
  --interactive-secondary-hover: var(--gray-200);
  
  /* Spacing Scale */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  
  /* Typography Scale */
  --text-xs: 0.75rem;   /* 12px */
  --text-sm: 0.875rem;  /* 14px */
  --text-base: 1rem;    /* 16px */
  --text-lg: 1.125rem;  /* 18px */
  --text-xl: 1.25rem;   /* 20px */
  --text-2xl: 1.5rem;   /* 24px */
  --text-3xl: 1.875rem; /* 30px */
  --text-4xl: 2.25rem;  /* 36px */
  
  /* Font Weights */
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Border Radius */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
body.dark-mode {
  --surface-primary: var(--gray-900);
  --surface-secondary: var(--gray-800);
  --surface-tertiary: var(--gray-700);
  --surface-elevated: var(--gray-800);
  --surface-overlay: rgba(15, 23, 42, 0.95);
  
  --text-primary: var(--gray-100);
  --text-secondary: var(--gray-300);
  --text-tertiary: var(--gray-400);
  --text-inverse: var(--gray-900);
  
  --border-primary: var(--gray-700);
  --border-secondary: var(--gray-600);
  
  --interactive-secondary: var(--gray-700);
  --interactive-secondary-hover: var(--gray-600);
}

/* Holographic Mode Variables */
body.holographic-mode {
  /* Holographic Colors */
  --holo-primary: #00d4ff;
  --holo-secondary: #00ff88;
  --holo-accent: #ff00ff;
  --holo-blue-dark: #0a1428;
  --holo-blue-mid: #1a2f4a;
  --holo-blue-light: #0f1d35;

  /* Background Gradients */
  --holo-bg-gradient: linear-gradient(135deg, var(--holo-blue-dark) 0%, var(--holo-blue-mid) 50%, var(--holo-blue-light) 100%);
  --holo-panel-bg: rgba(10, 20, 40, 0.85);
  --holo-panel-border: rgba(0, 212, 255, 0.3);
  --holo-panel-border-hover: rgba(0, 212, 255, 0.6);

  /* Surface Colors */
  --surface-primary: var(--holo-blue-light);
  --surface-secondary: var(--holo-blue-mid);
  --surface-tertiary: var(--holo-blue-dark);
  --surface-elevated: rgba(10, 20, 40, 0.8);
  --surface-overlay: rgba(10, 20, 40, 0.95);

  /* Text Colors */
  --text-primary: var(--holo-primary);
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-tertiary: rgba(255, 255, 255, 0.6);
  --text-inverse: var(--holo-blue-dark);
  --text-accent: var(--holo-secondary);

  /* Border Colors */
  --border-primary: var(--holo-panel-border);
  --border-secondary: var(--holo-panel-border-hover);
  --border-focus: var(--holo-primary);
  --border-error: #ff4444;

  /* Interactive States */
  --interactive-primary: var(--holo-primary);
  --interactive-primary-hover: #00b8e6;
  --interactive-primary-active: #009acc;
  --interactive-secondary: var(--holo-panel-bg);
  --interactive-secondary-hover: rgba(0, 212, 255, 0.1);

  /* Shadows and Glows */
  --holo-glow-primary: 0 0 20px rgba(0, 212, 255, 0.3);
  --holo-glow-secondary: 0 0 15px rgba(0, 255, 136, 0.3);
  --holo-glow-panel: 0 0 20px rgba(0, 212, 255, 0.2), inset 0 1px 0 rgba(0, 212, 255, 0.1);
  --holo-shadow-elevated: 0 8px 32px rgba(0, 212, 255, 0.2);

  /* Background with animated grid */
  background: var(--holo-bg-gradient);
  background-attachment: fixed;
  background-size: 100% 100%;
  position: relative;
}

/* Holographic Animated Grid Background */
body.holographic-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -1;
  animation: holographicGrid 4s ease-in-out infinite;
  pointer-events: none;
}

/* Scanning effect disabled
body.holographic-mode::after {
  content: '';
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    transparent 45%,
    rgba(0, 212, 255, 0.12) 50%,
    transparent 55%,
    transparent 100%
  );
  /* animation: holoShimmer 10s linear infinite; */
  z-index: 1;
  pointer-events: none;
}
*/

@keyframes holographicGrid {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.02);
  }
}

/* Universal Holographic Panel Class */
/* ULTRA-TRANSPARENT FUTURISTIC GLASS UI COMPONENTS */
body.holographic-mode .holo-panel,
body.holographic-mode .main-header,
body.holographic-mode .filters-sidebar,
body.holographic-mode .modal,
body.holographic-mode .modal-content,
body.holographic-mode .dropdown-menu {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(0, 212, 255, 0.015) 30%,
    rgba(255, 255, 255, 0.01) 70%,
    rgba(0, 255, 136, 0.02) 100%
  ) !important;
  backdrop-filter: blur(20px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 212, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 212, 255, 0.06) !important;
}

/* MARKER CLUSTER STYLING - REMOVE BACKGROUNDS IN HOLOGRAPHIC MODE */
body.holographic-mode .marker-cluster div,
body.holographic-mode .marker-cluster span,
body.holographic-mode .marker-cluster-small div,
body.holographic-mode .marker-cluster-small span,
body.holographic-mode .marker-cluster-medium div,
body.holographic-mode .marker-cluster-medium span,
body.holographic-mode .marker-cluster-large div,
body.holographic-mode .marker-cluster-large span {
  background: transparent !important;
  background-color: transparent !important;
}

/* LEGEND STYLING - PROPER HOLOGRAPHIC THEME WITH TRANSPARENCY */
body.holographic-mode .legend,
body.holographic-mode .map-legend,
body.holographic-mode [class*="legend"] {
  background: var(--holo-panel-bg) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--holo-panel-border) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
}

/* HOLOGRAPHIC MAP STYLING - MATCH THE UI THEME */
body.holographic-mode #map {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(0, 212, 255, 0.015) 30%,
    rgba(255, 255, 255, 0.01) 70%,
    rgba(0, 255, 136, 0.02) 100%
  ) !important;
  backdrop-filter: blur(20px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(200%) !important;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.08),
    0 4px 12px rgba(0, 212, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 212, 255, 0.06) !important;
  border-radius: 16px !important;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

body.holographic-mode .leaflet-tile {
  opacity: 0.8 !important;
  mix-blend-mode: overlay !important;
  filter: hue-rotate(200deg) saturate(1.4) brightness(0.9) !important;
}

body.holographic-mode .leaflet-container {
  background: transparent !important;
  color: var(--text-secondary) !important;
}

/* ADD HOLOGRAPHIC OVERLAY TO MAP */
body.holographic-mode #map::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.25) 0%,
    rgba(0, 150, 255, 0.18) 30%,
    rgba(0, 200, 255, 0.10) 70%,
    rgba(0, 212, 255, 0.22) 100%
  );
  pointer-events: none;
  z-index: 1000;
  border-radius: 16px !important;
}

/* CRYSTALLINE SHIMMER FOR MAIN UI */
body.holographic-mode .holo-panel::before,
body.holographic-mode .main-header::before,
body.holographic-mode .filters-sidebar::before,
body.holographic-mode .rbp-section::before,
body.holographic-mode .rbp-card::before,
body.holographic-mode .filter-section::before,
body.holographic-mode .section-content::before,
body.holographic-mode .rbp-modal::before,
body.holographic-mode .modal-content::before,
body.holographic-mode .dropdown-menu::before,
body.holographic-mode .autocomplete-suggestions::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    transparent 45%,
    rgba(0, 212, 255, 0.15) 50%,
    transparent 55%,
    transparent 100%
  );
  /* animation: holoShimmer 8s linear infinite; */
  z-index: 1;
  pointer-events: none;
}

@keyframes holoShimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Panel Hover Effects */
body.holographic-mode .holo-panel:hover,
body.holographic-mode .rbp-card:hover,
body.holographic-mode .filter-section:hover {
  border-color: var(--holo-panel-border-hover) !important;
  box-shadow:
    0 0 30px rgba(0, 212, 255, 0.4),
    inset 0 1px 0 rgba(0, 212, 255, 0.2) !important;
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

/* Holographic Typography - Clean approach matching light/dark modes */
body.holographic-mode h1,
body.holographic-mode h2,
body.holographic-mode h3,
body.holographic-mode h4,
body.holographic-mode h5,
body.holographic-mode h6 {
  color: var(--text-primary) !important;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3) !important;
}

/* Comprehensive text readability fixes for holographic mode */
body.holographic-mode .rbp-text,
body.holographic-mode .sidebar-text,
body.holographic-mode .info-text,
body.holographic-mode .rbp-card-content,
body.holographic-mode .rbp-section-content,
body.holographic-mode .filter-option,
body.holographic-mode .nav-tab-text,
body.holographic-mode .rbp-waypoint-text,
body.holographic-mode .rbp-stats-text,
body.holographic-mode .prospect-info,
body.holographic-mode .stat-label,
body.holographic-mode .stat-value,
body.holographic-mode .user-name,
body.holographic-mode .user-role,
body.holographic-mode .filter-label,
body.holographic-mode .location-info,
body.holographic-mode .business-info,
body.holographic-mode .address-text,
body.holographic-mode .distance-text,
body.holographic-mode .time-text {
  background: var(--holo-panel-bg) !important;
  color: var(--text-secondary) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* Safe approach for common text containers */
body.holographic-mode p:not(.leaflet-popup-content p):not(.no-holo-bg),
body.holographic-mode span:not(.leaflet-control-zoom-in):not(.leaflet-control-zoom-out):not(.leaflet-marker-icon):not(.no-holo-bg):not(.user-name):not(.client-name):not(.btn-text):not(.legend-icon):not(.expand-icon):not(.collapse-icon):not(.subcategory-name):not(.rbp-session-text):not(.rbp-stat-label):not(.rbp-stat-value):not(.stat-label):not(.stat-value):not(.role-badge):not(.voice-btn-text):not(.checkbox-text):not(.category-name),
body.holographic-mode small:not(.no-holo-bg),
body.holographic-mode strong:not(.no-holo-bg),
body.holographic-mode em:not(.no-holo-bg) {
  background: var(--holo-panel-bg) !important;
  color: var(--text-secondary) !important;
  padding: 1px 4px !important;
  border-radius: 3px !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: inline-block !important;
}

/* SPECIFIC OVERRIDES: Remove backgrounds from UI elements that shouldn't have them */
body.holographic-mode .user-name,
body.holographic-mode .stat-label,
body.holographic-mode .stat-value,
body.holographic-mode .role-badge,
body.holographic-mode .voice-btn-text,
body.holographic-mode .checkbox-text,
body.holographic-mode .category-name,
body.holographic-mode .legend-icon,
body.holographic-mode .rbp-session-text,
body.holographic-mode .rbp-stat-label,
body.holographic-mode .rbp-stat-value {
  background: transparent !important;
  background-color: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* OVERRIDE: Remove holographic backgrounds from marker cluster numbers - HIGHER SPECIFICITY */
body.holographic-mode #map .leaflet-marker-pane .marker-cluster span,
body.holographic-mode #map .leaflet-marker-pane .marker-cluster-small span,
body.holographic-mode #map .leaflet-marker-pane .marker-cluster-medium span,
body.holographic-mode #map .leaflet-marker-pane .marker-cluster-large span {
  background: transparent !important;
  background-color: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Special handling for containers that should have text backgrounds */
body.holographic-mode .rbp-section,
body.holographic-mode .rbp-card {
  background: var(--holo-panel-bg) !important;
  border: 1px solid var(--holo-panel-border) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  border-radius: 12px !important;
}

/* Client name styling */
body.holographic-mode .client-name {
  color: var(--text-secondary) !important;
}

/* Sidebar content - match light/dark mode layout exactly */
body.holographic-mode #map-container .sidebar-content {
  background: var(--holo-panel-bg);
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid var(--holo-panel-border);
}

/* Extra override to ensure exact border matching */
body.holographic-mode .sidebar .sidebar-content {
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid var(--holo-panel-border);
}

/* Override filters-sidebar holographic effects to match light/dark mode layout exactly - HIGHEST SPECIFICITY */
body.holographic-mode .main-container .filters-sidebar {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  position: static;
  overflow: visible;
}

body.holographic-mode .main-container .filters-sidebar::before {
  display: none !important;
}

/* Filter section - match light/dark mode layout exactly */
body.holographic-mode .filter-section {
  background: var(--holo-panel-bg);
  border: none;
  border-bottom: 1px solid var(--holo-panel-border);
  margin: 0;
  border-radius: 0;
  box-sizing: border-box;
  padding: 0;
  width: 256px;
}

body.holographic-mode .filter-section:last-child {
  border-bottom: none;
}

/* Remove filter-section holographic animation effects */
body.holographic-mode .filter-section::before {
  display: none !important;
}

body.holographic-mode .filter-section:hover {
  border-color: var(--holo-panel-border) !important;
  box-shadow: none !important;
}

/* Filter-specific holographic fixes - match light/dark mode layout exactly */
body.holographic-mode .filter-group {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.holographic-mode .filter-group label,
body.holographic-mode .checkbox-label,
body.holographic-mode .radio-label {
  background: var(--holo-panel-bg) !important;
  color: var(--text-secondary) !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: inline-block !important;
  margin: 2px !important;
}

/* Filter checkbox and radio button containers */
body.holographic-mode .form-check,
body.holographic-mode .checkbox-wrapper,
body.holographic-mode .radio-wrapper {
  background: var(--holo-panel-bg) !important;
  border-radius: 6px !important;
  padding: 6px !important;
  margin: 3px 0 !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

/* CRITICAL FIX: RouteBuilder checkbox labels with white text on transparent backgrounds */
body.holographic-mode .route-builder-pro-sidebar label {
  background: var(--holo-panel-bg) !important;
  color: var(--text-secondary) !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  display: inline-block !important;
  margin: 2px !important;
  border: 1px solid rgba(0, 212, 255, 0.1) !important;
}

/* Specific fixes for RouteBuilder break/route continuation checkboxes */
body.holographic-mode .route-builder-pro-sidebar input[type="checkbox"] + label,
body.holographic-mode .route-builder-pro-sidebar .checkbox-label,
body.holographic-mode .rbp-section label,
body.holographic-mode .rbp-optimize-content label,
body.holographic-mode .rbp-break-options label {
  background: var(--holo-panel-bg) !important;
  color: var(--text-secondary) !important;
  padding: 6px 10px !important;
  border-radius: 6px !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid var(--holo-panel-border) !important;
  display: inline-block !important;
  margin: 3px !important;
  min-height: 1.5em !important;
}

/* Ensure input placeholders are visible */
body.holographic-mode input::placeholder,
body.holographic-mode textarea::placeholder,
body.holographic-mode select option {
  color: rgba(255, 255, 255, 0.6) !important;
  background: var(--holo-panel-bg) !important;
}

body.holographic-mode .rbp-header h2,
body.holographic-mode .sidebar-header h2,
body.holographic-mode .section-header h3 {
  animation: holoTextGlow 2s ease-in-out infinite alternate;
}

@keyframes holoTextGlow {
  0% {
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  }
  100% {
    text-shadow:
      0 0 10px rgba(0, 212, 255, 0.8),
      0 0 20px rgba(0, 212, 255, 0.4),
      0 0 30px rgba(0, 212, 255, 0.2);
  }
}

/* Holographic Buttons */
body.holographic-mode button,
body.holographic-mode .btn,
body.holographic-mode .rbp-btn-primary,
body.holographic-mode .rbp-btn-secondary,
body.holographic-mode .action-btn {
  background: var(--holo-panel-bg) !important;
  border: 1px solid var(--holo-panel-border) !important;
  color: var(--holo-primary) !important;
  border-radius: 8px !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  box-shadow: var(--holo-glow-primary) !important;
  transition: all 0.3s ease !important;
  font-weight: 600 !important;
}

body.holographic-mode button:hover,
body.holographic-mode .btn:hover,
body.holographic-mode .rbp-btn-primary:hover,
body.holographic-mode .rbp-btn-secondary:hover,
body.holographic-mode .action-btn:hover {
  border-color: var(--holo-panel-border-hover) !important;
  box-shadow:
    0 0 25px rgba(0, 212, 255, 0.6),
    inset 0 1px 0 rgba(0, 212, 255, 0.2) !important;
  transform: translateY(-2px) !important;
  background: rgba(0, 212, 255, 0.1) !important;
}

/* Holographic Theme Toggle Button */
body.holographic-mode .theme-toggle-btn {
  background: var(--holo-panel-bg) !important;
  border: 1px solid var(--holo-primary) !important;
  color: var(--holo-primary) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  box-shadow: var(--holo-glow-primary) !important;
  transition: all 0.3s ease !important;
  position: relative;
  overflow: hidden;
}

body.holographic-mode .theme-toggle-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 212, 255, 0.3),
    transparent
  );
  /* animation: holoShimmer 2s infinite; */
  z-index: 1;
  pointer-events: none;
}

body.holographic-mode .theme-toggle-btn #themeIcon {
  position: relative;
  z-index: 2;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.6) !important;
}

body.holographic-mode .theme-toggle-btn:hover {
  background: rgba(0, 212, 255, 0.1) !important;
  border-color: var(--holo-secondary) !important;
  color: var(--holo-secondary) !important;
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.4) !important;
  transform: scale(1.1) !important;
}

body.holographic-mode .theme-toggle-btn:hover #themeIcon {
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.8) !important;
  transform: scale(1.2) !important;
}

body.holographic-mode .theme-toggle-btn:focus {
  border-color: var(--holo-secondary) !important;
  box-shadow:
    0 0 20px rgba(0, 255, 136, 0.3),
    0 0 0 3px rgba(0, 255, 136, 0.1) !important;
  outline: none !important;
}

/* Holographic Form Inputs */
body.holographic-mode input,
body.holographic-mode select,
body.holographic-mode textarea,
body.holographic-mode .rbp-input,
body.holographic-mode .rbp-select {
  background: var(--holo-panel-bg) !important;
  border: 1px solid var(--holo-panel-border) !important;
  color: var(--text-secondary) !important;
  border-radius: 6px !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.1) !important;
}

body.holographic-mode input:focus,
body.holographic-mode select:focus,
body.holographic-mode textarea:focus,
body.holographic-mode .rbp-input:focus,
body.holographic-mode .rbp-select:focus {
  border-color: var(--holo-primary) !important;
  box-shadow:
    0 0 15px rgba(0, 212, 255, 0.4),
    inset 0 0 10px rgba(0, 212, 255, 0.2) !important;
  outline: none !important;
}

/* Holographic Navigation */
body.holographic-mode .nav-tab,
body.holographic-mode .rbp-nav .nav-tab {
  background: var(--holo-panel-bg) !important;
  border: 1px solid var(--holo-panel-border) !important;
  color: var(--text-secondary) !important;
  transition: all 0.3s ease !important;
}

body.holographic-mode .nav-tab.active,
body.holographic-mode .rbp-nav .nav-tab.active {
  background: rgba(0, 212, 255, 0.15) !important;
  border-color: var(--holo-primary) !important;
  color: var(--holo-primary) !important;
  box-shadow: var(--holo-glow-primary) !important;
}

/* Holographic Progress Indicators */
body.holographic-mode .rbp-progress,
body.holographic-mode .spinner {
  background: var(--holo-panel-bg) !important;
  border: 1px solid var(--holo-panel-border) !important;
}

body.holographic-mode .rbp-progress-bar,
body.holographic-mode .spinner {
  background: linear-gradient(90deg, var(--holo-primary), var(--holo-secondary)) !important;
  box-shadow: var(--holo-glow-primary) !important;
  animation: holoProgressPulse 1.5s ease-in-out infinite;
}

@keyframes holoProgressPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
    box-shadow:
      0 0 20px rgba(0, 212, 255, 0.6),
      0 0 40px rgba(0, 255, 136, 0.3);
  }
}

/* Holographic Tables */
body.holographic-mode table {
  background: var(--holo-panel-bg) !important;
  border: 1px solid var(--holo-panel-border) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

body.holographic-mode table th {
  background: rgba(0, 212, 255, 0.15) !important;
  color: var(--holo-primary) !important;
  border-bottom: 1px solid var(--holo-panel-border) !important;
  box-shadow: var(--holo-glow-primary) !important;
}

body.holographic-mode table tr:nth-child(even) {
  background: rgba(0, 212, 255, 0.03) !important;
}

body.holographic-mode table tr:hover {
  background: rgba(0, 212, 255, 0.08) !important;
  box-shadow: inset 0 0 20px rgba(0, 212, 255, 0.1) !important;
}

/* Holographic Cards */
body.holographic-mode .card,
body.holographic-mode .rbp-waypoint-item,
body.holographic-mode .rbp-prospect-suggestion {
  background: var(--holo-panel-bg) !important;
  border: 1px solid var(--holo-panel-border) !important;
  border-radius: 8px !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  box-shadow: var(--holo-glow-panel) !important;
  position: relative;
  overflow: hidden;
}

/* Holographic Modals */
body.holographic-mode .rbp-modal-overlay {
  background: rgba(10, 20, 40, 0.8) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* Holographic Scrollbars */
body.holographic-mode ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

body.holographic-mode ::-webkit-scrollbar-track {
  background: var(--holo-panel-bg);
  border-radius: 4px;
}

body.holographic-mode ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--holo-primary), var(--holo-secondary));
  border-radius: 4px;
  box-shadow: var(--holo-glow-primary);
}

body.holographic-mode ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--holo-secondary), var(--holo-primary));
  box-shadow:
    0 0 15px rgba(0, 212, 255, 0.6),
    0 0 25px rgba(0, 255, 136, 0.4);
}

/* CRITICAL FIX: Map legend elements with white text on transparent backgrounds */
body.holographic-mode .heatmap-legend {
  background: var(--holo-panel-bg) !important;
  border: 1px solid var(--holo-panel-border) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

body.holographic-mode .heatmap-legend h4 {
  background: var(--holo-panel-bg) !important;
  color: var(--text-primary) !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  display: inline-block !important;
}

body.holographic-mode .legend-item {
  background: var(--holo-panel-bg) !important;
  color: var(--text-secondary) !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  margin: 2px 0 !important;
  border: 1px solid rgba(0, 212, 255, 0.1) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

body.holographic-mode .legend-color {
  background: var(--holo-panel-bg) !important;
  border: 1px solid var(--holo-panel-border) !important;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.2) !important;
}

body.holographic-mode .legend-note {
  background: var(--holo-panel-bg) !important;
  color: var(--text-secondary) !important;
  padding: 6px 10px !important;
  border-radius: 4px !important;
  border: 1px solid rgba(0, 212, 255, 0.1) !important;
}

body.holographic-mode .legend-note small {
  background: var(--holo-panel-bg) !important;
  color: var(--text-tertiary) !important;
  padding: 2px 4px !important;
  border-radius: 3px !important;
  display: inline-block !important;
}

/* Fix for any other legend-related elements */
body.holographic-mode [class*="info-panel"],
body.holographic-mode .leaflet-control-attribution {
  background: var(--holo-panel-bg) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--holo-panel-border) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
}

/* Remove uppercase text transformations in holographic mode to match light/dark modes */
body.holographic-mode .site-subtitle,
body.holographic-mode .stat-label,
body.holographic-mode .role-badge,
body.holographic-mode .filter-group label,
body.holographic-mode .section-header h3,
body.holographic-mode .tab-button,
body.holographic-mode .display-options h3,
body.holographic-mode .dropdown-section h6,
body.holographic-mode .brand-tagline,
body.holographic-mode .status-badge,
body.holographic-mode .section-title,
body.holographic-mode .filter-label,
body.holographic-mode .nav-tab,
body.holographic-mode .btn-text,
body.holographic-mode .badge,
body.holographic-mode .tag,
body.holographic-mode .legend-title,
body.holographic-mode .form-label,
body.holographic-mode .input-label,
body.holographic-mode h4 {
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
               'Helvetica Neue', Arial, sans-serif;
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--surface-secondary);
  transition: background-color var(--transition-medium), color var(--transition-medium);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-semibold);
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

/* Header - Professional Design */
.main-header {
  background: var(--surface-overlay);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--space-1) 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-container {
  width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  height: 100%;
}

/* Left Section - Brand (positioned above sidebar) */
.header-left {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 320px; /* Exact sidebar width */
  flex-shrink: 0;
  padding: 0 var(--space-6);
  height: 100%;
}

.brand-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.main-header-logo {
  width: 280px;
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: all var(--transition-fast);
}

.main-header-logo:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.logo-container {
  position: relative;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.logo-icon:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.logo-icon svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.site-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin: 0;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.site-subtitle {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

/* Center Section - Stats */
.header-center {
  display: flex;
  justify-content: center;
  flex: 1;
  padding: 0 var(--space-6);
}

.stats-display {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--surface-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  text-align: center;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.stat-value {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--brand-primary);
  min-width: 32px;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-primary);
  margin: 0 var(--space-2);
}

/* Right Section - User & Actions */
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  flex-shrink: 0;
  padding: 0 var(--space-6);
  min-width: 500px;
}

.user-section {
  display: flex;
  align-items: center;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(59, 130, 246, 0.03));
  border-radius: var(--radius-xl);
  border: 1px solid rgba(37, 99, 235, 0.15);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--brand-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.user-profile:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.05));
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: var(--shadow-md);
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.user-name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: 1.2;
}

.user-role {
  display: flex;
  align-items: center;
}

.role-badge {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.role-badge.admin {
  background: linear-gradient(135deg, var(--warning), #e69100);
  color: white;
}

.role-badge.user {
  background: var(--surface-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-left: var(--space-4);
  border-left: 2px solid var(--border-primary);
  margin-left: var(--space-2);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 44px;
  white-space: nowrap;
  position: relative;
  box-shadow: var(--shadow-xs);
}

.action-btn .btn-text {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  margin-left: var(--space-1);
}

.action-btn:hover {
  background: var(--interactive-secondary-hover);
  color: var(--text-primary);
  border-color: var(--border-secondary);
  box-shadow: var(--shadow-lg);
}

.action-btn.admin-btn {
  background: linear-gradient(135deg, var(--brand-primary), #1d4ed8);
  color: white;
  border: none;
  font-weight: var(--font-semibold);
}

.action-btn.admin-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: var(--shadow-xl);
}

.action-btn.toggle-theme {
  background: var(--surface-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-primary);
  min-width: 44px;
  width: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.action-btn.toggle-theme:hover {
  background: var(--surface-tertiary);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-lg);
}

.action-btn.toggle-theme .theme-icon {
  width: 20px;
  height: 20px;
  transition: all var(--transition-fast);
}

/* Heatmap Toggle Button */
.action-btn.toggle-heatmap {
  background: var(--surface-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-primary);
  min-width: 44px;
  width: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.action-btn.toggle-heatmap:hover {
  background: var(--surface-tertiary);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-lg);
}

.action-btn.toggle-heatmap .heatmap-icon {
  width: 20px;
  height: 20px;
  transition: all var(--transition-fast);
}

/* Route Builder Header Button */
.action-btn.rbp-header-btn {
  background: var(--surface-secondary);
  color: var(--brand-primary);
  border: 2px solid var(--border-primary);
  min-width: 44px;
  width: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.action-btn.rbp-header-btn:hover {
  background: var(--surface-tertiary);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.action-btn.rbp-header-btn .rbp-icon {
  width: 20px;
  height: 20px;
  transition: all var(--transition-fast);
}

.dark-mode .action-btn.rbp-header-btn {
  background: var(--gray-800);
  color: var(--brand-primary);
  border-color: var(--gray-600);
}

.dark-mode .action-btn.rbp-header-btn:hover {
  background: var(--gray-700);
  border-color: var(--brand-primary);
}

.dark-mode .action-btn.toggle-heatmap {
  background: var(--gray-800);
  color: var(--warning);
  border-color: var(--gray-600);
}

.dark-mode .action-btn.toggle-heatmap:hover {
  background: var(--gray-700);
  border-color: var(--warning);
}

.dark-mode .action-btn.toggle-theme {
  background: var(--gray-800);
  color: var(--warning);
  border-color: var(--gray-600);
}

.dark-mode .action-btn.toggle-theme:hover {
  background: var(--gray-700);
  border-color: var(--warning);
}

/* Dark Mode Theme Toggle Button */
.dark-mode .theme-toggle-btn {
  background: var(--gray-800);
  border-color: var(--gray-600);
  color: var(--warning);
}

.dark-mode .theme-toggle-btn:hover {
  background: var(--gray-700);
  border-color: var(--warning);
  color: var(--warning);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.dark-mode .theme-toggle-btn:focus {
  border-color: var(--warning);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.action-btn.admin-btn {
  min-width: 140px;
}

.action-btn.logout-btn {
  background: linear-gradient(135deg, var(--gray-600), var(--gray-700));
  color: white;
  border: none;
  min-width: 80px;
}

.action-btn.logout-btn:hover {
  background: linear-gradient(135deg, var(--gray-700), var(--gray-800));
  box-shadow: var(--shadow-lg);
}

.action-btn:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

.action-btn.toggle-theme svg {
  width: 20px;
  height: 20px;
}


.action-btn.logout-btn {
  color: var(--error);
}

.action-btn.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error);
  color: var(--error);
}

/* Modern Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--interactive-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--interactive-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--interactive-primary-active);
  transform: translateY(0);
}

.btn-secondary {
  background: var(--interactive-secondary);
  color: var(--text-primary);
  border-color: var(--border-primary);
}

.btn-secondary:hover {
  background: var(--interactive-secondary-hover);
  border-color: var(--border-secondary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--interactive-secondary);
  color: var(--text-primary);
}




.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-lg);
}

.btn-icon {
  padding: var(--space-3);
  width: 40px;
  height: 40px;
}

/* Toggle Theme Button */
.toggle-theme {
  background: var(--interactive-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toggle-theme:hover {
  background: var(--interactive-secondary-hover);
  color: var(--text-primary);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--interactive-secondary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--space-2);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.theme-toggle-btn:hover {
  background: var(--interactive-secondary-hover);
  color: var(--text-primary);
  border-color: var(--brand-primary);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-toggle-btn:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

.theme-toggle-btn #themeIcon {
  font-size: 20px;
  transition: all var(--transition-fast);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.theme-toggle-btn:hover #themeIcon {
  transform: scale(1.1);
}

/* Main Layout Structure */
.main-container {
  display: flex;
  height: calc(100vh - 142px) !important; /* Subtract actual header height */
  min-height: calc(100vh - 142px) !important; /* Override any min-height */
  width: 100%;
  background: var(--surface-secondary);
}

.filters-sidebar {
  width: 320px; /* Matches header-left width exactly */
  background: var(--surface-primary);
  border-right: 1px solid var(--border-primary);
  flex-shrink: 0;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
  height: 100%; /* Make sidebar take full height of main-container */
}

.sidebar-header {
  padding: var(--space-4) var(--space-6); /* Match header padding */
  border-bottom: 1px solid var(--border-primary);
  background: var(--surface-elevated);
}

.sidebar-header h2 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
  text-align: center;
}

#locationCount {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-2);
  text-align: center;
}

.sidebar-content {
  padding: var(--space-4);
}

.map-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

#map {
  flex: 1;
  width: 100%;
  height: 100%;
}

/* No Locations Found Message */
.no-locations-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-12);
  box-shadow: var(--shadow-2xl);
  z-index: 1000;
  text-align: center;
  max-width: 400px;
  opacity: 0;
  animation: fadeInOut 3s ease-in-out;
  pointer-events: none;
}

.no-locations-message h3 {
  color: white;
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  margin: 0 0 var(--space-3) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.no-locations-message p {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--text-base);
  margin: 0;
  line-height: 1.5;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  85% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
}

/* Filters Section - Modern Card Design */
#filters {
  background: var(--surface-primary);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
}

.filter-container {
  max-width: 1440px;
  margin: 0 auto;
}

.filter-left {
  width: 100%;
}

.filter-row {
  display: flex;
  gap: var(--space-4);
  align-items: end;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.search-upload-row {
  display: flex;
  gap: var(--space-4);
  align-items: end;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.search-group,
.upload-group {
  flex: 1;
  min-width: 200px;
}

.filters-container {
  max-width: 1440px;
  margin: 0 auto;
}

.filters-header {
  margin-bottom: var(--space-6);
}

.filters-header h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.filters-header p {
  color: var(--text-secondary);
  margin: 0;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.filter-group label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.filter-group input,
.filter-group select {
  padding: 8px 12px;
  border: 1px solid var(--border-primary);
  border-radius: 2px;
  background: var(--surface-primary);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  transition: border-color 0.15s ease;
  appearance: none;
  margin: 0;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-group input::placeholder {
  color: var(--text-tertiary);
}

/* Input with clear button */
.input-with-clear {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-clear input {
  flex: 1;
  padding-right: 40px; /* Make room for clear button */
}

.clear-input-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  padding: 2px;
  border-radius: 2px;
  transition: all 0.15s ease;
  z-index: 2;
  line-height: 1;
  width: 18px;
  height: 18px;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
}

.clear-input-btn:hover {
  background: var(--surface-tertiary);
  color: var(--text-primary);
}

.clear-input-btn:active {
  transform: translateY(-50%) scale(0.95);
}

/* Professional Ladder Layout - No Margins, No Rounded Corners */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 12px 16px;
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border-primary);
  transition: background-color 0.15s ease;
  user-select: none;
  margin: 0;
  border-radius: 0;
}

.section-header:hover {
  background-color: var(--surface-tertiary);
}

.section-header h3 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.collapse-icon {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  min-width: 14px;
  text-align: center;
  opacity: 0.8;
}

.section-header:hover .collapse-icon {
  opacity: 1;
  color: var(--text-primary);
}

/* Section Content - Professional Ladder */
.section-content {
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              padding-top 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              padding-bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 1000px;
  padding: 16px;
  background: var(--surface-primary);
  margin: 0;
  border-radius: 0;
}

.section-content.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              padding-top 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              padding-bottom 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ladder Structure - Direct Connection */
.filter-section {
  border-bottom: 1px solid var(--border-primary);
  background: var(--surface-primary);
  margin: 0;
  border-radius: 0;
}

.filter-section:last-child {
  border-bottom: none;
}

.filter-section:first-child .section-header {
  border-top: 1px solid var(--border-primary);
}

/* Custom Select Styling */
.filter-group select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right var(--space-3) center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: var(--space-10);
}

/* Proximity Search Styling */
.proximity-search-row {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: var(--space-4) 0;
  position: relative;
}

.proximity-search-row::before {
  content: "🎯 Proximity Search";
  position: absolute;
  top: -10px;
  left: var(--space-4);
  background: var(--surface-primary);
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--interactive-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.proximity-search-row .filter-group {
  min-width: 200px;
}

.proximity-search-row .help-text {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
  font-style: italic;
}

#proximityAddress {
  background: var(--surface-primary);
  border: 2px solid var(--border-primary);
  transition: all var(--transition-normal);
}

#proximityAddress:focus {
  border-color: var(--interactive-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#proximityAddress.has-location {
  border-color: var(--status-success);
  background: rgba(16, 185, 129, 0.05);
}

#getCurrentLocation {
  background: linear-gradient(135deg, var(--interactive-primary) 0%, #1d4ed8 100%);
  border: none;
  color: white;
  font-weight: var(--font-medium);
  transition: all var(--transition-normal);
}

#getCurrentLocation:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#getCurrentLocation:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Proximity marker styling */
.proximity-marker {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Proximity Search - Uses standard ladder layout */

.proximity-status {
  margin-top: var(--space-3);
  padding: var(--space-2);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  text-align: center;
}

.proximity-status .status-text {
  color: var(--status-success);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

.proximity-status .status-warning {
  color: var(--warning);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}


/* Saved Searches Section */
.saved-search-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

#savedSearchSelect {
  flex: 1;
}

.saved-search-buttons {
  display: flex;
  gap: var(--space-1);
}

.saved-search-buttons .btn {
  min-width: 32px;
  height: 32px;
  padding: var(--space-1);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.saved-search-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.saved-search-actions .btn {
  width: 100%;
}

/* Bulk Operations Section */
.bulk-selection-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  padding: var(--space-2);
  background: rgba(59, 130, 246, 0.05);
  border-radius: var(--radius-md);
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.selected-count {
  font-weight: var(--font-medium);
  color: var(--brand-primary);
  font-size: var(--text-sm);
}

.bulk-select-actions {
  display: flex;
  gap: var(--space-2);
}

.bulk-select-actions .btn {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
}

.bulk-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bulk-actions .btn {
  width: 100%;
  justify-content: flex-start;
}

/* Location checkbox styling */
.location-checkbox {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 10;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.location-item {
  position: relative;
}

.location-item.selected {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--brand-primary);
}

/* Advanced Filters - Uses standard ladder layout */


@keyframes proximityPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Filter Actions */
.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-primary);
}

.filter-actions-left {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.filter-actions-right {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

/* Upload Section */
.upload-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
}

.upload-section label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.file-input-wrapper {
  position: relative;
  display: inline-block;
}

.file-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-input-button:hover {
  background: var(--interactive-secondary-hover);
  color: var(--text-primary);
}

/* Display Options */
.display-options {
  background: var(--surface-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.display-options h3 {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.checkbox-label:hover {
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

/* Client Mode Options */
.client-mode-options {
  margin-left: var(--space-4);
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-tertiary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--brand-primary);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.radio-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.radio-label:hover {
  color: var(--text-primary);
}

.radio-label input[type="radio"] {
  width: 14px;
  height: 14px;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

.radio-text {
  font-size: var(--text-xs);
  line-height: 1.4;
}

/* Location Count */
#locationCount {
  background: var(--surface-primary);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  text-align: center;
}

/* Loading Indicator */
#loadingIndicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface-overlay);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xl);
}

#loadingIndicator.active {
  display: flex;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-primary);
  border-top: 3px solid var(--brand-primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Map Container - Optimized height */
#map {
  height: 100%;
  width: 100%;
  border-radius: 0;
  position: relative;
}

/* Map Controls Enhancement */
.leaflet-control {
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: var(--radius-lg) !important;
}

.leaflet-control-layers {
  background: var(--surface-overlay) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

.leaflet-control-scale {
  background: var(--surface-overlay) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: var(--text-primary) !important;
}

/* Custom Popup Styling */
.leaflet-popup-content-wrapper {
  background: var(--surface-primary) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
}

.leaflet-popup-content {
  font-family: inherit !important;
  color: var(--text-primary) !important;
  margin: var(--space-4) !important;
}

.leaflet-popup-content h4 {
  color: var(--brand-primary) !important;
  font-weight: var(--font-semibold) !important;
  margin-bottom: var(--space-2) !important;
}

.leaflet-popup-tip {
  background: var(--surface-primary) !important;
  border: 1px solid var(--border-primary) !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .header-container {
    padding: 0 var(--space-4);
  }
  
  .filters-container {
    padding: 0 var(--space-4);
  }
  
  .filter-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-actions-left,
  .filter-actions-right {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .header-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: var(--space-3);
    padding: 0 var(--space-4);
  }
  
  .header-left {
    grid-row: 1;
    justify-content: center;
  }
  
  .header-center {
    grid-row: 2;
    justify-content: center;
  }
  
  .header-right {
    grid-row: 3;
    justify-content: center;
  }
  
  .stats-display {
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
  }
  
  .user-details {
    display: none;
  }
  
  #filters {
    padding: var(--space-4);
  }
  
  .checkbox-group {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  #map {
    height: 100%;
  }
}

@media (max-width: 480px) {
  :root {
    --space-6: 1rem;
    --space-8: 1.5rem;
  }
  
  .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }
  
  .filter-actions-left,
  .filter-actions-right {
    flex-direction: column;
    width: 100%;
  }
  
  #map {
    height: 100%;
  }
}

/* Heat Map Styling */
.heatmap-legend {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--surface-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-secondary);
}

.heatmap-legend h4 {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: var(--radius-sm);
  margin-right: var(--space-2);
  border: 1px solid var(--border-secondary);
  flex-shrink: 0;
}

.heatmap-options {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-secondary);
}

/* Heat map layer styling */
.heat-point {
  border-radius: 50%;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.heat-point:hover {
  opacity: 0.8;
}

/* Manufacturer filter loading state */
#heatmapManufacturer:disabled {
  background-color: var(--surface-tertiary);
  color: var(--text-tertiary);
}

.legend-note {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-secondary);
}

.legend-note small {
  color: var(--text-tertiary);
  font-style: italic;
}

/* ===== INLINE AUTOCOMPLETE STYLES ===== */

/* Subtle indicator when autocomplete is active */
.autocomplete-active {
  background: linear-gradient(135deg, 
    rgba(37, 99, 235, 0.03) 0%, 
    rgba(59, 130, 246, 0.02) 100%);
  border-color: var(--brand-primary) !important;
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb, 37, 99, 235), 0.1) !important;
}

/* Selected text styling for autocomplete completion */
.autocomplete-active::selection {
  background: rgba(37, 99, 235, 0.2);
  color: var(--text-primary);
}

.autocomplete-active::-moz-selection {
  background: rgba(37, 99, 235, 0.2);
  color: var(--text-primary);
}

/* Dark mode adjustments for inline autocomplete */
.dark-mode .autocomplete-active {
  background: linear-gradient(135deg, 
    rgba(37, 99, 235, 0.08) 0%, 
    rgba(59, 130, 246, 0.05) 100%);
}

/* ===== VOICE COMMANDS STYLES ===== */

/* Voice Commands - Uses standard ladder layout */

.voice-command-interface {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
}

.voice-command-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--brand-accent);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.voice-command-btn:hover {
  background: #7c3aed;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.voice-command-btn:active {
  transform: translateY(0);
}

.voice-command-btn.listening {
  background: var(--error);
  animation: pulse-recording 1.5s infinite;
}

.voice-command-btn.processing {
  background: var(--warning);
}

.voice-command-btn .voice-btn-text {
  font-size: var(--text-sm);
}

.voice-icon {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.voice-command-btn.listening .voice-icon {
  transform: scale(1.1);
}

.voice-examples {
  text-align: center;
  margin-top: var(--space-2);
}

.voice-help-text {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  line-height: 1.4;
  display: block;
}

@keyframes pulse-recording {
  0%, 100% {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translateY(-50%) scale(1.05);
  }
}

.voice-feedback {
  margin-top: var(--space-1);
  padding: var(--space-2);
  background: rgba(var(--brand-primary-rgb, 37, 99, 235), 0.05);
  border: 1px solid rgba(var(--brand-primary-rgb, 37, 99, 235), 0.1);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-align: center;
  animation: fadeInUp 0.3s ease;
}

.voice-feedback.error {
  background: rgba(var(--error-rgb, 239, 68, 68), 0.05);
  border-color: rgba(var(--error-rgb, 239, 68, 68), 0.1);
  color: var(--error);
}

.voice-feedback.success {
  background: rgba(var(--success-rgb, 16, 185, 129), 0.05);
  border-color: rgba(var(--success-rgb, 16, 185, 129), 0.1);
  color: var(--success);
}

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

/* Dark mode adjustments for voice search */
.dark-mode .voice-search-btn {
  background: var(--surface-tertiary);
  color: var(--text-secondary);
}

.dark-mode .voice-search-btn:hover {
  background: var(--surface-elevated);
  color: var(--text-primary);
}

/* Accessibility: Focus styles for voice button */
.voice-search-btn:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* User Dropdown */
.user-dropdown {
  position: relative;
}

.user-dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: all var(--transition-fast);
}

.user-dropdown-btn:hover {
  transform: translateY(-1px);
}

.dropdown-arrow {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transition: transform var(--transition-fast);
}

.user-dropdown-btn[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 200px;
  padding: var(--space-3);
  margin-top: var(--space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: 1000;
}

.user-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-section {
  margin-bottom: var(--space-3);
}

.dropdown-section:last-child {
  margin-bottom: 0;
}

.dropdown-section h6 {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--space-2) 0;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-primary);
  margin: var(--space-3) 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--interactive-secondary-hover);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
}

/* Language Selector in Dropdown */
.language-select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--surface-primary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.language-select:hover {
  background: var(--interactive-secondary-hover);
  border-color: var(--border-secondary);
}

.language-select:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-color: var(--brand-primary);
}

/* ========================================
   Professional Header Styles
   ======================================== */

header {
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}


.header-brand {
  flex: 0 0 auto;
}

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

.logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.brand-info h1 {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-tagline {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--brand-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

.user-info > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-info span {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.3;
}

.admin-badge {
  background: var(--brand-primary);
  color: var(--text-inverse);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}


.map-nav-btn {
  background: var(--brand-primary) !important;
  color: var(--text-inverse) !important;
  border: none !important;
  font-weight: var(--font-semibold);
  transition: all var(--transition-fast);
}

.map-nav-btn:hover {
  background: var(--interactive-primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}


/* Responsive Design */
@media (max-width: 768px) {
  .header-container {
    padding: 0 var(--space-3);
    min-height: 56px;
  }
  
  .logo-container {
    gap: var(--space-2);
  }
  
  .logo {
    width: 36px;
    height: 36px;
    font-size: var(--text-base);
  }
  
  .brand-info h1 {
    font-size: var(--text-lg);
  }
  
  .brand-tagline {
    display: none;
  }
  
  .user-info {
    padding: var(--space-1) var(--space-2);
    gap: var(--space-2);
  }
  
  .user-info > div:last-child span {
    font-size: 12px;
  }
  
  .header-actions {
    gap: var(--space-1);
  }
  
  .map-nav-btn {
    padding: var(--space-1) var(--space-2) !important;
    font-size: 12px !important;
  }
}

/* Enhanced Location Popup Styles */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-primary);
}

.leaflet-popup-content {
  margin: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
}

.location-popup {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Image placeholder hover effects */
.image-placeholder {
  transition: all 0.3s ease;
}

.image-placeholder:hover {
  background: #e5e7eb !important;
  border-color: #9ca3af !important;
  transform: scale(1.02);
}

.image-placeholder:hover .image-placeholder-text {
  color: #374151;
}

/* Loading state animation */
.image-placeholder:has(.loading) {
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* Star rating styles */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.star-rating .stars {
  color: #fbbf24;
  font-size: 16px;
  line-height: 1;
}

.star-rating .rating-value {
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
}

/* Enhanced popup sections */
.popup-rating-section {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #e5e7eb;
  margin: 8px 0;
}

.popup-hours-section {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  margin: 8px 0;
}

.popup-hours-section .hours-title {
  font-size: 14px;
  color: #374151;
  font-weight: 600;
  margin-bottom: 4px;
}

.popup-hours-section .hours-content {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

/* Contact links styling */
.popup-contact-link {
  color: #3b82f6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.popup-contact-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* Gallery link styling */
.popup-gallery-link {
  color: #3b82f6;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.popup-gallery-link:hover {
  color: #1d4ed8;
}

/* Dark mode adjustments for popups */
body.dark-mode .leaflet-popup-content-wrapper {
  background: var(--surface-elevated-dark);
  border-color: var(--border-primary-dark);
}

body.dark-mode .location-popup {
  color: var(--text-primary-dark);
}

body.dark-mode .location-popup h4 {
  color: var(--text-primary-dark);
}

body.dark-mode .popup-hours-section {
  background: rgba(55, 65, 81, 0.3);
  border-color: var(--border-primary-dark);
}

body.dark-mode .image-placeholder {
  background: rgba(55, 65, 81, 0.3) !important;
  border-color: var(--border-primary-dark) !important;
  color: var(--text-secondary-dark);
}

body.dark-mode .image-placeholder:hover {
  background: rgba(75, 85, 99, 0.4) !important;
  border-color: var(--border-secondary-dark) !important;
}

/* ================================
   Route Builder Visual Elements
   ================================ */

/* Business Location Marker */
.business-location-marker {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 1000;
}

.business-location-marker .marker-content {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 
    0 4px 12px rgba(37, 99, 235, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.1);
  animation: businessLocationPulse 2s ease-in-out infinite;
  cursor: pointer;
  transition: all 0.3s ease;
}

.business-location-marker .marker-content:hover {
  transform: scale(1.1);
  box-shadow: 
    0 6px 16px rgba(37, 99, 235, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.15);
}

@keyframes businessLocationPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

/* Route Direction Arrows */
.route-arrow {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 800;
}

.route-arrow > div {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.route-arrow:hover > div {
  transform: scale(1.2);
  color: #1d4ed8 !important;
}

/* Waypoint Number Markers */
.waypoint-number-marker {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 900;
}

.waypoint-number {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 2px solid #2563eb;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: #2563eb;
  box-shadow: 
    0 3px 8px rgba(37, 99, 235, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.waypoint-number:hover {
  transform: scale(1.15);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  box-shadow: 
    0 4px 12px rgba(37, 99, 235, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Dark Mode Adjustments for Route Elements */
body.dark-mode .business-location-marker .marker-content {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: var(--surface-elevated-dark);
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .waypoint-number {
  background: linear-gradient(135deg, var(--surface-elevated-dark), var(--gray-700));
  border-color: #3b82f6;
  color: #60a5fa;
  box-shadow: 
    0 3px 8px rgba(59, 130, 246, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2);
}

body.dark-mode .waypoint-number:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.25);
}

body.dark-mode .route-arrow > div {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  color: #60a5fa !important;
}

body.dark-mode .route-arrow:hover > div {
  color: #3b82f6 !important;
}

/* HOLOGRAPHIC MODE - MARKER CLUSTER FIXES */
/* Remove backgrounds from marker cluster numbers - HIGH SPECIFICITY */
body.holographic-mode .leaflet-marker-pane .marker-cluster div span,
body.holographic-mode .leaflet-marker-pane .marker-cluster-small div span,
body.holographic-mode .leaflet-marker-pane .marker-cluster-medium div span,
body.holographic-mode .leaflet-marker-pane .marker-cluster-large div span,
body.holographic-mode .marker-cluster div span,
body.holographic-mode .marker-cluster-small div span,
body.holographic-mode .marker-cluster-medium div span,
body.holographic-mode .marker-cluster-large div span {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}

