/**
 * Windy-Style Live METAR & TAF Flight Intelligence Map Styling
 * live_map.css
 *
 * Implements full-screen dark cockpit glassmorphism, animated radar marker pulses,
 * Windy.com aerodrome slide-out right drawer (Rwys, METAR, TAF, History),
 * hover preview cards, runway crosswind/headwind chips, and comparison modal matrix.
 */

/* ==========================================================================
   1. CSS Custom Properties & Design Tokens
   ========================================================================== */
:root {
  /* Flight Category Standard Colors (ICAO / FAA) */
  --cat-vfr: #10b981;        /* Green: Vis >= 5000m / CIG >= 3000ft */
  --cat-vfr-bg: rgba(16, 185, 129, 0.15);
  --cat-vfr-border: rgba(16, 185, 129, 0.4);
  --cat-vfr-glow: rgba(16, 185, 129, 0.5);

  --cat-mvfr: #38bdf8;       /* Blue: Vis 5000-8000m or CIG 1000-3000ft */
  --cat-mvfr-bg: rgba(56, 189, 248, 0.15);
  --cat-mvfr-border: rgba(56, 189, 248, 0.4);
  --cat-mvfr-glow: rgba(56, 189, 248, 0.5);

  --cat-ifr: #ef4444;        /* Red: Vis 1000-5000m or CIG 500-1000ft */
  --cat-ifr-bg: rgba(239, 68, 68, 0.15);
  --cat-ifr-border: rgba(239, 68, 68, 0.4);
  --cat-ifr-glow: rgba(239, 68, 68, 0.6);

  --cat-lifr: #a855f7;       /* Purple: Vis < 1000m or CIG < 500ft */
  --cat-lifr-bg: rgba(168, 85, 247, 0.18);
  --cat-lifr-border: rgba(168, 85, 247, 0.45);
  --cat-lifr-glow: rgba(168, 85, 247, 0.65);

  --cat-unk: #94a3b8;        /* Gray: Unknown / Missing */
  --cat-unk-bg: rgba(148, 163, 184, 0.15);
  --cat-unk-border: rgba(148, 163, 184, 0.3);

  /* Cockpit & Surface Backgrounds */
  --bg-deep-space: #070b14;
  --bg-map-dark: #0b0f19;
  --bg-cockpit-slate: #0f172a;
  --bg-drawer-grad-start: #0f172a;
  --bg-drawer-grad-end: #1e293b;
  --bg-glass-card: rgba(15, 23, 42, 0.88);
  --bg-glass-card-hover: rgba(30, 41, 59, 0.92);
  --bg-glass-input: rgba(30, 41, 59, 0.65);
  --bg-pill-default: rgba(255, 255, 255, 0.08);
  --bg-pill-active: rgba(255, 255, 255, 0.2);

  /* Borders & Highlights */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.14);
  --border-glass-bright: rgba(255, 255, 255, 0.28);
  --accent-cyan: #38bdf8;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  /* Typography Colors */
  --text-pure: #ffffff;
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Elevation & Shadows */
  --shadow-drawer: -12px 0 36px rgba(0, 0, 0, 0.65);
  --shadow-floating: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow-cyan: 0 0 20px rgba(56, 189, 248, 0.35);

  /* Layering Stack */
  --z-map: 1;
  --z-overlay: 15;
  --z-legend: 25;
  --z-floating-bar: 35;
  --z-header: 45;
  --z-drawer-backdrop: 49;
  --z-drawer: 55;
  --z-modal-backdrop: 90;
  --z-modal: 100;
  --z-toast: 110;

  /* Sizing & Transitions */
  --header-height: 52px;
  --drawer-width: 440px;
  --ease-windy: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   2. Reset & Full-Viewport Map Container
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-deep-space);
  color: var(--text-main);
  font-family: "Outfit", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#liveMapContainer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-deep-space);
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-map);
  background: #090d16;
}

/* Custom Cockpit Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   3. Leaflet Overrides & Custom Cockpit Theme
   ========================================================================== */
.leaflet-container {
  background-color: #0b0f19 !important;
  font-family: inherit !important;
}

/* Subtle dark enhancement for standard map tiles */
.leaflet-tile-pane {
  filter: brightness(0.92) contrast(1.05);
}

/* Zoom Controls Glass Styling */
.leaflet-top.leaflet-left {
  top: calc(var(--header-height) + 16px);
  left: 16px;
}

.leaflet-bar {
  border: 1px solid var(--border-glass) !important;
  box-shadow: var(--shadow-floating) !important;
  border-radius: 10px !important;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.leaflet-bar a {
  background-color: transparent !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  color: var(--text-secondary) !important;
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 16px !important;
  transition: all 0.2s ease;
}

.leaflet-bar a:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--text-pure) !important;
}

.leaflet-control-attribution {
  background: rgba(15, 23, 42, 0.7) !important;
  color: var(--text-dim) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 6px 0 0 0;
  font-size: 10px !important;
  padding: 2px 8px !important;
}

.leaflet-control-attribution a {
  color: var(--text-muted) !important;
  text-decoration: none;
}
.leaflet-control-attribution a:hover {
  color: var(--accent-cyan) !important;
}

/* ==========================================================================
   4. Fixed Header Navigation Bar (#liveMapHeader)
   ========================================================================== */
#liveMapHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: var(--z-header);
  gap: 12px;
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-left {
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-pure);
}

.header-brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.header-brand-title {
  display: flex;
  flex-direction: column;
}

.brand-main {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Pulsing LIVE Radar Badge */
.badge-live-radar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 9999px;
}

.live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #ef4444;
  position: relative;
}

.live-pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background-color: #ef4444;
  opacity: 0.7;
  animation: pulseRadarRing 1.8s infinite ease-out;
}

@keyframes pulseRadarRing {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Header Airport Quick Search & Autocomplete */
.header-search-container {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.header-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-glass-input);
  border: 1px solid var(--border-glass);
  border-radius: 9999px;
  padding: 4px 12px;
  transition: all 0.25s ease;
}

.header-search-box:focus-within {
  border-color: var(--accent-cyan);
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.search-icon {
  font-size: 13px;
  color: var(--text-muted);
  margin-right: 8px;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-pure);
  font-size: 13px;
  font-family: inherit;
  padding: 4px 0;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-shortcut-badge {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
  font-family: monospace;
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  padding: 2px;
  display: none;
  transition: color 0.2s;
}
.search-clear-btn:hover {
  color: var(--text-pure);
}

/* Autocomplete Dropdown List */
.header-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass-bright);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  max-height: 380px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  padding: 6px;
}

.header-autocomplete-dropdown.open {
  display: block;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  color: var(--text-main);
  text-decoration: none;
}

.search-result-item:hover, .search-result-item.highlighted {
  background: rgba(255, 255, 255, 0.09);
}

.search-result-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-icao-code {
  font-family: monospace;
  font-weight: 700;
  font-size: 13px;
  color: #38bdf8;
  letter-spacing: 0.05em;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.search-airport-meta {
  display: flex;
  flex-direction: column;
}

.search-airport-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-pure);
  line-height: 1.2;
}

.search-airport-location {
  font-size: 11px;
  color: var(--text-muted);
}

/* Category Filter Bar in Header */
.category-filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}

.category-filter-chip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.category-filter-chip:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.06);
}

.category-filter-chip.active {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.16);
  font-weight: 700;
}

.filter-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.filter-chip-dot.all { background-color: #94a3b8; }
.filter-chip-dot.vfr { background-color: var(--cat-vfr); }
.filter-chip-dot.mvfr { background-color: var(--cat-mvfr); }
.filter-chip-dot.ifr { background-color: var(--cat-ifr); }
.filter-chip-dot.lifr { background-color: var(--cat-lifr); }

/* Header Action Buttons */
.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-pure);
  border-color: rgba(255, 255, 255, 0.25);
}

.header-btn.btn-accent {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(99, 102, 241, 0.25));
  border-color: rgba(56, 189, 248, 0.4);
  color: #bae6fd;
}
.header-btn.btn-accent:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.4), rgba(99, 102, 241, 0.4));
  color: #ffffff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

.btn-refresh i.spin {
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   5. Airport Map Markers & Pulsing Flight Category Pins
   ========================================================================== */
.metar-marker-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  pointer-events: auto;
}

.metar-marker-pin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border: 2px solid var(--cat-vfr);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  position: relative;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  z-index: 2;
}

.metar-marker-core {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--cat-vfr);
  transition: transform 0.2s ease;
}

/* Marker Flight Rule Colors */
.metar-marker-container.vfr .metar-marker-pin {
  border-color: var(--cat-vfr);
  box-shadow: 0 0 8px var(--cat-vfr-glow);
}
.metar-marker-container.vfr .metar-marker-core {
  background-color: var(--cat-vfr);
}

.metar-marker-container.mvfr .metar-marker-pin {
  border-color: var(--cat-mvfr);
  box-shadow: 0 0 8px var(--cat-mvfr-glow);
}
.metar-marker-container.mvfr .metar-marker-core {
  background-color: var(--cat-mvfr);
}

.metar-marker-container.ifr .metar-marker-pin {
  border-color: var(--cat-ifr);
  box-shadow: 0 0 10px var(--cat-ifr-glow);
}
.metar-marker-container.ifr .metar-marker-core {
  background-color: var(--cat-ifr);
}

.metar-marker-container.lifr .metar-marker-pin {
  border-color: var(--cat-lifr);
  box-shadow: 0 0 12px var(--cat-lifr-glow);
}
.metar-marker-container.lifr .metar-marker-core {
  background-color: var(--cat-lifr);
}

.metar-marker-container.unk .metar-marker-pin {
  border-color: var(--cat-unk);
}
.metar-marker-container.unk .metar-marker-core {
  background-color: var(--cat-unk);
}

/* Sonar / Radar Wave Pulse Animation for IFR & LIFR */
.metar-marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  margin-left: -11px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.metar-marker-container.ifr .metar-marker-pulse {
  background: rgba(239, 68, 68, 0.4);
  animation: sonarWave 2s infinite ease-out;
}

.metar-marker-container.lifr .metar-marker-pulse {
  background: rgba(168, 85, 247, 0.45);
  animation: sonarWave 1.6s infinite ease-out;
}

@keyframes sonarWave {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* Marker Label (ICAO / Wind) */
.metar-marker-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 3px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  font-family: monospace;
  color: var(--text-pure);
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Selected Marker State */
.metar-marker-container.selected .metar-marker-pin {
  transform: scale(1.3);
  border-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4), 0 0 20px rgba(56, 189, 248, 0.8);
  z-index: 10;
}

.metar-marker-container:hover .metar-marker-pin {
  transform: scale(1.22);
  z-index: 5;
}

/* ==========================================================================
   6. Hover Quick Tooltip Card (.metar-hover-tooltip)
   ========================================================================== */
.leaflet-tooltip-pane .metar-hover-tooltip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.metar-hover-card {
  width: 270px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass-bright);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  color: var(--text-main);
  animation: tooltipPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

@keyframes tooltipPop {
  0% { opacity: 0; transform: scale(0.92) translateY(6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.hover-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.hover-header-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hover-icao-badge {
  font-family: monospace;
  font-size: 14px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.05em;
}

.hover-iata-badge {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.hover-city-name {
  font-size: 11px;
  color: var(--text-secondary);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Category Pill Component */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.category-pill.vfr {
  background: var(--cat-vfr-bg);
  border: 1px solid var(--cat-vfr-border);
  color: var(--cat-vfr);
}

.category-pill.mvfr {
  background: var(--cat-mvfr-bg);
  border: 1px solid var(--cat-mvfr-border);
  color: var(--cat-mvfr);
}

.category-pill.ifr {
  background: var(--cat-ifr-bg);
  border: 1px solid var(--cat-ifr-border);
  color: var(--cat-ifr);
}

.category-pill.lifr {
  background: var(--cat-lifr-bg);
  border: 1px solid var(--cat-lifr-border);
  color: var(--cat-lifr);
}

.category-pill.unk {
  background: var(--cat-unk-bg);
  border: 1px solid var(--cat-unk-border);
  color: var(--cat-unk);
}

/* Hover Quick Weather Row */
.hover-weather-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 0 8px 0;
}

.hover-weather-item {
  display: flex;
  flex-direction: column;
}

.hover-weather-label {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.hover-weather-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-pure);
  display: flex;
  align-items: center;
  gap: 4px;
}

.wind-arrow-inline {
  display: inline-block;
  font-size: 10px;
  color: #38bdf8;
  transform-origin: center;
}

.hover-card-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 6px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
}

.hover-click-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #94a3b8;
  font-style: italic;
}

/* ==========================================================================
   7. Windy-Style Slide-Out Right Drawer (#airportDrawer)
   ========================================================================== */
#airportDrawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--drawer-width);
  max-width: 100vw;
  background: linear-gradient(180deg, var(--bg-drawer-grad-start) 0%, var(--bg-drawer-grad-end) 100%);
  border-left: 1px solid var(--border-glass);
  box-shadow: var(--shadow-drawer);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transform: translateX(100%);
  transition: transform 0.32s var(--ease-windy);
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#airportDrawer.open {
  transform: translateX(0);
}

/* Drawer backdrop: Map remains 100% clear & unblurred per user request */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: var(--z-drawer-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: none;
}

@media (max-width: 768px) {
  .drawer-backdrop.active {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* Drawer Header */
.drawer-header {
  padding: 18px 20px 14px 20px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
}

.drawer-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.drawer-airport-identity {
  display: flex;
  flex-direction: column;
}

.drawer-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-icao-code {
  font-family: monospace;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-pure);
  letter-spacing: 0.04em;
  line-height: 1;
}

.drawer-iata-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 13px;
  padding: 2px 7px;
  border-radius: 6px;
}

.drawer-airport-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.3;
}

.drawer-airport-city {
  font-size: 12px;
  color: var(--text-muted);
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.drawer-action-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text-pure);
}

/* Windy-Style Red Circular Close Button */
.drawer-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 14px;
}

.drawer-close-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
  transform: rotate(90deg);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

/* Drawer Coordinates & Elevation Meta Row */
.drawer-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.drawer-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.drawer-meta-item i {
  color: var(--accent-cyan);
  font-size: 11px;
}

/* Drawer Tab Bar (Windy Pills: Rwys, info | METAR | TAF | History) */
.drawer-tabs-nav {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: rgba(10, 15, 28, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.drawer-tabs-nav::-webkit-scrollbar {
  display: none;
}

.drawer-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-tab:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.08);
}

.drawer-tab.active {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
  font-weight: 700;
}

/* Drawer Body & Tab Panes */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: tabFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-pane.active {
  display: flex;
}

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

/* ==========================================================================
   8. Tab 1: Runways & Aerodrome Info (Rwys, info)
   ========================================================================== */
.runways-wind-overview {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wind-overview-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wind-dial-mini {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px dashed rgba(56, 189, 248, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
}

.wind-dial-arrow {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transition: transform 0.5s ease;
}

.wind-dial-arrow i {
  color: var(--accent-cyan);
  font-size: 14px;
  margin-top: 2px;
  filter: drop-shadow(0 0 4px var(--accent-cyan));
}

.wind-overview-text {
  display: flex;
  flex-direction: column;
}

.wind-speed-main {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-pure);
  line-height: 1.1;
}

.wind-dir-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Runway Cards Grid */
.runway-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.runway-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.runway-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.runway-card:hover {
  border-color: var(--border-glass-bright);
}

.runway-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.runway-designators {
  display: flex;
  align-items: center;
  gap: 8px;
}

.runway-pill-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-pure);
  font-family: monospace;
  font-size: 15px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.runway-arrow-sep {
  color: var(--text-dim);
  font-size: 11px;
}

.runway-surface-info {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

/* Headwind / Crosswind Components Grid */
.runway-components-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wind-component-chip {
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
}

/* Headwind: Green down arrow */
.wind-component-chip.headwind {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
}

/* Tailwind: Red up arrow */
.wind-component-chip.tailwind {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

/* Crosswind: Cyan or Amber */
.wind-component-chip.crosswind {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.wind-component-chip.crosswind.warning {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.45);
  color: #f59e0b;
}

.wind-component-chip.crosswind.danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
}

.component-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.component-value {
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Aerodrome Elevation & Coordinates Box */
.aerodrome-info-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12px;
}

.info-item-label {
  color: var(--text-dim);
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.info-item-value {
  color: var(--text-pure);
  font-weight: 600;
}

/* ==========================================================================
   9. Tab 2: METAR Observation & Decoded Speech View
   ========================================================================== */
.metar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metar-age-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 6px;
}

.metar-age-tag i {
  font-size: 10px;
}

/* Decoded Natural Language Card (matches Windy.com screenshot) */
.metar-decoded-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.decoded-sentence-lead {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-pure);
  font-weight: 500;
}

.decoded-trend-highlight {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 13px;
  color: #38bdf8;
  font-weight: 500;
}

/* Raw METAR Mode Switch */
.metar-raw-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Custom Switch Toggle */
.switch-container {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--border-subtle);
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 9999px;
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-pure);
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

.switch-container input:checked + .switch-slider {
  background-color: #0ea5e9;
  border-color: #38bdf8;
}

.switch-container input:checked + .switch-slider::before {
  transform: translateX(18px);
}

/* Raw METAR Mono Container */
.metar-raw-block {
  background: rgba(10, 15, 28, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  color: #a5f3fc;
  position: relative;
  word-break: break-all;
  display: none;
}

.metar-raw-block.show {
  display: block;
}

.btn-copy-raw {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy-raw:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-pure);
}

/* Observation Parameter Chips Grid */
.metar-parameters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.param-tile {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.param-tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.param-tile-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-pure);
}

.param-tile-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Past 24h Observation History Accordion */
.metar-history-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.history-item-header {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background-color 0.2s;
}

.history-item-header:hover {
  background: rgba(30, 41, 59, 0.8);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.history-item-age {
  color: var(--text-muted);
}

.history-item-body {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border-left: 2px solid var(--border-glass-bright);
  margin-left: 10px;
  display: none;
}

.history-item.open .history-item-body {
  display: block;
}

/* ==========================================================================
   10. Tab 3: TAF Forecast & Breakdown
   ========================================================================== */
.taf-validity-banner {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.3), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.taf-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.taf-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.taf-badge.short-taf {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.taf-badge.long-taf {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.taf-validity-range {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-pure);
}

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

/* TAF Forecast Timeline Cards */
.taf-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 18px;
}

.taf-timeline-container::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 5px;
  width: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.taf-group-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.taf-group-card::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #38bdf8;
  border: 2px solid var(--bg-cockpit-slate);
}

.taf-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.taf-group-type-badge {
  font-family: monospace;
  font-weight: 800;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-pure);
}

.taf-group-type-badge.tempo {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.taf-group-type-badge.becmg {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.taf-group-type-badge.prob {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
}

.taf-group-time-range {
  font-size: 11px;
  color: var(--text-muted);
}

.taf-group-forecast-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   11. Tab 4: 24-Hour Trend & History
   ========================================================================== */
.history-trend-overview {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trend-bar-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.trend-color-strip {
  height: 14px;
  width: 100%;
  border-radius: 7px;
  display: flex;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.trend-segment {
  height: 100%;
  flex: 1;
  position: relative;
  transition: opacity 0.2s;
  cursor: pointer;
}

.trend-segment:hover {
  opacity: 0.85;
}

.trend-segment.vfr { background-color: var(--cat-vfr); }
.trend-segment.mvfr { background-color: var(--cat-mvfr); }
.trend-segment.ifr { background-color: var(--cat-ifr); }
.trend-segment.lifr { background-color: var(--cat-lifr); }
.trend-segment.unk { background-color: var(--cat-unk); }

/* History Timeline Table */
.history-records-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-record-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

/* ==========================================================================
   12. Floating Comparison Bar (#multiStationCompareBar)
   ========================================================================== */
#multiStationCompareBar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass-bright);
  border-radius: 9999px;
  padding: 8px 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: var(--z-floating-bar);
  transition: transform 0.35s var(--ease-windy), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

#multiStationCompareBar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.compare-chips-list {
  display: flex;
  align-items: center;
  gap: 6px;
}

.compare-station-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 3px 8px;
  border-radius: 9999px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-pure);
}

.compare-chip-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 10px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.compare-chip-remove:hover {
  color: #ef4444;
}

.btn-open-compare {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
  white-space: nowrap;
}

.btn-open-compare:hover {
  background: linear-gradient(135deg, #0ea5e9, #3b82f6);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
  transform: translateY(-1px);
}

.btn-clear-compare {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px;
}
.btn-clear-compare:hover {
  color: var(--text-pure);
}

/* ==========================================================================
   13. Multi-Station Comparison Modal (#comparisonModal)
   ========================================================================== */
#comparisonModal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#comparisonModal.open {
  display: flex;
}

.modal-backdrop-blur {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.comparison-dialog {
  position: relative;
  width: 94vw;
  max-width: 1240px;
  max-height: 88vh;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid var(--border-glass-bright);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2;
  animation: modalScaleUp 0.25s var(--ease-windy);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.comparison-modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.8);
}

.modal-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-pure);
}

.modal-station-count {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.comparison-modal-body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
}

/* Comparison Matrix Responsive Table */
.comparison-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.comparison-matrix-table th, 
.comparison-matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

/* Sticky first parameter column */
.comparison-matrix-table th:first-child,
.comparison-matrix-table td:first-child {
  position: sticky;
  left: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  z-index: 5;
  font-weight: 700;
  color: var(--text-secondary);
  width: 180px;
  min-width: 160px;
  border-right: 1px solid var(--border-glass);
}

.comparison-matrix-table thead th {
  background: rgba(15, 23, 42, 0.9);
  position: sticky;
  top: 0;
  z-index: 6;
  border-bottom: 2px solid var(--border-glass-bright);
}

.comparison-station-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.matrix-icao {
  font-family: monospace;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-pure);
}

.matrix-city {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Highlight cells in comparison */
.cell-highlight-worst {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #f87171 !important;
  font-weight: 700;
}

.cell-highlight-best {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
  font-weight: 700;
}

/* ==========================================================================
   14. Floating Flight Rules Legend (#flightRulesLegend)
   ========================================================================== */
#flightRulesLegend {
  position: fixed;
  bottom: 24px;
  left: 20px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow-floating);
  z-index: var(--z-legend);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legend-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-color-dot.vfr { background-color: var(--cat-vfr); box-shadow: 0 0 6px var(--cat-vfr-glow); }
.legend-color-dot.mvfr { background-color: var(--cat-mvfr); box-shadow: 0 0 6px var(--cat-mvfr-glow); }
.legend-color-dot.ifr { background-color: var(--cat-ifr); box-shadow: 0 0 6px var(--cat-ifr-glow); }
.legend-color-dot.lifr { background-color: var(--cat-lifr); box-shadow: 0 0 6px var(--cat-lifr-glow); }

.legend-cat-name {
  font-weight: 700;
  color: var(--text-pure);
  width: 38px;
}

.legend-criteria {
  color: var(--text-dim);
  font-size: 10px;
}

/* ==========================================================================
   15. Floating Map Layer Switcher (#mapLayersDropdown)
   ========================================================================== */
.map-floating-controls {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  right: 20px;
  z-index: var(--z-legend);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floating-btn-round,
.floating-basemap-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass-bright);
  box-shadow: var(--shadow-floating);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 15px;
}

.floating-btn-round:hover,
.floating-basemap-btn:hover {
  background: rgba(30, 41, 59, 0.98);
  color: #ffffff;
  border-color: #38bdf8;
  transform: scale(1.05);
}

.basemap-floating-panel {
  position: absolute;
  top: 46px;
  right: 0;
  width: 260px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  color: #1e293b;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 14px 35px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.12);
  z-index: 1200;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  animation: bmpFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.basemap-floating-panel.open {
  display: flex;
}

@keyframes bmpFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.bmp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.bmp-header-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #64748b;
  text-transform: uppercase;
}

.bmp-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  transition: all 0.15s;
}

.bmp-close-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

/* Segmented 3-Tab Navigation Bar */
.bmp-tabs-nav {
  display: flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 6px;
  margin: 8px 10px 4px;
  border: 1px solid #e2e8f0;
  gap: 4px;
  flex-shrink: 0;
}

.bmp-tab-btn {
  flex: 1;
  padding: 6px 6px;
  font-size: 10px;
  font-weight: 700;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.bmp-tab-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.5);
}

.bmp-tab-btn.active {
  background: #ffffff;
  color: #0284c7;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bmp-tab-pane {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 480px;
}

.bmp-tab-pane::-webkit-scrollbar {
  width: 4px;
}

.bmp-tab-pane::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.bmp-body {
  display: flex;
  flex-direction: column;
}

/* Solid/Clear Special Section */
.bmp-item-solid {
  background: #333846;
  color: #ffffff;
  padding: 8px 10px;
}

.bmp-solid-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.bmp-solid-top-row .bmp-title {
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.bmp-mapbg-btn {
  background: #0284c7;
  border: none;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(2,132,199,0.35);
  transition: all 0.15s;
}

.bmp-mapbg-btn:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.bmp-circle-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 2px rgba(0,0,0,0.5);
}

.bmp-presets-container {
  background: #f8fafc;
  margin: 8px -10px -8px -10px;
  padding: 7px 10px 8px;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.bmp-light-label {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 5px;
  display: block;
}

.bmp-swatches-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.bmp-swatch {
  height: 20px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  transition: all 0.15s ease;
  padding: 0;
}

.bmp-swatch:hover {
  transform: scale(1.12);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  border-color: #0284c7;
}

/* Standard Base Map Item */
.bmp-item {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.15s;
  user-select: none;
}

.bmp-item:last-child {
  border-bottom: none;
}

.bmp-item:hover {
  background: #f8fafc;
}

.bmp-item.active {
  background: #f0f9ff;
  border-left: 3px solid #0284c7;
}

.bmp-radio-lbl {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  width: 100%;
  margin: 0;
}

.bmp-radio-lbl input[type="radio"] {
  cursor: pointer;
  accent-color: #0284c7;
  margin: 0;
  width: 14px;
  height: 14px;
}

.bmp-item-icon {
  font-size: 13px;
  color: #64748b;
  width: 18px;
  text-align: center;
}

.bmp-item.active .bmp-item-icon {
  color: #0284c7;
}

.bmp-title {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
}

.bmp-item.active .bmp-title {
  color: #0369a1;
  font-weight: 700;
}

/* TAB 2: Boundary Customizer Section */
.bmp-boundary-tab-content {
  padding: 10px 12px 12px;
  background: #ffffff;
}

/* Outer Map Dimming Control */
.bmp-spotlight-control {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 12px 10px;
}

.bmp-spotlight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bmp-spotlight-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.bmp-spotlight-val {
  font-size: 10.5px;
  font-weight: 800;
  color: #0284c7;
  background: #e0f2fe;
  padding: 1px 6px;
  border-radius: 4px;
}

.bmp-slider-row {
  display: flex;
  align-items: center;
}

.bmp-opacity-slider {
  width: 100%;
  height: 5px;
  border-radius: 4px;
  background: #cbd5e1;
  outline: none;
  cursor: pointer;
  accent-color: #0284c7;
}

.bmp-opacity-slider:hover {
  background: #94a3b8;
}

/* Outer Glow Effect Control */
.bmp-glow-control {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 12px 10px;
}

.bmp-custom-group {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
}

.bmp-custom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 7px;
}

.bmp-color-preview-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  font-family: monospace;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.bmp-color-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.bmp-choose-color-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  padding: 3px 7px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.bmp-choose-color-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 1px 4px rgba(2, 132, 199, 0.3);
}

.bmp-mini-swatches {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

.bmp-mini-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  padding: 0;
  flex-shrink: 0;
}

.bmp-mini-swatch:hover {
  transform: scale(1.18);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.bmp-subslider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
}

.bmp-subslider-label {
  flex: 0 0 54px;
}

.bmp-mini-slider {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #cbd5e1;
  outline: none;
  cursor: pointer;
  accent-color: #0284c7;
}

.bmp-subslider-val {
  flex: 0 0 35px;
  text-align: right;
  font-size: 10.5px;
  font-weight: 800;
  color: #0284c7;
}

.bmp-reset-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.bmp-reset-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

/* TAB 3: Advanced Meteorological Overlays & Controls */
.bmp-overlays-container {
  padding: 8px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
}

.bmp-overlay-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bmp-overlay-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.bmp-overlay-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bmp-overlay-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
}

.bmp-overlay-title i {
  font-size: 12px;
  width: 14px;
  text-align: center;
}

.bmp-overlay-desc {
  font-size: 9.5px;
  color: #64748b;
  line-height: 1.35;
}

/* iOS style compact toggle switch */
.bmp-toggle-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.bmp-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.bmp-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 18px;
}

.bmp-toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.bmp-toggle-switch input:checked + .bmp-toggle-slider {
  background-color: #0284c7;
}

.bmp-toggle-switch input:checked + .bmp-toggle-slider:before {
  transform: translateX(14px);
}

/* Graticule interval pill selector */
.bmp-grat-steps-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.bmp-grat-pills {
  display: flex;
  gap: 4px;
}

.bmp-grat-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bmp-grat-pill:hover {
  border-color: #0284c7;
  color: #0284c7;
}

.bmp-grat-pill.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

/* Map Overlays Elements */
.bmp-graticule-label {
  color: #475569;
  font-size: 9px;
  font-weight: 700;
  text-shadow: 0 0 3px #ffffff, 0 0 3px #ffffff;
  white-space: nowrap;
  pointer-events: none;
}

.bmp-radar-ring-tag {
  color: #0284c7;
  font-size: 9px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #bae6fd;
  border-radius: 4px;
  padding: 1px 4px;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

/* Backward compatibility fallback */
.layers-dropdown-panel {
  display: none;
}

/* ==========================================================================
   16. Notifications Toast (#liveMapToast)
   ========================================================================== */
#liveMapToast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-glass-bright);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-pure);
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: var(--z-toast);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

#liveMapToast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   17. Responsive Layout & Mobile Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .header-search-container {
    width: 240px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 48px;
    --drawer-width: 100vw;
  }

  #liveMapHeader {
    padding: 0 10px;
    gap: 8px;
  }

  .header-brand-title .brand-sub {
    display: none;
  }

  .header-search-container {
    width: 180px;
  }

  .category-filter-group {
    display: none; /* Collapsed into quick drawer or bottom bar on mobile */
  }

  #airportDrawer {
    width: 100vw;
    border-left: none;
  }

  #multiStationCompareBar {
    width: 90vw;
    justify-content: space-between;
    padding: 8px 12px;
  }

  #flightRulesLegend {
    display: none; /* Hide floating legend on narrow mobile to keep map clean */
  }

  .comparison-dialog {
    width: 98vw;
    max-height: 94vh;
  }
}

@media (max-width: 480px) {
  .header-search-container {
    width: 140px;
  }
  .search-shortcut-badge {
    display: none;
  }
}
