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

/* ============================================================================
   CSS VARIABLES AND RESET
   ============================================================================ */
:root {
  --player-height: 100px;
  --primary-blue: #3b82f6;
  --primary-purple: #8b5cf6;
  --success-green: #10b981;
  --danger-red: #ef4444;
  --warning-orange: #f59e0b;
  --glass-bg: rgba(30, 41, 59, 0.5);
  --glass-border: rgba(255, 255, 255, 0.05);
}

* {
  font-family: 'Inter', sans-serif;
}

body {
  background: #0a0a0a;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: calc(var(--player-height) + 2rem);
}

/* ============================================================================
   ANIMATED BACKGROUND
   ============================================================================ */
.bg-animated {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
  animation: bgShift 20s ease-in-out infinite;
  z-index: -1;
}

@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
   ============================================================================ */
.glass-effect {
  backdrop-filter: blur(20px) saturate(180%);
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.glass-card {
  backdrop-filter: blur(10px) saturate(150%);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  pointer-events: none;
}

/* ============================================================================
   TYPOGRAPHY AND GRADIENTS
   ============================================================================ */
.gradient-text {
  background: linear-gradient(135deg, #60a5fa, #a78bfa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================================
   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, 41, 59, 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(139, 92, 246, 0.1));
  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(17, 24, 39, 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(139, 92, 246, 0.05));
}

/* ============================================================================
   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(139, 92, 246, 0.2));
  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, var(--primary-blue), var(--primary-purple));
  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(--success-green), #06b6d4);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.live-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.6);
}

.view-toggle-btn {
  background-color: rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.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, var(--primary-blue), var(--primary-purple));
  color: white;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.5);
}

/* ============================================================================
   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(17, 24, 39, 0.95), rgba(30, 41, 59, 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.2), rgba(139, 92, 246, 0.2));
  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(17, 24, 39, 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, var(--primary-blue), var(--primary-purple));
  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, #7c3aed);
  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, 41, 59, 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(17, 24, 39, 0.5);
}

.leaflet-container {
  background: rgba(17, 24, 39, 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(17, 24, 39, 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(17, 24, 39, 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-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, var(--primary-blue), var(--primary-purple)) !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;
}

.flatpickr-day.has-recordings::after {
  content: '•';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--warning-orange);
  font-size: 16px;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
}

/* ============================================================================
   WAVEFORM STYLES
   ============================================================================ */
.waveform-container {
  background: linear-gradient(90deg, rgba(17, 24, 39, 0.8) 0%, rgba(30, 41, 59, 0.8) 50%, rgba(17, 24, 39, 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 {
  background-color: rgba(51, 65, 85, 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 {
  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 {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  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
   ============================================================================ */
.hourly-mode .transmission-only { display: none !important; }
.transmission-mode .hourly-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: 12px 16px;
    font-size: 0.875rem;
    width: 100%;
    justify-content: center;
  }
  
  .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(17, 24, 39, 0.5);
}

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

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

/* ============================================================================
   AIRCRAFT FLIGHT PATH TOOLTIP (Legacy compatibility)
   ============================================================================ */
.aircraft-flight-tooltip {
  position: fixed;
  z-index: 10000;
  width: 520px;
  max-height: 650px;
  background: rgba(17, 24, 39, 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(17, 24, 39, 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, #8b5cf6, #7c3aed);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 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, #9333ea, #8b5cf6);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 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;
}

.aircraft-item {
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
}

.aircraft-item:hover {
  border-left-color: #3b82f6;
  transform: translateX(4px);
}


/* Permanent POI labels for Live Radar */
.leaflet-tooltip.poi-label {
  background: rgba(17, 24, 39, 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);
}
