@import url('https://fonts.googleapis.com/css2?family=Onest:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================================
   MINIMAL DARK — CSS VARIABLES & THEMES
   ============================================================================ */
:root, :root[data-theme="dark"] {
  /* Surfaces */
  --md-bg:      #0a0a0a;
  --md-bg-elev: #111111;
  --md-bg-hi:   #161616;
  /* Lines */
  --md-line:   #1e1e1e;
  --md-line-2: #2a2a2a;
  /* Ink */
  --md-ink:    #f5f5f4;
  --md-ink-2:  #a8a29e;
  --md-ink-3:  #57534e;
  /* Accent (amber) */
  --md-acc:    #ffb000;
  --md-acc-2:  #ffdd82;
  /* Semantic */
  --md-ok:     #34d399;
  --md-warn:   #fbbf24;
  --md-crit:   #ef4444;
  --md-inf:    #60a5fa;
  /* Brand signage */
  --md-brand-y: #fdff2f;
  --md-brand-r: #dc2626;

  /* Legacy aliases (kept so untouched sections of style.css keep working) */
  --player-height: 100px;
  --primary-blue:   var(--md-inf);
  --success-green:  #10b981;
  --danger-red:     var(--md-crit);
  --warning-orange: var(--md-brand-y);
  --glass-bg:       var(--md-bg-elev);
  --glass-border:   var(--md-line);
}

:root[data-theme="light"] {
  --md-bg:      #fafaf9;
  --md-bg-elev: #ffffff;
  --md-bg-hi:   #f5f5f4;
  --md-line:    #e7e5e4;
  --md-line-2:  #d6d3d1;
  --md-ink:     #1c1917;
  --md-ink-2:   #57534e;
  --md-ink-3:   #a8a29e;
  --md-acc:     #b45309;
  --md-acc-2:   #d97706;
  --md-ok:      #059669;
  --md-warn:    #d97706;
  --md-crit:    #dc2626;
  --md-inf:     #2563eb;
  --glass-bg:     var(--md-bg-elev);
  --glass-border: var(--md-line);
}

/* ============================================================================
   LIGHT MODE — remap Tailwind text colors so hardcoded classes are readable
   (chrome / generic text only — colored data like phase badges stays itself)
   ============================================================================ */
:root[data-theme="light"] .text-white,
:root[data-theme="light"] .text-gray-100,
:root[data-theme="light"] .text-gray-200 { color: var(--md-ink) !important; }

:root[data-theme="light"] .text-gray-300,
:root[data-theme="light"] .text-gray-400 { color: var(--md-ink-2) !important; }

:root[data-theme="light"] .text-gray-500,
:root[data-theme="light"] .text-gray-600 { color: var(--md-ink-3) !important; }

/* Colored accents darkened one step for WCAG on white */
:root[data-theme="light"] .text-blue-300,
:root[data-theme="light"] .text-blue-400 { color: #1d4ed8 !important; }
:root[data-theme="light"] .text-yellow-300 { color: #a16207 !important; }
:root[data-theme="light"] .text-orange-300 { color: #c2410c !important; }
:root[data-theme="light"] .text-purple-300 { color: #6b21a8 !important; }
:root[data-theme="light"] .text-cyan-300 { color: #0e7490 !important; }
:root[data-theme="light"] .text-green-300,
:root[data-theme="light"] .text-green-400,
:root[data-theme="light"] .text-emerald-300,
:root[data-theme="light"] .text-emerald-400 { color: #047857 !important; }
:root[data-theme="light"] .text-red-300,
:root[data-theme="light"] .text-red-400 { color: #b91c1c !important; }
:root[data-theme="light"] .text-amber-300,
:root[data-theme="light"] .text-amber-400 { color: #b45309 !important; }

/* Border placeholders (border-white/10, border-white/20) — near-invisible on white */
:root[data-theme="light"] [class*="border-white"] { border-color: var(--md-line) !important; }
:root[data-theme="light"] [class*="bg-white/5"],
:root[data-theme="light"] [class*="bg-white/10"] { background-color: var(--md-bg-hi) !important; }

/* Focus/hover states in light mode */
:root[data-theme="light"] input, :root[data-theme="light"] select,
:root[data-theme="light"] textarea { background: #fff !important; }

* {
  font-family: 'Onest', system-ui, -apple-system, sans-serif;
}

.font-mono, code, pre, kbd, samp, tt {
  font-family: 'JetBrains Mono', ui-monospace, monospace !important;
  font-feature-settings: "ss01", "cv01";
}

html, body {
  background: var(--md-bg);
  color: var(--md-ink);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================================
   ANIMATED BACKGROUND  (subtle amber pulse, kept per user preference)
   ============================================================================ */
.bg-animated {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 176, 0, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(220, 38, 38, 0.02) 0%, transparent 50%);
  animation: bgShift 20s ease-in-out infinite;
  z-index: -1;
  will-change: transform;
  contain: strict;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .bg-animated { animation: none; }
}

@keyframes bgShift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-20px, -20px) scale(1.1); }
  66% { transform: translate(20px, -10px) scale(0.95); }
}

/* ============================================================================
   GLASS EFFECTS  (flat under Minimal Dark — kept class names for compat)
   ============================================================================ */
.glass-effect {
  backdrop-filter: none;
  background: var(--md-bg-elev);
  border: 1px solid var(--md-line);
  box-shadow: none;
  border-radius: 10px;
}

.glass-card {
  backdrop-filter: none;
  background: var(--md-bg-elev);
  border: 1px solid var(--md-line);
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.glass-card::before { content: none; }

/* ============================================================================
   TYPOGRAPHY AND GRADIENTS
   ============================================================================ */
.gradient-text {
  color: var(--md-acc);
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  background-clip: initial;
}

/* ============================================================================
   RUNWAY-SIGN LOGO  (compact, as in preview 01-minimal-dark)
   ============================================================================ */
.runway-sign {
  display: inline-flex;
  align-items: stretch;
  text-decoration: none;
  border-radius: 3px;
  overflow: hidden;
  transition: opacity 0.2s ease;
  border: 2px solid var(--md-brand-y);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 2px;
}

.runway-sign:hover { opacity: 0.9; }

.runway-icao {
  color: var(--md-brand-y);
  background: #0a0a0a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
}

.runway-city {
  color: #0a0a0a;
  background: var(--md-brand-y);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
}

.runway-domain {
  background: var(--md-brand-r);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* Tiny variant still available for radar controls bar */
.runway-sign-mini { border-width: 2px; }
.runway-sign-mini .runway-icao,
.runway-sign-mini .runway-city {
  font-size: 0.65rem;
  letter-spacing: 1px;
  padding: 3px 6px;
}
.runway-sign-mini .runway-domain {
  font-size: 0.55rem;
  letter-spacing: 1px;
  padding: 3px 5px;
}

@media (max-width: 640px) {
  .runway-sign { max-width: 100%; border-width: 2px; margin: 0 auto; }
  .runway-icao, .runway-city {
    font-size: 10px;
    letter-spacing: 1px;
    padding: 5px 7px;
  }
  .runway-city { white-space: normal; word-break: break-word; }
  .runway-domain {
    font-size: 10px;
    padding: 5px 7px;
    letter-spacing: 1px;
  }
}

/* ============================================================================
   HEADER — SEGMENTED NAV CONTROL (.hdr-nav)
   ============================================================================ */
.hdr-nav {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--md-bg-hi);
  border: 1px solid var(--md-line);
  border-radius: 6px;
  align-items: center;
}

.hdr-nav > button,
.hdr-nav > a {
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--md-ink-2);
  border-radius: 4px;
  transition: background .12s, color .12s;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
  font-family: 'Onest', sans-serif;
}

.hdr-nav > button:hover,
.hdr-nav > a:hover {
  color: var(--md-ink);
}

.hdr-nav > button.active,
.hdr-nav > a.active {
  background: var(--md-bg);
  color: var(--md-ink);
  box-shadow: 0 0 0 1px var(--md-line-2), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hdr-nav > button.accent,
.hdr-nav > a.accent {
  color: var(--md-acc);
}

/* Theme toggle button */
.theme-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--md-line);
  border-radius: 6px;
  background: var(--md-bg-hi);
  color: var(--md-ink-2);
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.theme-btn:hover { color: var(--md-ink); border-color: var(--md-line-2); }

/* ============================================================================
   LIVE RECORDING STYLES
   ============================================================================ */
.live-indicator {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
  }
  50% { 
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
    border-color: rgba(239, 68, 68, 0.8);
  }
}

.live-recording {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(30, 30, 30, 0.3) 50%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  position: relative;
  overflow: hidden;
}

.live-recording::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, transparent 100%);
  opacity: 1;
}

.live-recording::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.2), transparent);
  animation: liveShimmer 3s ease-in-out infinite;
}

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

.live-recording:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 30px 60px rgba(239, 68, 68, 0.4);
  border-color: rgba(239, 68, 68, 0.6);
}

.live-badge {
  animation: liveBadgePulse 1.5s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

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

/* ============================================================================
   AIRCRAFT DATA STYLES
   ============================================================================ */
.aircraft-summary {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
  border: 1px solid rgba(34, 197, 94, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aircraft-summary:hover {
  border-color: rgba(34, 197, 94, 0.4);
  transform: translateY(-2px);
}

.aircraft-summary table {
  border-collapse: separate;
  border-spacing: 0;
}

.aircraft-summary th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.75rem;
}

.aircraft-summary td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.aircraft-summary tr:hover td {
  background: rgba(59, 130, 246, 0.1);
}

/* ============================================================================
   AIRCRAFT HOVERABLE ELEMENTS - FIXED VERSION
   ============================================================================ */
.aircraft-hoverable {
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 2px 0;
  border: 1px solid transparent;
  /* Ensure clickability */
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
}

.aircraft-hoverable:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
  transform: translateX(6px) translateY(-2px);
  box-shadow: 0 6px 25px rgba(59, 130, 246, 0.25);
  border-left: 4px solid var(--primary-blue);
  border-color: rgba(59, 130, 246, 0.3);
  padding-left: 8px;
  z-index: 2;
}

.aircraft-hoverable:active {
  transform: translateX(3px) translateY(-1px);
  box-shadow: 0 3px 15px rgba(59, 130, 246, 0.4);
}

/* Enhanced click indicator */
.aircraft-hoverable::after {
  content: '🗺️ Click for flight map';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: #64748b;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  background: rgba(20, 20, 20, 0.8);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
}

.aircraft-hoverable:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(-5px);
}

.hover-indicator {
  display: inline-block;
  opacity: 0.6;
  transition: all 0.3s ease;
  margin-left: 8px;
  font-size: 0.9rem;
}

.aircraft-hoverable:hover .hover-indicator {
  opacity: 1;
  transform: scale(1.2);
  animation: planeHover 2s ease-in-out infinite;
}

@keyframes planeHover {
  0%, 100% { transform: scale(1.2) translateX(0); }
  50% { transform: scale(1.2) translateX(3px); }
}

/* Accessibility improvements */
.aircraft-hoverable:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.aircraft-hoverable[role="button"] {
  cursor: pointer;
}

.aircraft-hoverable[tabindex="0"]:focus {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
}

/* ============================================================================
   FLIGHT GROUP TABLE — tbody-per-group hover/click
   ============================================================================ */
.flight-group-table {
  border-spacing: 0;
}

tbody.flight-group {
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

tbody.flight-group tr td {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

tbody.flight-group:hover tr td {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08)) !important;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.15);
}

tbody.flight-group:hover tr:first-child td:first-child {
  border-left: 4px solid var(--primary-blue);
  border-top-left-radius: 8px;
}

tbody.flight-group:hover tr:last-child td:first-child {
  border-bottom-left-radius: 8px;
}

tbody.flight-group:hover tr:first-child td:last-child {
  border-top-right-radius: 8px;
}

tbody.flight-group:hover tr:last-child td:last-child {
  border-bottom-right-radius: 8px;
}

tbody.flight-group:active tr td {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.15)) !important;
  box-shadow: 0 3px 15px rgba(59, 130, 246, 0.4);
}

/* "Click for flight map" hint — on the group */
tbody.flight-group::after {
  content: '🗺️ Click for flight map';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: #64748b;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  background: rgba(20, 20, 20, 0.8);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
}

tbody.flight-group:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(-5px);
}

/* ============================================================================
   RECORDING CARDS AND PLAYLIST ITEMS
   ============================================================================ */
.recording-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.recording-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.recording-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  border-color: rgba(59, 130, 246, 0.3);
}

.recording-card:hover::before {
  opacity: 1;
}

.playlist-item {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.playlist-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.playlist-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  border-color: rgba(59, 130, 246, 0.3);
}

.playlist-item:hover::before {
  opacity: 1;
}

.playlist-item.playing {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(59, 130, 246, 0.15));
  border-left: 4px solid var(--primary-blue);
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
  transform: scale(1.02);
}

.play-icon {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.playlist-item:hover .play-icon {
  color: #60a5fa;
  transform: scale(1.2) rotate(15deg);
}

.playlist-item.playing .play-icon {
  color: var(--primary-blue);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.play-button {
  background: linear-gradient(135deg, #3b82f6, var(--primary-blue));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  position: relative;
  overflow: hidden;
}

.play-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.play-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.6);
}

.play-button:hover::before {
  opacity: 1;
}

.live-play-button {
  background: linear-gradient(135deg, var(--danger-red), #dc2626);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.live-play-button:hover {
  background: linear-gradient(135deg, #f87171, var(--danger-red));
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.6);
  transform: translateY(-2px) scale(1.05);
}

.live-button {
  background: linear-gradient(135deg, var(--danger-red), #dc2626);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.live-button:hover {
  background: linear-gradient(135deg, #f87171, var(--danger-red));
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.6);
}

.view-toggle-btn {
  background-color: rgba(40, 40, 40, 0.5);
  color: #cbd5e1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 500;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  white-space: nowrap;
}

.view-toggle-btn:hover {
  background-color: rgba(59, 130, 246, 0.3);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.view-toggle-btn.active {
  background: linear-gradient(135deg, #3b82f6, var(--primary-blue));
  color: white;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.5);
}

/* New compact view toggle buttons with descriptions */
.view-toggle-btn-new {
  background-color: rgba(40, 40, 40, 0.5);
  color: #cbd5e1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 80px;
}

.view-toggle-btn-new:hover {
  background-color: rgba(59, 130, 246, 0.3);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.view-toggle-btn-new.active {
  background: linear-gradient(135deg, #3b82f6, var(--primary-blue));
  color: white;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.5);
}

.view-toggle-btn-new.active .text-gray-400 {
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================================================
   FLIGHT PATH MODAL - ENHANCED VERSION
   ============================================================================ */
#flight-path-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#flight-path-modal.visible {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* Modal content - ensure proper display */
#flight-path-modal .modal-content,
.modal-content {
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(30, 30, 30, 0.95));
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: 90vw;
  max-width: 1000px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  transform: scale(0.9) translateY(50px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#flight-path-modal.visible .modal-content {
  transform: scale(1) translateY(0);
}

/* Modal header - compatible with maps.js structure */
.modal-header,
.tooltip-header {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.08));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title,
.aircraft-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title::before,
.aircraft-title::before {
  content: '✈️';
  font-size: 1.6rem;
  animation: gentleBob 3s ease-in-out infinite;
}

@keyframes gentleBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(5deg); }
}

/* Modal close buttons - compatible with multiple modal implementations */
.modal-close,
.tooltip-close,
#modal-close-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger-red);
  font-size: 18px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover,
.tooltip-close:hover,
#modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.1);
}

/* Modal body - compatible with maps.js */
.modal-body,
.tooltip-content {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 200px);
}

/* Map containers - ensure proper sizing and display */
.map-container,
#map-container,
#modal-map-container {
  height: 500px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(59, 130, 246, 0.3);
  position: relative;
  background: rgba(20, 20, 20, 0.5);
  /* Ensure Leaflet compatibility */
  z-index: 1;
}

/* ============================================================================
   MODAL STATES
   ============================================================================ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 60px 20px;
  color: #94a3b8;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 60px 20px;
  color: var(--danger-red);
  text-align: center;
}

.error-icon {
  font-size: 4rem;
}

.retry-button {
  background: linear-gradient(135deg, #3b82f6, var(--primary-blue));
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.retry-button:hover {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ============================================================================
   FLIGHT STATISTICS
   ============================================================================ */
.flight-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(30, 30, 30, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================================
   MAP STYLING - ENHANCED LEAFLET COMPATIBILITY
   ============================================================================ */
.map-container {
  height: 500px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(59, 130, 246, 0.3);
  position: relative;
  background: rgba(20, 20, 20, 0.5);
}

.leaflet-container {
  background: rgba(20, 20, 20, 0.8);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  /* Ensure proper rendering */
  width: 100% !important;
  height: 100% !important;
}

.leaflet-control-container .leaflet-control {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(15px) saturate(150%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.leaflet-control-zoom a {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: none;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  line-height: 30px;
}

.leaflet-control-zoom a:hover {
  background: rgba(59, 130, 246, 0.3);
  color: white;
  transform: scale(1.1);
}

.leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

/* ============================================================================
   CALENDAR STYLING
   ============================================================================ */
.flatpickr-calendar {
  background: rgba(20, 20, 20, 0.95) !important;
  backdrop-filter: blur(30px) saturate(200%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month,
.flatpickr-current-month .cur-month,
.flatpickr-current-month input.cur-year,
.flatpickr-weekday {
  color: #e2e8f0 !important;
  fill: #e2e8f0 !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: #94a3b8 !important;
  fill: #94a3b8 !important;
}
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  color: #60a5fa !important;
  fill: #60a5fa !important;
}

.flatpickr-day {
  color: #94a3b8 !important;
  border-radius: 8px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.flatpickr-day:hover {
  background: rgba(59, 130, 246, 0.2) !important;
  transform: scale(1.1) !important;
}

.flatpickr-day.has-recordings {
  background: linear-gradient(135deg, #3b82f6, var(--primary-blue)) !important;
  color: #fff !important;
  font-weight: 600 !important;
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4) !important;
  position: relative;
}


/* ============================================================================
   WAVEFORM STYLES
   ============================================================================ */
.waveform-container {
  background: linear-gradient(90deg, rgba(20, 20, 20, 0.8) 0%, rgba(30, 30, 30, 0.8) 50%, rgba(20, 20, 20, 0.8) 100%);
  border-radius: 12px;
  padding: 12px;
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.waveform-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  animation: waveGlow 3s ease-in-out infinite;
}

@keyframes waveGlow {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}

/* ============================================================================
   MASTER PLAYER
   ============================================================================ */
#master-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-height);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

#master-player.visible {
  transform: translateY(0);
}

/* ============================================================================
   HOUR FILTER BUTTONS - CLEAN VERSION
   ============================================================================ */
.hour-filter-btn,
.hourly-filter-btn {
  background-color: rgba(40, 40, 40, 0.5);
  color: #cbd5e1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.hour-filter-btn:hover,
.hourly-filter-btn:hover {
  background-color: rgba(59, 130, 246, 0.3);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.hour-filter-btn.active,
.hourly-filter-btn.active {
  background: linear-gradient(135deg, #3b82f6, var(--primary-blue));
  color: white;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.5);
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
.pulse-dot {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.animate-fade-in {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

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

/* ============================================================================
   UTILITIES
   ============================================================================ */
.glow-green {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5), 0 0 40px rgba(16, 185, 129, 0.3);
}

.glow-blue {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 0 0 40px rgba(59, 130, 246, 0.3);
}

/* ============================================================================
   RESPONSIVE DESIGN FIXES
   ============================================================================ */
/* Hide elements based on view mode */
.daily-mode .hourly-only,
.daily-mode .transmission-only,
.daily-mode .timeline-only { display: none !important; }

.hourly-mode .daily-only,
.hourly-mode .transmission-only,
.hourly-mode .timeline-only { display: none !important; }

.transmission-mode .daily-only,
.transmission-mode .hourly-only,
.transmission-mode .timeline-only { display: none !important; }

.timeline-mode .daily-only,
.timeline-mode .hourly-only,
.timeline-mode .transmission-only { display: none !important; }

@media (max-width: 768px) {
  .modal-content {
    width: 95vw;
    max-height: 95vh;
  }
  
  .map-container,
  #modal-map-container {
    height: 350px;
  }
  
  .aircraft-hoverable::after {
    display: none;
  }
  
  .aircraft-hoverable {
    /* Better touch targets on mobile */
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .view-toggle-btn {
    padding: 7px 12px;
    font-size: 0.8rem;
  }
  
  .flight-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .map-container,
  #modal-map-container {
    height: 300px;
  }
  
  .aircraft-summary .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .live-badge {
    font-size: 0.6rem;
    padding: 4px 8px;
  }
  
  .flight-stats {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   ACCESSIBILITY AND PERFORMANCE
   ============================================================================ */
.aircraft-hoverable:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

@media (prefers-contrast: high) {
  .aircraft-hoverable:hover {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #ffffff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aircraft-hoverable,
  .modal-content,
  .play-button {
    transition: none;
    animation: none;
  }
  
  .loading-spinner {
    animation: none;
    border: 4px solid var(--primary-blue);
  }
}

/* ============================================================================
   CUSTOM SCROLLBAR
   ============================================================================ */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(20, 20, 20, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #3b82f6, var(--primary-blue));
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #60a5fa, #93c5fd);
}

/* ============================================================================
   AIRCRAFT FLIGHT PATH TOOLTIP (Legacy compatibility)
   ============================================================================ */
.aircraft-flight-tooltip {
  position: fixed;
  z-index: 10000;
  width: 520px;
  max-height: 650px;
  background: rgba(20, 20, 20, 0.98);
  backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: tooltipFadeIn 0.4s ease-out;
  font-family: 'Inter', sans-serif;
}

.aircraft-flight-tooltip.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95) translateY(10px);
}

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

/* Quick info tooltip */
#aircraft-quick-tooltip {
  position: fixed;
  z-index: 9999;
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  color: white;
  font-size: 0.9rem;
  max-width: 300px;
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
  pointer-events: none;
}

#aircraft-quick-tooltip.hidden {
  opacity: 0;
  transform: translateY(10px) scale(0.9);
}

/* === Aviation Weather Styles (moved from inline) === */
.aw-primary-btn {
    padding: 8px 14px;
    border-radius: 9999px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(59,130,246,0.25); /* blue-500/25 */
    color: #e5e7eb;
    font-weight: 600;
    transition: all .2s ease;
  }
  .aw-primary-btn:hover { background: rgba(59,130,246,0.35); }
  .aw-primary-btn.active {
    background: rgba(34,197,94,0.35); /* green-ish active */
    border-color: rgba(34,197,94,0.45);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(34,197,94,0.25) inset, 0 8px 20px rgba(34,197,94,0.15);
  }
  .aw-chip {
    padding: 6px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    color: #e5e7eb;
    font-weight: 600;
    font-size: 12px;
    transition: all .2s ease;
  }
  .aw-chip:hover { background: rgba(255,255,255,0.16); }
  .aw-chip.active {
    background: rgba(34,197,94,0.35);
    border-color: rgba(34,197,94,0.45);
    color: #fff;
  }

/* Overlay styling for sector highlight */
  .aw-ov-sector { fill: rgba(34,197,94,0.0); stroke: rgba(255,255,255,0.12); stroke-width: 0.6; }
  .aw-ov-sector.active { fill: rgba(34,197,94,0.25); stroke: rgba(34,197,94,0.6); }
  .aw-ov-label { fill: rgba(255,255,255,0.75); font-weight: 700; font-size: 10px; }
  /* Make sectors clickable on the overlay */
  #aw-map-overlay { pointer-events: none; }
  #aw-map-overlay .aw-ov-sector { pointer-events: auto; cursor: pointer; }

/* === Aviation Weather (IMGW) styles === */
.aw-primary-btn {
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(59,130,246,0.25);
  color: #e5e7eb;
  font-weight: 600;
  transition: all .2s ease;
}
.aw-primary-btn:hover { background: rgba(59,130,246,0.35); }
.aw-primary-btn.active {
  background: rgba(34,197,94,0.35);
  border-color: rgba(34,197,94,0.45);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(34,197,94,0.25) inset, 0 8px 20px rgba(34,197,94,0.15);
}

.aw-chip {
  padding: 6px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: #e5e7eb;
  font-weight: 600;
  font-size: 12px;
  transition: all .2s ease;
}
.aw-chip:hover { background: rgba(255,255,255,0.16); }
.aw-chip.active {
  background: rgba(34,197,94,0.35);
  border-color: rgba(34,197,94,0.45);
  color: #fff;
}

/* Overlay styling for sector highlight */
.aw-ov-sector { fill: rgba(34,197,94,0.0); stroke: rgba(255,255,255,0.12); stroke-width: 0.6; }
.aw-ov-sector.active { fill: rgba(34,197,94,0.25); stroke: rgba(34,197,94,0.6); }
.aw-ov-label { fill: rgba(255,255,255,0.75); font-weight: 700; font-size: 10px; }
/* Make sectors clickable on the overlay */
#aw-map-overlay { pointer-events: none; }
#aw-map-overlay .aw-ov-sector { pointer-events: auto; cursor: pointer; }

/* Weather Button Styling */
.weather-button {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.weather-button:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.6);
}

.weather-button:active {
  transform: translateY(-1px) scale(1.02);
}
/* Radar Button Styling */
.radar-button {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.radar-button:hover {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.6);
}

.radar-button:active {
  transform: translateY(-1px) scale(1.02);
}

/* Aircraft icon styles */
.aircraft-icon {
  background: transparent !important;
  border: none !important;
}

/* Radar layout */
.radar-body {
  display: flex;
  flex-direction: row;
}
.radar-map-wrap {
  flex: 1;
  height: 600px;
  min-width: 0;
}
.radar-sidebar {
  width: 320px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.25);
  border-left: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  max-height: 600px;
}
.radar-strip-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.radar-controls-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
  flex-wrap: wrap;
}
/* Search input */
.radar-search {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: #e2e8f0;
  outline: none;
  transition: border-color 0.2s;
}
.radar-search:focus {
  border-color: #3b82f6;
}
.radar-search::placeholder {
  color: #64748b;
}
/* Sort dropdown */
.radar-sort {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  color: #e2e8f0;
  outline: none;
  cursor: pointer;
}
.radar-sort option {
  background: #1a1a1a;
}
/* Map style buttons */
.radar-style-btn {
  padding: 3px 10px;
  font-size: 11px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.2s;
}
.radar-style-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #e2e8f0;
}
.radar-style-btn.active {
  background: rgba(59,130,246,0.25);
  color: #93c5fd;
  border-color: rgba(59,130,246,0.4);
}
/* Phase badges */
.phase-badge {
  display: inline-block;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  opacity: 0.45;
  line-height: 1.4;
}
.phase-badge.active {
  opacity: 1;
}
.phase-dep        { background: rgba(34,197,94,0.2);  color: #4ade80; border-color: rgba(34,197,94,0.3); }
.phase-clb        { background: rgba(132,204,22,0.2); color: #a3e635; border-color: rgba(132,204,22,0.3); }
.phase-trn        { background: rgba(59,130,246,0.2); color: #93c5fd; border-color: rgba(59,130,246,0.3); }
.phase-app        { background: rgba(234,179,8,0.2);  color: #fbbf24; border-color: rgba(234,179,8,0.3); }
.phase-inb        { background: rgba(244,114,182,0.15); color: #f9a8d4; border-color: rgba(244,114,182,0.25); }
.phase-gnd        { background: rgba(168,85,247,0.2); color: #c084fc; border-color: rgba(168,85,247,0.3); }
.phase-oth        { background: rgba(107,114,128,0.2); color: #9ca3af; border-color: rgba(107,114,128,0.3); }
/* Flight strips */
.flight-strip {
  background: rgba(0,0,0,0.45);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-left: 4px solid #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}
.flight-strip:hover {
  background: rgba(0,0,0,0.6);
  box-shadow: 0 0 8px rgba(59,130,246,0.15);
}
.flight-strip-active {
  background: rgba(59,130,246,0.15) !important;
  border-left-color: #fff !important;
  box-shadow: 0 0 12px rgba(59,130,246,0.25);
}
.flight-strip .fs-callsign {
  font-weight: 700;
  font-size: 13px;
  color: #f1f5f9;
}
.flight-strip .fs-type {
  font-size: 10px;
  color: #94a3b8;
}
.flight-strip .fs-data {
  font-size: 11px;
  color: #cbd5e1;
  font-family: 'JetBrains Mono', monospace;
}
.flight-strip .fs-data span {
  color: #64748b;
}
.flight-strip .fs-photo {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.flight-strip .fs-photo img {
  display: block;
  width: 64px;
  height: 42px;
  object-fit: cover;
}
/* T&G / ops badges on flight strips */
.fs-ops {
  display: flex;
  gap: 4px;
  margin-top: 3px;
}
.fs-ops-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  line-height: 1.4;
  letter-spacing: 0.3px;
}
.fs-ops-tg {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.fs-ops-dep {
  background: rgba(96, 165, 250, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}
.fs-ops-lnd {
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
/* Fullscreen toggle button */
.radar-fullscreen-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(59,130,246,0.35);
  background: rgba(59,130,246,0.15);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  margin-left: 8px;
  white-space: nowrap;
}
.radar-fullscreen-btn:hover {
  background: rgba(59,130,246,0.35);
  color: #fff;
  border-color: rgba(59,130,246,0.5);
}
.radar-fs-icon {
  font-size: 15px;
  line-height: 1;
}
.radar-fs-label {
  font-size: 11px;
}
/* ─── Strip Board ─── */
.strip-board-container { display: none; }
.strip-board-container.active { display: flex; gap: 12px; padding: 6px 12px; overflow-y: auto; }
.strip-board-column { flex: 1; min-width: 0; }
.strip-board-column h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  padding: 6px 10px; border-radius: 6px; margin-bottom: 6px; text-align: center;
}
.strip-col-in h4 { background: rgba(34,197,94,0.15); color: #4ade80; }
.strip-col-left h4 { background: rgba(156,163,175,0.15); color: #9ca3af; }

.strip-card {
  background: rgba(15,15,15,0.9);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid #4ade80;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 11px;
  transition: border-color 0.2s;
}
.strip-card:hover { border-color: rgba(255,255,255,0.2); }
.strip-card-left { border-left-color: #6b7280; opacity: 0.7; }
.strip-callsign { font-weight: 700; color: #60a5fa; font-size: 13px; font-family: monospace; }
.strip-type { color: #9ca3af; font-size: 10px; margin-left: 6px; }
.strip-time { color: #fbbf24; font-size: 10px; margin-left: auto; }
.strip-data { color: #94a3b8; font-size: 10px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.strip-ops { margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }
.strip-duration { color: #6b7280; font-size: 9px; margin-top: 2px; }

/* View toggle buttons */
.radar-view-toggle { display: flex; gap: 2px; background: rgba(255,255,255,0.05); border-radius: 6px; padding: 2px; }
.radar-view-btn {
  padding: 3px 10px; font-size: 10px; font-weight: 600; border-radius: 4px;
  color: #9ca3af; cursor: pointer; border: none; background: transparent; transition: all 0.15s;
}
.radar-view-btn.active { background: rgba(59,130,246,0.3); color: #93c5fd; }
.radar-view-btn:hover:not(.active) { color: #e2e8f0; }

/* Split mode — compact strips, map gets most space */
.radar-split-mode .glass-card { overflow: visible !important; }
.radar-split-mode .strip-board-container.active { max-height: 25vh; overflow-y: auto; border-top: 1px solid rgba(255,255,255,0.1); }

/* Strips-only mode */
#live-radar-section .glass-card:has(.strip-board-container.active) { overflow: visible !important; }

/* Fullscreen radar overrides (class toggled by JS) */
.radar-is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  width: 100vw !important;
  max-width: none !important;
  background: #111 !important;
  overflow: hidden !important;
  margin: 0 !important;
}
.radar-is-fullscreen::before {
  display: none !important;
}
.radar-is-fullscreen > div:first-child {
  flex-shrink: 0 !important;
}
.radar-is-fullscreen .radar-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
}
.radar-is-fullscreen .radar-map-wrap {
  height: auto !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
}
.radar-is-fullscreen .radar-sidebar {
  max-height: none !important;
}
.radar-is-fullscreen .radar-controls-bar {
  flex-shrink: 0 !important;
}
/* Mobile responsive */
@media (max-width: 768px) {
  .radar-body {
    flex-direction: column;
  }
  .radar-map-wrap {
    height: 400px;
  }
  .radar-sidebar {
    width: 100%;
    max-height: 50vh;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
}



/* Permanent POI labels for Live Radar */
.leaflet-tooltip.poi-label {
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}


/* --- Active (open) state for header buttons --- */
.weather-button.active,
.radar-button.active {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25), 0 8px 30px rgba(0,0,0,0.35);
  transform: translateY(-1px);
}

/* Compact card styles for multiple recordings per hour */
.compact-card {
    padding: 1rem !important;
}

.compact-card .waveform-container {
    height: 60px !important;
    margin-bottom: 0.75rem !important;
}

.compact-card h3 {
    font-size: 1rem !important;
}

.compact-card .play-button {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
}

.hour-group {
    border-left: 3px solid rgba(96, 165, 250, 0.3);
    padding-left: 1rem;
}






/* ============================================
   TIMELINE MODULE STYLES
   Add this to the end of /var/www/html/css/style.css
   ============================================ */

/* Show/hide based on mode */
.timeline-only {
    display: none !important;
}

body.timeline-mode .timeline-only {
    display: block !important;
}

body.timeline-mode .hourly-only,
body.timeline-mode .transmission-only {
    display: none !important;
}

/* Timeline frequency chips */
.timeline-freq-chip {
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.timeline-freq-chip:hover {
    transform: scale(1.02);
}

/* Recording segments in timeline */
.timeline-recording-segment {
    backdrop-filter: blur(4px);
}

.timeline-recording-segment:hover {
    transform: scaleY(1.15);
    z-index: 10;
}

/* Aircraft segments in timeline */
.timeline-aircraft-segment {
    backdrop-filter: blur(4px);
}

.timeline-aircraft-segment:hover {
    transform: scaleY(1.1);
}

/* Hour selection highlight */
.timeline-hour-btn {
    backdrop-filter: blur(2px);
    cursor: pointer;
}

/* Mini player slide-up animation */
#timeline-mini-player {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#timeline-mini-player:not(.translate-y-full) {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Fix grid display in timeline stats */
body.timeline-mode .grid {
    display: grid !important;
}

/* Fix flex display in timeline */
body.timeline-mode .flex {
    display: flex !important;
}

/* ============================================
   WEATHER STATION (AWOS) WIDGET STYLES
   ============================================ */

#ws-mini-bar {
    transition: all 0.3s ease;
}

#ws-mini-bar:hover {
    background: rgba(59, 130, 246, 0.08);
}

#ws-mini-bar.ws-live #ws-mini-text {
    color: #86efac;
}

#ws-mini-bar.ws-archived #ws-mini-text {
    color: #9ca3af;
}

#ws-awos-panel canvas {
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.4);
}

/* ============================================
   METAR BAR SPLIT LAYOUT + WEBCAM
   ============================================ */

/* Split container: 50/50 when webcam present */
.ws-split {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ws-split-left {
    flex: 1;
    min-width: 0;
}

.ws-split-right {
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
}

.ws-split-right:not(.hidden) {
    display: flex;
}

.ws-webcam-thumb {
    height: 52px;
    width: auto;
    max-width: 120px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: opacity 0.3s ease;
}

.ws-webcam-thumb:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

.ws-webcam-mini-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ws-webcam-mini-label {
    font-size: 0.6rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Expanded panel */
#ws-expanded-panel {
    animation: wsExpandSlide 0.3s ease-out;
    overflow: hidden;
}

@keyframes wsExpandSlide {
    from {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
    }
    to {
        opacity: 1;
        max-height: 800px;
        margin-top: 0.5rem;
    }
}

.ws-expanded-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
}

.ws-expanded-left {
    min-width: 0;
}

.ws-expanded-right {
    min-width: 0;
}

/* When no webcam, expanded panel is single column */
.ws-expanded-content.ws-no-webcam {
    grid-template-columns: 1fr;
}

.ws-webcam-large {
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-height: 240px;
}

.ws-timelapse {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
    max-height: 200px;
}

.ws-webcam-clickable {
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ws-webcam-clickable:hover {
    opacity: 0.85;
    transform: scale(1.01);
}

/* Webcam lightbox */
.ws-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ws-lightbox.hidden {
    display: none;
}

.ws-lightbox img {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.ws-lightbox-caption {
    color: #9ca3af;
    font-size: 0.85rem;
    margin-top: 12px;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .ws-split {
        flex-direction: column;
        align-items: stretch;
    }

    .ws-split-right {
        justify-content: center;
    }

    .ws-webcam-thumb {
        height: 60px;
        max-width: 160px;
    }

    .ws-expanded-content {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   NOTAM SECTION
   ============================================================================ */

#notam-mini-bar:hover {
    background: rgba(245, 158, 11, 0.06);
}

.notam-count-badge {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    flex-shrink: 0;
}

#notam-panel {
    animation: wsExpandSlide 0.3s ease-out;
}

.notam-card {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.notam-card:last-child {
    border-bottom: none;
}

.notam-badge-active {
    display: inline-block;
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
}

.notam-badge-upcoming {
    display: inline-block;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
}

.notam-body {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #d1d5db;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.notam-raw {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 6px;
    line-height: 1.4;
}

/* ============================================================================
   RADAR — light-mode overrides + perf polish
   ============================================================================ */

/* Perf: solid backgrounds (avoid backdrop-filter blur on scrolling panels) */
.radar-sidebar,
.radar-controls-bar {
  background: var(--md-bg-elev);
  border-color: var(--md-line) !important;
}

.radar-search,
.radar-sort {
  background: var(--md-bg-hi);
  border-color: var(--md-line) !important;
  color: var(--md-ink);
}
.radar-search:focus,
.radar-sort:focus {
  border-color: var(--md-acc) !important;
}
.radar-search::placeholder { color: var(--md-ink-3); }
.radar-sort option { background: var(--md-bg-elev); color: var(--md-ink); }

.radar-style-btn {
  background: var(--md-bg-hi);
  color: var(--md-ink-2);
  border-color: var(--md-line);
}
.radar-style-btn:hover {
  background: var(--md-bg-elev);
  color: var(--md-ink);
}
.radar-style-btn.active {
  background: var(--md-bg);
  color: var(--md-ink);
  border-color: var(--md-line-2);
}

/* Strip board + strip cards */
#strip-board,
.strip-board-container {
  background: var(--md-bg);
  border-top: 1px solid var(--md-line) !important;
}
.strip-board-column h4 {
  color: var(--md-ink-2) !important;
  background: var(--md-bg-elev);
  border-bottom: 1px solid var(--md-line);
}
.strip-col-in h4 { color: var(--md-ok) !important; }

/* Flight-strip callsign / data / ops bits */
.fs-callsign { color: var(--md-ink); }
.fs-data, .fs-altitude, .fs-speed { color: var(--md-ink-2); }

/* ATC header (top bar of radar.php fullscreen) */
#atc-header {
  background: var(--md-bg-elev);
  border-color: var(--md-line) !important;
}

/* Radar-live stream button (LIVE + waveform canvas) */
.radar-live-btn {
  background: var(--md-bg-hi);
  border-color: var(--md-line) !important;
  color: var(--md-ink);
}
.radar-live-btn:hover { border-color: var(--md-line-2) !important; }

/* Fullscreen button styling — respect tokens */
.radar-fullscreen-btn {
  background: var(--md-bg-hi);
  color: var(--md-ink-2);
  border-color: var(--md-line);
}
.radar-fullscreen-btn:hover {
  color: var(--md-ink);
  border-color: var(--md-line-2);
}

/* ============================================================================
   FLIGHT STRIPS + PHASE BADGES — theme-aware tokens (fixes light mode)
   ============================================================================ */

/* Base: use tokens instead of rgba(0,0,0,0.45) so light mode inherits properly */
.flight-strip {
  background: var(--md-bg-elev);
  border: 1px solid var(--md-line);
  border-left: 4px solid var(--md-ink-3);
}
.flight-strip:hover {
  background: var(--md-bg-hi);
  box-shadow: 0 0 0 1px var(--md-line-2);
}
.flight-strip-active {
  background: var(--md-bg-hi) !important;
  border-left-color: var(--md-acc) !important;
  box-shadow: 0 0 0 1px var(--md-acc) inset !important;
}
.flight-strip .fs-callsign { color: var(--md-ink); }
.flight-strip .fs-type     { color: var(--md-ink-3); }
.flight-strip .fs-data     { color: var(--md-ink-2); }
.flight-strip .fs-data span { color: var(--md-ink-3); }
.flight-strip .fs-photo    { border-color: var(--md-line); }

/* Phase badges — darker text variants for light mode so text-on-tinted-bg
   keeps WCAG contrast. Background 20% rgba stays the same in both themes. */
:root[data-theme="light"] .phase-dep { color: #047857 !important; }
:root[data-theme="light"] .phase-clb { color: #4d7c0f !important; }
:root[data-theme="light"] .phase-trn { color: #1d4ed8 !important; }
:root[data-theme="light"] .phase-app { color: #a16207 !important; }
:root[data-theme="light"] .phase-inb { color: #be185d !important; }
:root[data-theme="light"] .phase-gnd { color: #7e22ce !important; }
:root[data-theme="light"] .phase-oth { color: var(--md-ink-2) !important; }

/* Operation badges (.op-departure etc. in atc.php aircraft summary) — same idea */
:root[data-theme="light"] .op-departure     { color: #1d4ed8 !important; }
:root[data-theme="light"] .op-landing       { color: #047857 !important; }
:root[data-theme="light"] .op-touch_and_go  { color: #b45309 !important; }
:root[data-theme="light"] .op-circuit       { color: #6b21a8 !important; }
:root[data-theme="light"] .op-overflight    { color: var(--md-ink-2) !important; }
:root[data-theme="light"] .op-uncertain     { color: #c2410c !important; }
:root[data-theme="light"] .op-ground        { color: #7e22ce !important; }

/* .fs-ops-* badges on flight strips */
.fs-ops-badge { background: var(--md-bg); color: var(--md-ink); border: 1px solid var(--md-line); }
:root[data-theme="light"] .fs-ops-tg  { color: #b45309 !important; }
:root[data-theme="light"] .fs-ops-dep { color: #1d4ed8 !important; }
:root[data-theme="light"] .fs-ops-lnd { color: #047857 !important; }

/* Strip-board column headers — color-coded dot / label stays on both themes */
:root[data-theme="light"] .strip-board-column h4 { color: var(--md-ink-2) !important; background: var(--md-bg-elev); }
:root[data-theme="light"] .strip-col-in h4 { color: var(--md-ok) !important; }

/* Aircraft popup/balloon on the Leaflet map — ensure readable in light */
:root[data-theme="light"] .ac-balloon { background: var(--md-bg-elev) !important; color: var(--md-ink) !important; border-color: var(--md-line) !important; }

/* Radar status dots row + METAR inline text */
:root[data-theme="light"] #radar-status,
:root[data-theme="light"] #ws-mini-text,
:root[data-theme="light"] #ws-mini-human { color: var(--md-ink-2) !important; }

/* ============================================================================
   CONTENT DENSITY — tighten Tailwind utilities globally so cards, paddings
   and headings match the Minimal Dark preview (01-minimal-dark.html).
   Without this, hardcoded rounded-2xl / p-6 / text-3xl in markup keep the
   "original" puffy feel. We override the utility classes rather than edit
   every page's HTML.
   ============================================================================ */

/* Border radius — softer than Tailwind defaults */
.rounded-2xl { border-radius: 10px !important; }
.rounded-xl  { border-radius: 8px  !important; }

/* Padding — tighten the big ones one step */
.p-8 { padding: 1.25rem !important; }
.p-6 { padding: 1.1rem  !important; }
.md\:p-8 { padding: 1.25rem !important; }
.md\:p-6 { padding: 1.1rem  !important; }

/* Heading sizes — shrink display scale by one step, keep body sizes */
.text-3xl { font-size: 1.5rem !important;   line-height: 2rem !important; }
.text-2xl { font-size: 1.25rem !important;  line-height: 1.75rem !important; }
.text-xl  { font-size: 1.075rem !important; line-height: 1.55rem !important; }

/* Section title font-weight softened — bold is too shouty for Minimal */
section h1, section h2, section h3,
section h1.font-bold, section h2.font-bold, section h3.font-bold {
  font-weight: 500;
  letter-spacing: -0.015em;
}

/* Bigger gaps like gap-6 / mb-6 / mt-8 — one step tighter */
.gap-6 { gap: 1rem !important; }
.mb-6  { margin-bottom: 1rem !important; }
.mt-6  { margin-top: 1rem !important; }
.mt-8  { margin-top: 1.25rem !important; }
.mb-8  { margin-bottom: 1.25rem !important; }

/* Font size text-4xl + text-5xl (stat counters) — keep impact but scale down */
.text-4xl { font-size: 1.875rem !important; line-height: 2.25rem !important; }
.text-5xl { font-size: 2.25rem !important;  line-height: 2.5rem !important; }
