:root {
      /* Light mode colors */
      --bg-primary: rgba(255, 255, 255, 0.95);
      --bg-secondary: rgba(255, 255, 255, 0.9);
      --text-primary: #1f2937;
      --text-secondary: #64748b;
      --text-muted: #64748b;
      --border-color: rgba(255, 255, 255, 0.2);
      --shadow-light: rgba(0, 0, 0, 0.1);
      --shadow-medium: rgba(0, 0, 0, 0.15);
      --shadow-heavy: rgba(0, 0, 0, 0.2);
      --overlay-bg: rgba(0, 0, 0, 0.5);
      --map-bg: #a8d8ea;
    }

    [data-theme="dark"] {
      /* Dark mode colors */
      --bg-primary: rgba(30, 30, 30, 0.95);
      --bg-secondary: rgba(40, 40, 40, 0.9);
      --text-primary: #f8fafc;
      --text-secondary: #cbd5e1;
      --text-muted: #94a3b8;
      --border-color: rgba(60, 60, 60, 0.3);
      --shadow-light: rgba(0, 0, 0, 0.3);
      --shadow-medium: rgba(0, 0, 0, 0.4);
      --shadow-heavy: rgba(0, 0, 0, 0.6);
      --overlay-bg: rgba(0, 0, 0, 0.7);
      --map-bg: #1e293b;
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    }

    html, body {
      height: 100%;
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      overflow: hidden;
      margin: 0;
      padding: 0;
    }

    #map {
      height: 100vh;
      width: 100vw;
      position: absolute;
      top: 0;
      left: 0;
      overflow: hidden;
    }

    .leaflet-container {
      background: var(--map-bg) !important;
      overflow: hidden !important;
    }

    .leaflet-control-container {
      overflow: hidden !important;
    }

    /* Modern Controls Container */
    .controls-container {
      position: absolute;
      top: 20px;
      left: 20px;
      right: 20px;
      z-index: 1000;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    /* Top Bar */
    .top-bar {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    /* Search Button */
    .search-btn {
      background: var(--bg-primary);
      backdrop-filter: blur(20px);
      border: 1px solid var(--border-color);
      border-radius: 16px;
      padding: 12px 20px;
      display: flex;
      align-items: center;
      gap: 12px;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 8px 32px var(--shadow-light);
      flex: 1;
      min-width: 200px;
      font-size: 15px;
      color: var(--text-muted);
    }

    .search-btn:hover {
      background: var(--bg-secondary);
      box-shadow: 0 12px 40px var(--shadow-medium);
      transform: translateY(-2px);
    }

    .search-btn i {
      color: #8b5cf6;
      font-size: 16px;
    }

    /* Mode Selector - Updated for sliding */
    .mode-selector {
      background: var(--bg-primary);
      backdrop-filter: blur(20px);
      border: 1px solid var(--border-color);
      border-radius: 16px;
      padding: 6px;
      display: flex;
      gap: 4px;
      box-shadow: 0 8px 32px var(--shadow-light);
      overflow-x: auto;
      overflow-y: hidden;
      scroll-behavior: smooth;
      scrollbar-width: none;
      -ms-overflow-style: none;
      max-width: 100%;
    }

    .mode-selector::-webkit-scrollbar {
      display: none;
    }

    .mode-btn {
      background: transparent;
      border: none;
      padding: 8px 16px;
      border-radius: 12px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      color: var(--text-muted);
      white-space: nowrap;
      flex-shrink: 0;
      min-width: fit-content;
    }

    .mode-btn.active {
      background: linear-gradient(135deg, #8b5cf6, #a855f7);
      color: white;
      box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
    }

    .mode-btn:hover:not(.active) {
      background: rgba(139, 92, 246, 0.1);
      color: #8b5cf6;
    }

    /* Theme Toggle */
    .theme-toggle {
      background: var(--bg-primary);
      backdrop-filter: blur(20px);
      border: 1px solid var(--border-color);
      border-radius: 50%;
      width: 48px;
      height: 48px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      font-size: 18px;
      box-shadow: 0 8px 32px var(--shadow-light);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      flex-shrink: 0;
    }

    .theme-toggle:hover {
      background: var(--bg-secondary);
      color: #8b5cf6;
      transform: translateY(-2px);
      box-shadow: 0 12px 40px var(--shadow-medium);
    }

    .theme-toggle:active {
      transform: translateY(0);
    }

    /* Fullscreen Toggle */
    .fullscreen-toggle {
      background: var(--bg-primary);
      backdrop-filter: blur(20px);
      border: 1px solid var(--border-color);
      border-radius: 50%;
      width: 48px;
      height: 48px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      font-size: 18px;
      box-shadow: 0 8px 32px var(--shadow-light);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      flex-shrink: 0;
    }

    .fullscreen-toggle:hover {
      background: var(--bg-secondary);
      color: #8b5cf6;
      transform: translateY(-2px);
      box-shadow: 0 12px 40px var(--shadow-medium);
    }

    .fullscreen-toggle:active {
      transform: translateY(0);
    }

    /* Statistics Toggle */
    .stats-toggle {
      background: var(--bg-primary);
      backdrop-filter: blur(20px);
      border: 1px solid var(--border-color);
      border-radius: 50%;
      width: 48px;
      height: 48px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      font-size: 18px;
      box-shadow: 0 8px 32px var(--shadow-light);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      flex-shrink: 0;
    }

    .stats-toggle:hover {
      background: var(--bg-secondary);
      color: #8b5cf6;
      transform: translateY(-2px);
      box-shadow: 0 12px 40px var(--shadow-medium);
    }

    /* Statistics Panel */
    .stats-panel {
      position: fixed;
      top: 0;
      left: -100%;
      width: 100%;
      max-width: 380px;
      height: 100vh;
      background: var(--bg-primary);
      backdrop-filter: blur(30px);
      border-right: 1px solid var(--border-color);
      z-index: 2500;
      transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      overflow-y: auto;
    }

    .stats-panel.active {
      left: 0;
    }

    .stats-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 24px 20px;
      border-bottom: 1px solid var(--border-color);
    }

    .stats-header h3 {
      color: var(--text-primary);
      font-size: 18px;
      font-weight: 600;
      margin: 0;
    }

    .stats-close {
      background: rgba(0, 0, 0, 0.05);
      border: none;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      transition: all 0.2s;
    }

    .stats-close:hover {
      background: rgba(0, 0, 0, 0.1);
      color: var(--text-primary);
    }

    .stats-content {
      padding: 20px;
    }

    .stats-section {
      margin-bottom: 32px;
    }

    .stats-section h4 {
      color: var(--text-primary);
      font-size: 14px;
      font-weight: 600;
      margin-bottom: 16px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .stat-item {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px;
      border-radius: 12px;
      margin-bottom: 8px;
      background: rgba(139, 92, 246, 0.02);
      border: 1px solid rgba(139, 92, 246, 0.1);
    }

    .stat-icon {
      width: 40px;
      height: 40px;
      background: linear-gradient(135deg, #8b5cf6, #a855f7);
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 16px;
      flex-shrink: 0;
    }

    .stat-text {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .stat-label {
      color: var(--text-secondary);
      font-size: 13px;
      font-weight: 500;
    }

    .stat-value {
      color: var(--text-primary);
      font-size: 18px;
      font-weight: 600;
    }

    .stats-action-btn {
      width: 100%;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 8px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 12px;
      color: var(--text-primary);
      font-weight: 500;
      transition: all 0.2s;
    }

    .stats-action-btn:hover {
      background: rgba(139, 92, 246, 0.05);
      border-color: #8b5cf6;
      transform: translateX(4px);
    }

    .stats-action-btn i {
      color: #8b5cf6;
      width: 20px;
      text-align: center;
    }

    /* Mobile adjustments for stats */
    @media (max-width: 768px) {
      .stats-panel {
        max-width: 90%;
      }
    }

    /* Fullscreen mode adjustments */
    :-webkit-full-screen {
      background: var(--map-bg);
    }

    :-moz-full-screen {
      background: var(--map-bg);
    }

    :fullscreen {
      background: var(--map-bg);
    }

    /* Hide controls in fullscreen if desired */
    .fullscreen-mode .controls-container {
      opacity: 0.7;
      transition: opacity 0.3s ease;
    }

    .fullscreen-mode .controls-container:hover {
      opacity: 1;
    }


    /* Menu Toggle */
    .menu-toggle {
      background: var(--bg-primary);
      backdrop-filter: blur(20px);
      border: 1px solid var(--border-color);
      border-radius: 50%;
      width: 48px;
      height: 48px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      font-size: 18px;
      box-shadow: 0 8px 32px var(--shadow-light);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      flex-shrink: 0;
    }

    .menu-toggle:hover {
      background: var(--bg-secondary);
      color: #8b5cf6;
      transform: translateY(-2px);
      box-shadow: 0 12px 40px var(--shadow-medium);
    }

    /* Menu Panel */
    .menu-panel {
      position: fixed;
      top: 0;
      right: -100%;
      width: 100%;
      max-width: 350px;
      height: 100vh;
      background: var(--bg-primary);
      backdrop-filter: blur(30px);
      border-left: 1px solid var(--border-color);
      z-index: 2500;
      transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      overflow-y: auto;
    }

    .menu-panel.active {
      right: 0;
    }

    .menu-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 24px 20px;
      border-bottom: 1px solid var(--border-color);
    }

    .menu-header h3 {
      color: var(--text-primary);
      font-size: 18px;
      font-weight: 600;
      margin: 0;
    }

    .menu-close {
      background: rgba(0, 0, 0, 0.05);
      border: none;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      transition: all 0.2s;
    }

    .menu-close:hover {
      background: rgba(0, 0, 0, 0.1);
      color: var(--text-primary);
    }

    .menu-content {
      padding: 20px;
    }

    .menu-section {
      margin-bottom: 32px;
    }

    .menu-section h4 {
      color: var(--text-primary);
      font-size: 14px;
      font-weight: 600;
      margin-bottom: 16px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .menu-item {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px;
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s;
      margin-bottom: 8px;
      position: relative;
    }

    .menu-item:hover {
      background: rgba(139, 92, 246, 0.05);
    }

    .menu-item i:first-child {
      color: #8b5cf6;
      width: 20px;
      text-align: center;
    }

    .menu-item span {
      flex: 1;
      color: var(--text-primary);
      font-weight: 500;
    }

    .style-check {
      opacity: 0;
      color: #22c55e;
      transition: opacity 0.2s;
    }

    .menu-item.active .style-check {
      opacity: 1;
    }

    /* Toggle Switch */
    .toggle-switch {
      width: 48px;
      height: 24px;
      background: var(--border-color);
      border-radius: 12px;
      position: relative;
      cursor: pointer;
      transition: background-color 0.3s;
    }

    .toggle-switch.active {
      background: #8b5cf6;
    }

    .toggle-slider {
      width: 20px;
      height: 20px;
      background: white;
      border-radius: 50%;
      position: absolute;
      top: 2px;
      left: 2px;
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .toggle-switch.active .toggle-slider {
      transform: translateX(24px);
    }

    /* Search Modal */
    .search-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(8px);
      z-index: 2000;
      display: flex;
      align-items: flex-start;
      justify-content: center;
      padding: 60px 20px 20px;
      opacity: 0;
      visibility: hidden;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .search-modal.active {
      opacity: 1;
      visibility: visible;
    }

    .search-modal-content {
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(30px);
      border-radius: 24px;
      width: 100%;
      max-width: 500px;
      max-height: 70vh;
      overflow: hidden;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
      transform: translateY(-20px) scale(0.95);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .search-modal.active .search-modal-content {
      transform: translateY(0) scale(1);
    }

    .search-header {
      padding: 24px 24px 16px;
      border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .search-input-container {
      position: relative;
      margin-bottom: 16px;
    }

    .search-input {
      width: 100%;
      background: rgba(255, 255, 255, 0.8);
      border: 2px solid rgba(139, 92, 246, 0.1);
      border-radius: 16px;
      padding: 16px 50px 16px 20px;
      font-size: 16px;
      font-weight: 400;
      outline: none;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .search-input:focus {
      border-color: #8b5cf6;
      box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
    }

    .search-clear {
      position: absolute;
      right: 16px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: #64748b;
      cursor: pointer;
      padding: 4px;
      border-radius: 50%;
      transition: all 0.2s;
    }

    .search-clear:hover {
      background: rgba(139, 92, 246, 0.1);
      color: #8b5cf6;
    }

    .search-close {
      position: absolute;
      top: 20px;
      right: 20px;
      background: rgba(0, 0, 0, 0.05);
      border: none;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
      color: #64748b;
    }

    .search-close:hover {
      background: rgba(0, 0, 0, 0.1);
      color: #1f2937;
    }

    .search-results {
      max-height: 400px;
      overflow-y: auto;
      padding: 0 24px 24px;
    }

    .search-result-item {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px;
      border-radius: 16px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      margin-bottom: 8px;
    }

    .search-result-item:hover {
      background: rgba(139, 92, 246, 0.05);
      transform: translateX(4px);
    }

    .search-result-icon {
      width: 40px;
      height: 40px;
      background: linear-gradient(135deg, #8b5cf6, #a855f7);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 16px;
      flex-shrink: 0;
    }

    .search-result-text {
      flex: 1;
    }

    .search-result-name {
      font-weight: 500;
      color: #1f2937;
      margin-bottom: 2px;
    }

    .search-result-region {
      font-size: 13px;
      color: #64748b;
    }

    /* Location Button */
    .location-btn {
      position: absolute;
      bottom: 120px;
      right: 20px;
      z-index: 1000;
      background: linear-gradient(135deg, #8b5cf6, #a855f7);
      border: none;
      width: 56px;
      height: 56px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 20px;
      box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .location-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 40px rgba(139, 92, 246, 0.4);
    }

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

    /* Zoom Controls */
    .zoom-controls {
      position: absolute;
      bottom: 200px;
      right: 20px;
      z-index: 1000;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .zoom-btn {
      background: rgba(255, 255, 255, 0.95);
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.2);
      width: 48px;
      height: 48px;
      border-radius: 50%;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #64748b;
      font-size: 18px;
      font-weight: 600;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .zoom-btn:hover {
      background: rgba(255, 255, 255, 1);
      color: #8b5cf6;
      transform: translateY(-2px);
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    }

    /* Copyright */
    #copyright {
      position: absolute;
      bottom: 20px;
      left: 20px;
      z-index: 1000;
      background: rgba(255, 255, 255, 0.9);
      backdrop-filter: blur(10px);
      padding: 8px 16px;
      border-radius: 12px;
      font-size: 12px;
      color: #64748b;
      border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .custom-tooltip {
      background: rgba(0, 0, 0, 0.9) !important;
      border: 2px solid white !important;
      border-radius: 8px !important;
      color: white !important;
      font-weight: 600 !important;
      font-size: 12px !important;
      padding: 6px 10px !important;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    }


    /* Loading Animation */
    .loading {
      display: inline-block;
      width: 20px;
      height: 20px;
      border: 2px solid rgba(139, 92, 246, 0.2);
      border-radius: 50%;
      border-top-color: #8b5cf6;
      animation: spin 0.8s linear infinite;
    }

    .leaflet-container {
      background-color: #a8d8ea !important;
    }

    .leaflet-tile-container {
      width: 100% !important;
      height: 100% !important;
    }

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

    /* Custom Tooltip */
    .leaflet-tooltip {
      background: rgba(0, 0, 0, 0.8) !important;
      border: none !important;
      border-radius: 12px !important;
      padding: 8px 12px !important;
      color: white !important;
      font-size: 13px !important;
      font-weight: 500 !important;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
      backdrop-filter: blur(10px);
    }

    .leaflet-tooltip::before {
      border-top-color: rgba(0, 0, 0, 0.8) !important;
    }

    /* Hide default leaflet controls */
    .leaflet-control-zoom {
      display: none !important;
    }

    /* Mobile Optimizations */
    @media (max-width: 768px) {
      .controls-container {
        top: 16px;
        left: 16px;
        right: 16px;
      }

      .top-bar {
        flex-direction: column;
        align-items: stretch;
      }

      .mode-selector {
        order: -1;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
      }

      .mode-selector::-webkit-scrollbar {
        display: none;
      }

      .mode-btn {
        white-space: nowrap;
        flex-shrink: 0;
      }

      .search-modal {
        padding: 20px 16px;
        align-items: center;
      }

      .search-modal-content {
        max-height: 80vh;
        border-radius: 20px;
      }

      .location-btn {
        bottom: 100px;
        right: 16px;
        width: 52px;
        height: 52px;
      }

      .zoom-controls {
        bottom: 180px;
        right: 16px;
      }

      .zoom-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
      }

      #copyright {
        bottom: 16px;
        left: 16px;
        font-size: 11px;
      }

      .fullscreen-mode .controls-container {
        top: 10px;
        left: 10px;
        right: 10px;
      }
      
      .fullscreen-mode .location-btn {
        bottom: 80px;
        right: 10px;
      }
      
      .fullscreen-mode .zoom-controls {
        bottom: 160px;
        right: 10px;
      }
    }

    /* Smooth animations for map interactions */
    .map-transition {
      transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }