/* ── Airspace Restrictions — InfoWindow dark theme ───────────────────── */

.airspace-iw {
  background: #1b1d23;
  color: #e4e4e7;
  padding: 12px 14px;
  border-radius: 8px;
  max-width: 340px;
  font-size: 13px;
  line-height: 1.5;
}

.airspace-iw-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.airspace-iw-header .severity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.severity-badge.critical { background: #ef4444; color: #fff; }
.severity-badge.warning  { background: #f97316; color: #fff; }
.severity-badge.caution  { background: #eab308; color: #1b1d23; }
.severity-badge.info     { background: #3b82f6; color: #fff; }

.airspace-iw-header .status-tag {
  font-size: 11px;
  color: #9ca3af;
}

.airspace-iw-header .status-tag.active {
  color: #22c55e;
}

.airspace-iw-id {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 6px;
}

.airspace-iw-text {
  font-size: 12px;
  color: #d1d5db;
  margin-bottom: 8px;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.airspace-iw-meta {
  font-size: 11px;
  color: #9ca3af;
  border-top: 1px solid #2d2f36;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.airspace-iw-meta span {
  display: block;
}

/* Divider between multiple restrictions in same InfoWindow */
.airspace-iw-divider {
  border: none;
  border-top: 1px solid #2d2f36;
  margin: 10px 0;
}

/* Severity color legend */
.airspace-iw-legend {
  border-top: 1px solid #2d2f36;
  margin-top: 10px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.airspace-iw-legend .legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.airspace-iw-legend .legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.airspace-iw-legend .legend-label {
  font-size: 10px;
  color: #9ca3af;
  line-height: 1.3;
}

.airspace-iw-legend .legend-label strong {
  text-transform: uppercase;
  font-size: 10px;
  color: #d1d5db;
}

/* Override Google Maps InfoWindow chrome for dark theme */
.gm-style-iw-d { overflow: auto !important; }
.airspace-iw-container .gm-style-iw {
  background: #1b1d23 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5) !important;
  padding: 0 !important;
}
.airspace-iw-container .gm-style-iw-tc::after {
  background: #1b1d23 !important;
}
.airspace-iw-container .gm-ui-hover-effect {
  filter: invert(1);
}

/* ── Airspace Filter Panel (desktop) ─────────────────────────────────── */

.asf-panel {
  position: absolute;
  bottom: 80px;
  left: 12px;
  background: rgba(27, 29, 35, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  color: var(--dsc-text-muted);
  font-size: 12px;
  padding: 12px 16px;
  z-index: 4;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  min-width: 160px;
}

.asf-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dsc-text-muted);
  margin-bottom: 8px;
  opacity: 0.7;
}

.asf-count {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10px;
  color: var(--dsc-text-muted);
  opacity: 0.7;
  text-align: center;
}

/* ── Mobile Mini-Bar ──────────────────────────────────────────────────── */

.asf-mini-bar {
  display: none;
}

.asf-dot-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.2s, transform 0.2s;
  color: var(--dsc-text-muted);
  font-size: 13px;
}

.asf-dot-btn.inactive {
  opacity: 0.25;
  transform: scale(0.8);
}

.asf-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  display: block;
}

.asf-mini-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 2px;
  flex-shrink: 0;
}

.asf-expand-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--dsc-text-muted);
  font-size: 13px;
  transition: color 0.15s;
}

.asf-expand-btn:hover {
  color: var(--dsc-primary);
}

/* ── Mobile Sheet Overlay ─────────────────────────────────────────────── */

.asf-sheet-overlay {
  display: none;
}

.asf-sheet {
  display: none;
}

/* ── Picker Popup (overlap disambiguation) ────────────────────────────── */

.asf-picker {
  background: rgba(27, 29, 35, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 220px;
  max-width: 300px;
  font-size: 13px;
}

.asf-picker-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dsc-text-muted, #9ca3af);
  padding: 4px 12px 6px;
  opacity: 0.7;
}

.asf-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.12s;
  color: #e4e4e7;
}

.asf-picker-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

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

.asf-picker-id {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.asf-picker-status {
  font-size: 10px;
  color: #9ca3af;
  flex-shrink: 0;
}

.asf-picker-status.active {
  color: #22c55e;
}

/* ── Responsive (mobile ≤1024px) ──────────────────────────────────────── */

@media (max-width: 1024px) {
  /* Hide desktop panel on mobile */
  .asf-panel {
    display: none !important;
  }

  /* Show mini-bar — centered above the bottom toolbar */
  .asf-mini-bar {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(27, 29, 35, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    gap: 2px;
    z-index: 5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }

  /* Sheet overlay */
  .asf-sheet-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .asf-sheet-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  /* Bottom sheet */
  .asf-sheet {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(27, 29, 35, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px 20px 0 0;
    padding: 8px 20px 24px;
    z-index: 1100;
    color: #e4e4e7;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .asf-sheet.sheet-open {
    transform: translateY(0);
  }

  .asf-sheet .filter-sheet-handle {
    display: flex;
    justify-content: center;
    padding: 8px 0 12px;
    cursor: grab;
  }

  .asf-sheet .filter-sheet-handle span {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
  }

  .asf-sheet .asf-title {
    color: #9ca3af;
    font-size: 11px;
    margin-bottom: 10px;
  }

  .asf-sheet .filter-option {
    padding: 8px 0;
    font-size: 14px;
    color: #e4e4e7;
    opacity: 0.5;
  }

  .asf-sheet .filter-option:has(input:checked) {
    opacity: 1;
  }

  .asf-sheet .filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  .asf-sheet .asf-count {
    color: #9ca3af;
    font-size: 11px;
  }
}

/* ── Airspace Loading Overlay ──────────────────────────────────────────── */

.dsc-loading-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  background: rgba(27, 29, 35, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 28px 36px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: dscLoadingIn 0.3s ease-out;
}

.dsc-loading-overlay.fade-out {
  animation: dscLoadingOut 0.4s ease-in forwards;
}

.dsc-loading-overlay.error {
  border-color: rgba(239, 68, 68, 0.3);
}

.dsc-loading-icon {
  font-size: 28px;
  color: #00aeef;
  margin-bottom: 12px;
}

.dsc-loading-overlay.error .dsc-loading-icon {
  color: #ef4444;
}

.dsc-loading-text {
  font-size: 15px;
  font-weight: 600;
  color: #e4e4e7;
  margin-bottom: 4px;
}

.dsc-loading-sub {
  font-size: 12px;
  color: #9ca3af;
}

/* Slightly slower pulse for loading feel */
.dsc-loading-icon .fa-pulse {
  animation-duration: 1.5s;
}

@keyframes dscLoadingIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes dscLoadingOut {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
}
