/* ==========================================================================
   EPJG Enhanced Flight Path Map - CSS Styles
   ========================================================================== */

/* ATZ Circle and Waypoint Styles */
.atz-circle { 
  stroke: #2563eb; 
  fill: rgba(37,99,235,0.08); 
}

.waypoint-label { 
  font-size: 0.8rem;
  font-weight: 700;
  background: #0f172a;
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Unified Airplane Marker Styles */
.airplane-marker-container {
  /* Reset default leaflet marker styles */
}

.airplane-marker {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transform: translate(-50%, -50%);
  font-family: Inter, system-ui, sans-serif;
  backdrop-filter: blur(4px);
}

.airplane-marker .airplane-icon {
  font-size: 14px;
  line-height: 1;
}

.airplane-marker .airplane-time {
  font-size: 11px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
}

/* Info Bar Styles (Bottom Panel) */
.info-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  font-family: Inter, system-ui, sans-serif;
}

.info-bar .pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(17,24,39,0.6);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.2;
  min-width: 60px;
}

.info-bar .pill .value {
  font-weight: 700;
  font-size: 0.85rem;
  color: #60a5fa;
  margin-bottom: 1px;
}

.info-bar .pill .label {
  color: #94a3b8;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Waypoint wrapper – vertical: name on top, badge below */
.epjg-waypoint-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.25));
}

/* Waypoint name label (above badge) */
.epjg-waypoint-name {
  font-size: 9px;
  font-weight: 700;
  color: #1f2937;
  background: rgba(255,255,255,0.88);
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  line-height: 1.2;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  margin-bottom: 2px;
}

/* VFR badge: dark circle */
.epjg-waypoint-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1f2937;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  font-family: Inter, system-ui, sans-serif;
  border: 2px solid rgba(255,255,255,0.9);
}

/* IFR badge: blue pentagon */
.epjg-waypoint-badge.ifr {
  border-radius: 0;
  background: #2563eb;
  border: 2px solid rgba(219,234,254,0.9);
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.epjg-waypoint-name.ifr {
  color: #2563eb;
  border-color: rgba(37,99,235,0.2);
  background: rgba(219,234,254,0.88);
}

/* Minor/RNAV badge: small gray dot */
.epjg-waypoint-badge.minor {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9ca3af;
  border: 1.5px solid rgba(255,255,255,0.7);
  font-size: 0;
  clip-path: none;
}

.epjg-waypoint-name.minor {
  font-size: 8px;
  font-weight: 700;
  color: #16a34a;
  background: rgba(255,255,255,0.85);
  border-color: rgba(22,163,74,0.2);
  box-shadow: none;
}

/* IFR waypoint label */
.ifr-label {
  font-size: 0.65rem;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

/* Modal Close Button */
.close-btn {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
  font-size: 18px;
  width: 36px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.5);
}

/* Leaflet Tooltip and Popup Improvements */
.leaflet-tooltip {
  background: rgba(17,24,39,0.95) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 6px !important;
  padding: 6px 8px !important;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: 0.75rem !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  line-height: 1.4 !important;
  font-family: Inter, system-ui, sans-serif !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.leaflet-popup-tip {
  background: #fff !important;
}

/* Modal Layout Improvements */
#modal-content {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
}

#modal-map-wrapper {
  position: relative !important;
  flex: 1 !important;
  min-height: 0 !important;
}

#modal-map-container {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
}

.playback-controls {
  flex: 0 0 auto !important;
  background: rgba(17,24,39,0.95) !important;
  border-top: 1px solid rgba(255,255,255,0.1) !important;
}

.playback-controls input[type="range"] {
  background: rgba(17,24,39,0.6) !important;
  border-radius: 8px !important;
  height: 8px !important;
  outline: none !important;
}

.playback-controls input[type="range"]::-webkit-slider-thumb {
  appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #60a5fa !important;
  cursor: pointer !important;
  border: 2px solid #fff !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.playback-controls input[type="range"]::-moz-range-thumb {
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: #60a5fa !important;
  cursor: pointer !important;
  border: 2px solid #fff !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

#info-bar-container {
  flex: 0 0 auto !important;
  background: rgba(17,24,39,0.95) !important;
  border-top: 1px solid rgba(255,255,255,0.1) !important;
}

/* ============================================================================
   AIRCRAFT BALLOON LABELS (co-atc style)
   ============================================================================ */
.aircraft-marker-container {
  overflow: visible !important;
  background: none !important;
  border: none !important;
}

/* Smooth slide between positions — applied by JS after initial placement */
.aircraft-marker-container.ac-smooth {
  transition: transform 0.8s linear !important;
}

.leaflet-marker-icon.aircraft-marker-container {
  overflow: visible !important;
}

.ac-marker-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  pointer-events: auto;
  overflow: visible;
}

.ac-marker-wrap .ac-icon {
  display: block;
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease;
}

.ac-balloon {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: auto;
}

.ac-balloon-selected {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.85);
}

.ac-selected .ac-icon {
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.6)) drop-shadow(1px 2px 2px rgba(0,0,0,0.4)) !important;
}

.ac-balloon-line1 {
  display: flex;
  gap: 4px;
  align-items: baseline;
}

.ac-balloon-cs {
  color: #e5e7eb;
  font-weight: 700;
}

.ac-balloon-type {
  color: #6b7280;
  font-weight: 400;
}

.ac-balloon-line2 {
  display: flex;
  gap: 3px;
  color: #d1d5db;
}

/* ============================================================================
   RADAR LIVE STREAM BUTTON
   ============================================================================ */
.radar-live-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.5px;
}
.radar-live-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}
.radar-live-btn.radar-live-active {
  background: rgba(239, 68, 68, 0.85);
  border-color: rgba(239, 68, 68, 0.9);
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}
.radar-live-btn.radar-live-active:hover {
  background: rgba(239, 68, 68, 0.7);
}
.radar-live-btn.radar-live-connecting {
  opacity: 0.7;
  pointer-events: none;
}
.radar-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  transition: all 0.2s ease;
}
.radar-live-active .radar-live-dot {
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}
.radar-live-canvas {
  display: none;
  width: 60px;
  height: 18px;
  border-radius: 3px;
  vertical-align: middle;
}
.radar-live-active .radar-live-canvas {
  display: inline-block;
}
.radar-live-connecting .radar-live-dot {
  background: #f59e0b;
  animation: radar-live-pulse 1s ease-in-out infinite;
}
@keyframes radar-live-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 768px) {
  .info-bar {
    gap: 0.25rem !important;
  }
  
  .info-bar .pill {
    min-width: 50px !important;
    padding: 0.2rem 0.4rem !important;
  }
  
  .info-bar .pill .value {
    font-size: 0.75rem !important;
  }
  
  .info-bar .pill .label {
    font-size: 0.6rem !important;
  }
  
  .airplane-marker {
    padding: 2px 4px !important;
  }
  
  .airplane-marker .airplane-time {
    font-size: 10px !important;
  }
}