:root {
      --bg-body: #eef2f7;
      --text-primary: #333;
      --text-secondary: #555;
      --text-muted: #888;
      --bg-card: #ffffff;
      --bg-card-hover: #f8f9fa;
      --bg-table-header: #f2f4f7;
      --border-color: #e9ecef;
      --border-light: #ced4da;
      --shadow-sm: rgba(0, 0, 0, 0.05);
      --shadow-md: rgba(0, 0, 0, 0.1);
      --bg-input: #ffffff;
      --bg-suggestions: #ffffff;
      --bg-suggestion-hover: #e9ecef;
      --bg-button: #e0e0e0;
      --bg-button-hover: #d0d0d0;
      --text-heading: #2c3e50;
      --btn-icon-fill: rgba(0, 0, 0, 0.7);
      --slider-track: #b0c4de;
      --lightning-btn-bg: #fff;
      --lightning-btn-hover: #f0f0f0;
      --marker-outline: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
      --chart-grid: rgba(0, 0, 0, 0.06);
      --loading-bg: rgba(255, 255, 255, 0.92);
      --loading-text: #555;
    }

    [data-theme="dark"] {
      --bg-body: #0f172a;
      --text-primary: #e2e8f0;
      --text-secondary: #94a3b8;
      --text-muted: #64748b;
      --bg-card: #1e293b;
      --bg-card-hover: #334155;
      --bg-table-header: #1e293b;
      --border-color: rgba(255, 255, 255, 0.08);
      --border-light: rgba(255, 255, 255, 0.12);
      --shadow-sm: rgba(0, 0, 0, 0.2);
      --shadow-md: rgba(0, 0, 0, 0.3);
      --bg-input: #1e293b;
      --bg-suggestions: #1e293b;
      --bg-suggestion-hover: #334155;
      --bg-button: #334155;
      --bg-button-hover: #475569;
      --text-heading: #f1f5f9;
      --btn-icon-fill: rgba(255, 255, 255, 0.7);
      --slider-track: #475569;
      --lightning-btn-bg: #1e293b;
      --lightning-btn-hover: #334155;
      --marker-outline: -1px -1px 0 rgba(0, 0, 0, 0.6), 1px -1px 0 rgba(0, 0, 0, 0.6), -1px 1px 0 rgba(0, 0, 0, 0.6), 1px 1px 0 rgba(0, 0, 0, 0.6);
      --chart-grid: rgba(255, 255, 255, 0.08);
      --loading-bg: rgba(15, 23, 42, 0.92);
      --loading-text: #94a3b8;
    }

    /* Dark mode map base adjustments using CSS filter */
    [data-theme="dark"] #map-container .maplibregl-canvas {
      filter: invert(0.9) hue-rotate(180deg) brightness(0.95) contrast(1.05);
    }

    /* Dark mode popup adjustments */
    [data-theme="dark"] .maplibregl-popup-content {
      background-color: var(--bg-card);
      color: var(--text-primary);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
      border: 1px solid var(--border-color);
    }

    [data-theme="dark"] .maplibregl-popup-tip {
      border-top-color: var(--bg-card);
      border-bottom-color: var(--bg-card);
      border-left-color: var(--bg-card);
      border-right-color: var(--bg-card);
    }

    body,
    html {
      width: 100%;
      margin: 0;
      padding: 0;
      font-family: "Montserrat", sans-serif;
      background-color: var(--bg-body);
      color: var(--text-primary);
      font-size: 16px;
      box-sizing: border-box;
      min-width: 280px;
      transition: background-color 0.3s, color 0.3s;
    }

    #app-container {
      /* MODIFIED: Removed fixed-header padding and added general spacing */
      padding: 5px;
    }

    #header-container {
      position: fixed;
      top: 60px;
      /* Adjusted to prevent overlapping by sticky navbar */
      left: 0;
      right: 0;
      z-index: 10;
      max-width: 980px;
      margin: 0 auto;
    }

    #weather-display {
      background: var(--bg-card);
      padding: 5px 10px 100px 10px;
      border-radius: 10px;
      box-shadow: 0 1px 3px var(--shadow-sm);
      position: relative;
      min-height: 160px;
      overflow: hidden;
      transition: background-color 0.3s;
    }

    #search-container {
      margin-top: 3px;
    }

    @media (max-width: 768px) {
      #header-container {
        display: flex;
        flex-direction: column;
        height: 30vh;
        min-height: 30vh;
        max-height: 30vh;
      }
      #weather-display {
        flex: 1;
        overflow-y: auto;
        min-height: 0 !important;
        padding-bottom: 15px !important;
      }
      #search-container {
        flex-shrink: 0;
      }
    }

    #forecast-table-container {
      margin: 5px auto 0;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      box-shadow: 0 2px 8px var(--shadow-sm);
      max-width: 980px;
      transition: background-color 0.3s, border-color 0.3s;
    }

    #forecast-table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 2px;
      text-align: left;
      font-size: 0.9em;
    }

    #map-container {
      height: 33vh;
      max-width: 980px;
      margin: 210px auto 5px;
      /* Initial margin-top approximates empty header; JS adjusts dynamically */
      border-radius: 10px;
      overflow: hidden;
      box-shadow: 0 2px 8px var(--shadow-sm);
      transition: margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
      /* Hidden until map + weather are ready */
      opacity: 0;
    }

    #map-container.map-ready {
      opacity: 1;
    }

    #map-container.map-viewport-fullscreen {
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      width: 100vw !important;
      height: 100vh !important;
      max-width: none !important;
      margin: 0 !important;
      border-radius: 0 !important;
      z-index: 99999 !important;
      opacity: 1 !important;
    }

    #map-container.map-viewport-fullscreen .maplibregl-ctrl-top-right {
      top: 16px !important;
      right: 16px !important;
      transform: none !important;
    }

    #map-container .maplibregl-canvas {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 100%;
      height: 100%;
    }

    .maplibregl-ctrl-bottom-center {
      position: absolute;
      bottom: 10%;
      left: 0;
      right: 0;
      z-index: 1;
      display: flex;
      justify-content: center;
    }

    .animation-controls-container {
      display: flex;
      align-items: center;
      background-color: rgba(255, 255, 255, 0.3);
      border-radius: 40px;
      padding: 8px;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
      -webkit-backdrop-filter: blur(5px);
      backdrop-filter: blur(5px);
      border: 1px solid rgba(255, 255, 255, 0.7);
      width: 100%;
      max-width: 550px;
      transition: visibility 0s, opacity 0.3s ease-in-out;
      font-family: "Montserrat", sans-serif;
    }

    .mode-toggle {
      display: flex;
      flex-direction: column;
      gap: 2px;
      margin-left: 8px;
      margin-right: 8px;
      flex-shrink: 0;
    }

    .mode-toggle button {
      border: none;
      background: var(--bg-button);
      padding: 6px 10px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      color: var(--text-secondary);
      transition: background-color 0.2s, color 0.2s;
      font-family: "Montserrat", sans-serif;
    }

    .mode-toggle button:first-child {
      border-radius: 12px 12px 0 0;
    }

    .mode-toggle button:last-child {
      border-radius: 0 0 12px 12px;
    }

    .mode-toggle button.active {
      background: #007bff;
      color: white;
    }

    #play-pause-button {
      width: 40px;
      height: 40px;
      border: 0;
      border-radius: 50%;
      cursor: pointer;
      background-color: var(--bg-button);
      background-repeat: no-repeat;
      background-position: center;
      background-size: 20px 20px;
      flex-shrink: 0;
      transition: background-color 0.2s;
    }

    #play-pause-button:hover {
      background-color: var(--bg-button-hover);
    }

    #play-pause-button.paused {
      background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style="fill:rgba(0, 0, 0, 0.7);"><path d="M7 6v12l10-6z"></path></svg>');
      background-position: 55% 50%;
    }

    #play-pause-button.playing {
      background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" style="fill:rgba(0, 0, 0, 0.7);"><path d="M8 7h3v10H8zm5 0h3v10h-3z"></path></svg>');
    }

    .timeline-wrapper {
      position: relative;
      flex-grow: 1;
      margin: 0 15px;
      height: 50px;
    }

    #time-display-container {
      position: absolute;
      top: 0;
      transform: translateX(-50%);
      font-size: 14px;
      font-weight: bold;
      color: var(--text-primary);
      white-space: nowrap;
    }

    #timeline-slider {
      -webkit-appearance: none;
      appearance: none;
      width: 100%;
      height: 4px;
      background: var(--slider-track);
      outline: none;
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      margin: 0;
      cursor: pointer;
    }

    #timeline-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 18px;
      height: 18px;
      background: #007bff;
      border-radius: 50%;
      border: 2px solid white;
      cursor: pointer;
    }

    #timeline-slider::-moz-range-thumb {
      width: 14px;
      height: 14px;
      background: #007bff;
      border-radius: 50%;
      border: 2px solid white;
      cursor: pointer;
    }

    .timeline-labels {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: var(--text-secondary);
      position: absolute;
      bottom: 0;
      width: 100%;
    }

    #now-marker-container {
      position: absolute;
      bottom: 0;
      transform: translateX(-50%);
      font-size: 12px;
      font-weight: bold;
      color: var(--text-primary);
    }

    .maplibregl-ctrl-top-right {
      top: 50%;
      transform: translateY(-50%);
    }

    .maplibregl-ctrl-attrib {
      display: none !important;
    }

    #weather-display h2 {
      font-size: 1.8em;
      color: var(--text-heading);
      margin-top: 0;
      margin-bottom: 10px;
    }

    /* #weather-display ul {
            list-style: none;
            padding: 0;
            margin: 15px 0;
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 10px 20px;
        } */

    #weather-display li {
      font-size: 1.05em;
      color: var(--text-primary);
    }

    #weather-display p {
      font-size: 0.9em;
      color: var(--text-primary);
      margin: 5px 0;
    }

    #chart-container {
      padding: 5px;
      /* background-color: #f8f9fa; */
    }

    #location-button-container {
      text-align: center;
      margin-bottom: 10px;
      font-family: "Montserrat", sans-serif;
    }

    #get-location-weather {
      padding: 12px 25px;
      font-size: 1em;
      cursor: pointer;
      background-color: #007bff;
      color: white;
      border: none;
      border-radius: 6px;
      transition: background-color 0.2s ease, transform 0.1s ease;
      box-shadow: 0 2px 5px rgba(0, 123, 255, 0.2);
      font-family: "Montserrat", sans-serif;
    }

    #get-location-weather:hover {
      background-color: #0056b3;
      transform: translateY(-1px);
    }

    #get-location-weather:active {
      transform: translateY(0);
      box-shadow: 0 1px 3px rgba(0, 123, 255, 0.3);
    }

    #search-container {
      margin-top: 3px;
    }

    .search-input-wrapper {
      position: relative;
      display: flex;
      align-items: center;
    }

    .search-icon {
      position: absolute;
      left: 10px;
      color: var(--text-muted);
      z-index: 1;
    }

    .location-icon {
      position: absolute;
      right: 15px;
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 2;
      transition: color 0.2s ease, transform 0.1s ease;
    }

    .location-icon:hover {
      color: #007bff;
      transform: scale(1.15);
    }

    .location-icon:active {
      transform: scale(0.95);
    }

    .location-icon.active {
      color: #007bff;
    }

    .arrow-icon {
      position: absolute;
      right: 45px;
      color: var(--text-muted);
      z-index: 1;
      pointer-events: none;
    }

    #search-input:not(:placeholder-shown)+.arrow-icon,
    #search-input:focus+.arrow-icon {
      display: none;
    }

    #search-input {
      width: 100%;
      padding: 10px 60px 10px 40px;
      font-size: 0.8em;
      box-sizing: border-box;
      border: 1px solid var(--border-light);
      border-radius: 6px;
      transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.3s;
      font-family: "Montserrat", sans-serif;
      background-color: var(--bg-input);
      color: var(--text-primary);
    }

    #search-input::placeholder {
      font-family: "Montserrat", sans-serif;
      padding-left: 0px;
      color: var(--text-muted);
    }

    #search-input:focus {
      border-color: #80bdff;
      outline: none;
      box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    }

    #suggestions-list {
      border: 1px solid var(--border-color);
      border-top: none;
      max-height: 200px;
      overflow-y: auto;
      position: absolute;
      width: 100%;
      background-color: var(--bg-suggestions);
      z-index: 1000;
      list-style: none;
      padding: 0;
      margin: 0;
      border-radius: 0 0 6px 6px;
      box-shadow: 0 4px 10px var(--shadow-sm);
    }

    #suggestions-list li {
      padding: 5px 10px;
      cursor: pointer;
      font-size: 0.8em;
      border-bottom: 1px solid var(--border-color);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      color: var(--text-primary);
    }

    #suggestions-list li:last-child {
      border-bottom: none;
    }

    #suggestions-list li:hover,
    #suggestions-list li.selected {
      background-color: var(--bg-suggestion-hover);
    }

    .dot {
      height: 16px;
      width: 16px;
      border-radius: 50%;
      display: inline-block;
      margin-left: 8px;
      animation: pulse 1s infinite alternate;
      vertical-align: middle;
    }

    .dot-green {
      background-color: #28a745;
    }

    .dot-red {
      background-color: #dc3545;
    }

    .dot-blue {
      background-color: #007bff;
    }

    .radar-pulse-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      display: inline-block;
      position: relative;
      vertical-align: middle;
    }

    .radar-pulse-dot.ok {
      background: radial-gradient(circle, #34d399 0%, #10b981 100%);
      box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
    }
    
    .radar-pulse-dot.ok::after {
      content: '';
      position: absolute;
      top: -3px;
      left: -3px;
      right: -3px;
      bottom: -3px;
      border-radius: 50%;
      border: 1.5px solid #10b981;
      opacity: 0;
      animation: radar-glow-green 1.5s infinite ease-out;
    }

    .radar-pulse-dot.down {
      background: radial-gradient(circle, #f87171 0%, #ef4444 100%);
      box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
    }
    
    .radar-pulse-dot.down::after {
      content: '';
      position: absolute;
      top: -3px;
      left: -3px;
      right: -3px;
      bottom: -3px;
      border-radius: 50%;
      border: 1.5px solid #ef4444;
      opacity: 0;
      animation: radar-glow-red 1.5s infinite ease-out;
    }

    @keyframes radar-glow-green {
      0% {
        transform: scale(0.6);
        opacity: 0.8;
      }
      100% {
        transform: scale(1.6);
        opacity: 0;
      }
    }

    @keyframes radar-glow-red {
      0% {
        transform: scale(0.6);
        opacity: 0.8;
      }
      100% {
        transform: scale(1.6);
        opacity: 0;
      }
    }

    @keyframes pulse {
      0% {
        transform: scale(0.9);
        opacity: 0.7;
      }

      100% {
        transform: scale(1.1);
        opacity: 1;
      }
    }

    #forecast-table th,
    #forecast-table td {
      padding: 5px 5px;
      text-align: center;
      border-bottom: 1px solid var(--border-color);
    }

    #forecast-table th {
      background-color: var(--bg-table-header);
      color: var(--text-secondary);
      font-weight: 600;
      text-align: center;
      position: -webkit-sticky;
      position: sticky;
      z-index: 1;
    }

    #forecast-table .day-header td {
      position: -webkit-sticky;
      position: sticky;
      z-index: 1;
      background-color: var(--bg-table-header);
      line-height: 32px;
    }

    #forecast-table tbody tr:last-child td {
      border-bottom: none;
    }

    #forecast-table tbody tr:hover {
      background-color: var(--bg-card-hover);
    }

    #forecast-table img {
      vertical-align: middle;
    }

    .wind-arrow {
      display: inline-block;
      width: 30px;
      height: 30px;
      margin-left: 10px;
      vertical-align: middle;
    }

    .current-weather-summary {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      width: 100%;
      margin-bottom: 10px;
      padding-top: 10px;
      padding-bottom: 10px;
    }

    .current-weather-summary>div {
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .temperature-display {
      font-size: 2.5em;
      font-weight: bold;
    }

    @media (max-width: 480px) {
      #weather-display h2 {
        font-size: 1.8em;
      }

      #weather-display li {
        font-size: 1em;
      }

      #forecast-table {
        font-size: 0.85em;
      }
    }

    @keyframes spin {
      100% {
        transform: rotate(360deg);
      }
    }

    @keyframes pulse-glow {
      0% {
        transform: scale(0.85);
        opacity: 0.5;
      }

      100% {
        transform: scale(1.15);
        opacity: 0.9;
      }
    }

    .lightning-marker {
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      cursor: pointer;
    }

    .lightning-marker.pulsing {
      animation: lightning-strike 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    .lightning-marker.pulsing .lightning-svg {
      animation: lightning-pulse 1.2s infinite ease-in-out;
    }

    @keyframes lightning-strike {
      0% {
        transform: scale(0) translateY(-15px);
        opacity: 0;
      }
      50% {
        transform: scale(1.4) translateY(0);
        opacity: 1;
      }
      100% {
        transform: scale(1) translateY(0);
        opacity: 1;
      }
    }

    @keyframes lightning-pulse {
      0%, 100% {
        transform: scale(1);
      }
      50% {
        transform: scale(1.25);
      }
    }

    .pulsing::after {
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      background-color: rgba(251, 191, 36, 0.4);
      border-radius: 50%;
      z-index: -1;
      animation: pulse-wave 2s infinite ease-out;
    }

    @keyframes pulse-wave {
      0% {
        transform: scale(1);
        opacity: 0.8;
      }
      100% {
        transform: scale(4);
        opacity: 0;
      }
    }

    #toggle-lightning-button {
      width: 29px;
      height: 29px;
      border: 0;
      border-radius: 4px;
      cursor: pointer;
      background-color: var(--lightning-btn-bg);
      background-repeat: no-repeat;
      background-position: center;
      background-size: 20px 20px;
      box-shadow: 0 0 0 2px var(--shadow-md);
      transition: background-color 0.2s;
    }

    #toggle-lightning-button:hover {
      background-color: var(--lightning-btn-hover);
    }

    #toggle-lightning-button.active {
      animation: pulse-orange 2s infinite;
    }

    #toggle-lightning-button.active svg {
      fill: #fff;
    }

    @keyframes pulse-orange {
      0% {
        background-color: #ff8c00;
      }

      50% {
        background-color: #ffa500;
      }

      100% {
        background-color: #ff8c00;
      }
    }

    /* A more performant animation using transform and opacity */
    @keyframes pulse-wave {
      0% {
        transform: scale(1);
        opacity: 0.7;
      }

      100% {
        /* Adjust scale to get your desired ~50px size */
        transform: scale(20);
        opacity: 0;
      }
    }

    @media (max-width: 600px) {
      .animation-controls-container {
        margin: 0 5px;
      }
    }

    /* ── Premium Navbar ── */
    .main-navbar {
      background: rgba(15, 23, 42, 0.85);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      position: sticky;
      top: 0;
      z-index: 9999;
      padding: 10px 16px;
      font-family: 'Montserrat', sans-serif;
    }

    .nav-container {
      max-width: 980px;
      margin: 0 auto;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .nav-brand {
      color: white;
      text-decoration: none;
      font-size: 1.4rem;
      font-weight: 700;
      letter-spacing: -0.03em;
      display: flex;
      align-items: center;
      gap: 6px;
      transition: transform 0.2s;
    }

    .nav-brand:hover {
      transform: scale(1.02);
    }

    .brand-accent {
      background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .brand-weather-icon {
      font-size: 1.15rem;
      filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.5));
    }

    .nav-actions {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    /* ── Hamburger & Dropdown Menu ── */
    .menu-container {
      position: relative;
    }

    .hamburger-btn {
      background: transparent;
      border: none;
      color: white;
      cursor: pointer;
      padding: 8px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.2s, transform 0.1s;
    }

    .hamburger-btn:hover {
      background: rgba(255, 255, 255, 0.08);
    }

    .hamburger-btn:active {
      transform: scale(0.95);
    }

    .nav-alerts-btn {
      background: transparent;
      border: none;
      color: white;
      cursor: pointer;
      padding: 8px 12px;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: background-color 0.2s, transform 0.1s;
      font-family: 'Montserrat', sans-serif;
      font-size: 0.82rem;
      font-weight: 600;
      text-decoration: none;
    }

    .nav-alerts-btn:hover {
      background: rgba(255, 255, 255, 0.08);
    }

    .nav-alerts-btn:active {
      transform: scale(0.95);
    }

    .nav-alerts-btn svg {
      flex-shrink: 0;
    }

    @media (max-width: 580px) {
      .nav-alerts-btn .btn-text {
        display: none;
      }
      .nav-alerts-btn {
        padding: 8px;
      }
    }

    .nav-dropdown {
      position: absolute;
      right: 0;
      top: calc(100% + 8px);
      background: rgba(15, 23, 42, 0.95);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 12px;
      min-width: 200px;
      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
      opacity: 0;
      visibility: hidden;
      transform: translateY(-10px);
      transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
      z-index: 10000;
      padding: 8px 0;
    }

    .nav-dropdown.show {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }

    .dropdown-header {
      padding: 8px 16px;
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: rgba(255, 255, 255, 0.4);
      font-weight: 700;
      border-bottom: 1px solid rgba(255, 255, 255, 0.06);
      margin-bottom: 6px;
    }

    .lang-switcher-vertical {
      display: flex;
      flex-direction: column;
      padding: 0 6px;
    }

    .lang-btn {
      background: transparent;
      border: none;
      color: rgba(255, 255, 255, 0.7);
      padding: 10px 12px;
      font-size: 0.88rem;
      font-weight: 600;
      cursor: pointer;
      text-align: left;
      font-family: 'Montserrat', sans-serif;
      border-radius: 8px;
      display: flex;
      align-items: center;
      gap: 10px;
      transition: all 0.2s;
    }

    .lang-btn:hover {
      background: rgba(255, 255, 255, 0.06);
      color: white;
    }

    .lang-btn.active {
      background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
      color: white;
    }

    .flag-icon {
      font-size: 1.1rem;
    }

    .dropdown-divider {
      height: 1px;
      background: rgba(255, 255, 255, 0.08);
      margin: 4px 6px;
    }

    .nav-links-section {
      display: flex;
      flex-direction: column;
      padding-bottom: 6px;
    }

    .nav-link-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      margin: 0 6px;
      border-radius: 8px;
      color: rgba(255, 255, 255, 0.7);
      text-decoration: none;
      font-size: 0.88rem;
      font-weight: 600;
      transition: all 0.2s;
      font-family: 'Montserrat', sans-serif;
    }

    .nav-link-item:hover {
      background: rgba(255, 255, 255, 0.06);
      color: white;
    }

    /* Theme toggle in dropdown */
    .theme-toggle-row {
      display: flex;
      gap: 4px;
      padding: 6px 6px;
    }

    .theme-btn {
      flex: 1;
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: rgba(255, 255, 255, 0.6);
      padding: 8px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 0.8rem;
      font-weight: 600;
      font-family: 'Montserrat', sans-serif;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
    }

    .theme-btn:hover {
      background: rgba(255, 255, 255, 0.06);
      color: white;
    }

    .theme-btn.active {
      background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
      color: white;
      border-color: transparent;
    }

    /* Time Format toggle in dropdown */
    .time-format-toggle-row {
      display: flex;
      gap: 4px;
      padding: 6px 6px;
    }

    .time-format-btn {
      flex: 1;
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: rgba(255, 255, 255, 0.6);
      padding: 8px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 0.8rem;
      font-weight: 600;
      font-family: 'Montserrat', sans-serif;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
    }

    .time-format-btn:hover {
      background: rgba(255, 255, 255, 0.06);
      color: white;
    }

    .time-format-btn.active {
      background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
      color: white;
      border-color: transparent;
    }

    /* --- Premium Alert Modal CSS --- */
    /* --- Premium Alert Modal CSS --- */
    .custom-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(15, 23, 42, 0.4);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 20000;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
    }
    .custom-modal-overlay.show {
      opacity: 1;
      pointer-events: auto;
    }
    .custom-modal-content {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: 16px;
      width: 90%;
      max-width: 420px;
      box-shadow: 0 20px 25px -5px var(--shadow-md), 0 10px 10px -5px var(--shadow-sm);
      overflow: hidden;
      transform: scale(0.9);
      transition: transform 0.3s ease;
      font-family: 'Montserrat', sans-serif;
      color: var(--text-primary);
    }
    .custom-modal-overlay.show .custom-modal-content {
      transform: scale(1);
    }
    .custom-modal-header {
      padding: 16px 20px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .custom-modal-header h3 {
      margin: 0;
      font-size: 1.2rem;
      font-weight: 700;
      color: var(--text-heading);
    }
    .custom-modal-close {
      background: transparent;
      border: none;
      font-size: 1.5rem;
      cursor: pointer;
      color: var(--text-secondary);
      transition: color 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .custom-modal-close:hover {
      color: var(--text-primary);
    }
    .custom-modal-body {
      padding: 20px;
    }
    .custom-modal-body p {
      margin: 0 0 16px 0;
      font-size: 0.9rem;
      line-height: 1.5;
      color: var(--text-secondary);
    }
    .form-group {
      margin-bottom: 16px;
    }
    .form-group label {
      display: block;
      font-size: 0.8rem;
      font-weight: 600;
      margin-bottom: 6px;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .custom-select {
      width: 100%;
      background: var(--bg-input);
      border: 1px solid var(--border-light);
      color: var(--text-primary);
      padding: 10px 12px;
      border-radius: 8px;
      font-family: inherit;
      font-size: 0.9rem;
      cursor: pointer;
      outline: none;
      transition: border-color 0.2s;
    }
    .custom-select:focus {
      border-color: #38bdf8;
    }
    .custom-modal-footer {
      padding: 16px 20px;
      border-top: 1px solid var(--border-color);
      display: flex;
      justify-content: flex-end;
      gap: 10px;
    }
    .modal-btn {
      padding: 10px 16px;
      border: none;
      border-radius: 8px;
      font-family: inherit;
      font-size: 0.88rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }
    .btn-primary {
      background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
      color: white;
    }
    .btn-primary:hover {
      filter: brightness(1.1);
    }
    .btn-danger {
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
      border: 1px solid rgba(239, 68, 68, 0.3);
    }
    .btn-danger:hover {
      background: rgba(239, 68, 68, 0.25);
    }
    .btn-secondary {
      background: var(--bg-button);
      color: var(--text-primary);
      border: 1px solid var(--border-light);
    }
    .btn-secondary:hover {
      background: var(--bg-button-hover);
    }
    #alert-bell-btn.active svg {
      fill: #ff9f1c;
      stroke: #ff9f1c;
      animation: bell-ring 0.5s ease-in-out;
    }
    @keyframes bell-ring {
      0%, 100% { transform: rotate(0); }
      20%, 60% { transform: rotate(15deg); }
      40%, 80% { transform: rotate(-15deg); }
    }
    .custom-input {
      width: 100%;
      background: var(--bg-input);
      border: 1px solid var(--border-light);
      color: var(--text-primary);
      padding: 10px 12px;
      border-radius: 8px;
      font-family: inherit;
      font-size: 0.9rem;
      outline: none;
      transition: border-color 0.2s;
      box-sizing: border-box;
    }
    .custom-input:focus {
      border-color: #38bdf8;
    }
    .my-alerts-section {
      padding: 5px 15px 10px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      max-height: 200px;
      overflow-y: auto;
    }
    .alert-list-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--bg-body);
      border: 1px solid var(--border-color);
      padding: 8px 10px;
      border-radius: 8px;
      font-size: 0.85rem;
      margin-bottom: 4px;
    }
    .alert-item-name {
      font-weight: 600;
      color: var(--text-primary);
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
      max-width: 140px;
    }
    .alert-item-details {
      font-size: 0.75rem;
      color: var(--text-secondary);
      margin-top: 2px;
    }
    .alert-item-actions {
      display: flex;
      gap: 5px;
      flex-shrink: 0;
    }
    .alert-action-btn {
      background: transparent;
      border: none;
      cursor: pointer;
      padding: 4px;
      color: var(--text-secondary);
      transition: color 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
    }
    .alert-action-btn:hover {
      color: var(--text-primary);
      background: var(--bg-button);
    }
    .alert-action-btn.btn-delete:hover {
      color: #ef4444;
      background: rgba(239, 68, 68, 0.1);
    }
    .no-alerts-msg {
      font-size: 0.8rem;
      color: var(--text-secondary);
      text-align: center;
      padding: 10px 0;
      font-style: italic;
    }
    .weekday-selector {
      display: flex;
      gap: 6px;
      justify-content: space-between;
      margin-top: 8px;
    }
    .weekday-btn {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 1px solid var(--border-light);
      background: var(--bg-button);
      color: var(--text-primary);
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
      font-family: inherit;
    }
    .weekday-btn:hover {
      background: var(--bg-button-hover);
      transform: translateY(-1px);
    }
    .weekday-btn.active {
      background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
      color: white;
      border-color: transparent;
    }
    .time-window-inputs {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .time-window-inputs span {
      color: var(--text-secondary);
      font-size: 0.9rem;
    }
    .time-window-inputs input[type="time"] {
      flex: 1;
      text-align: center;
    }