/* Removable drone flight-constraint module — Autopylot-parity visuals.
   Delete with static/airspace/ */

/* Light basemap feel while Drone flight is on (Autopylot uses light streets).
   Opacity (not filter) — filter on the tile pane flickers during pinch/zoom. */
#map.basemap-airspace-light .leaflet-tile-pane {
  opacity: 1;
}

.airspace-slot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.airspace-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.airspace-slot-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.airspace-slot-title i {
  color: #fd9104;
  font-size: 0.75rem;
}

.airspace-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.airspace-toggle input {
  accent-color: #fd9104;
  margin: 0;
}

.airspace-detail-block {
  display: none;
  margin-top: 8px;
}

.airspace-detail-block.is-active {
  display: block;
}

.airspace-blurb {
  font-size: 0.62rem;
  color: var(--text-dim);
  line-height: 1.35;
  margin: 0 0 6px;
}

.airspace-blurb strong {
  color: var(--text-muted);
  font-weight: 600;
}

.airspace-class-toggles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.airspace-class-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.airspace-class-toggle input {
  accent-color: #fd9104;
  margin: 0;
  flex-shrink: 0;
}

.airspace-class-toggle span {
  line-height: 1.2;
}

.airspace-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

/* Autopylot blocking red #F60726 */
.airspace-swatch-nofly {
  background: rgba(246, 7, 38, 0.55);
  border-color: #f60726;
}

/* Autopylot other-blocking purple #7C1C8D */
.airspace-swatch-park {
  background: rgba(124, 28, 141, 0.55);
  border-color: #7c1c8d;
}

/* Autopylot LAANC amber #FD9104 */
.airspace-swatch-auth {
  background: rgba(253, 145, 4, 0.55);
  border-color: #fd9104;
}

.airspace-status {
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-bottom: 4px;
  min-height: 1em;
}

.airspace-credit {
  font-size: 0.6rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.airspace-credit a {
  color: var(--text-muted);
  text-decoration: underline;
}

.airspace-credit a:hover {
  color: var(--text-main);
}

/* Map markers */
.airspace-marker {
  background: transparent;
  border: none;
}

.airspace-marker-stadium {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #f60726;
  color: #f60726;
  font-size: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Autopylot-style UASFM ceiling labels (center of cell) */
.airspace-uasfm-label {
  background: transparent !important;
  border: none !important;
}

.airspace-uasfm-label span {
  display: inline-block;
  min-width: 1.4em;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #374151;
  text-shadow:
    0 0 2px #fff,
    0 0 3px #fff,
    1px 0 0 #fff,
    -1px 0 0 #fff,
    0 1px 0 #fff,
    0 -1px 0 #fff;
  line-height: 1.1;
  pointer-events: none;
}

.airspace-popup {
  font-size: 0.75rem;
  min-width: 170px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.airspace-popup-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: #111827;
}

.airspace-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.airspace-badge-nofly {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f60726;
}

.airspace-badge-auth {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fd9104;
}

.airspace-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0;
  color: #3a4250;
}

.airspace-popup-row span {
  color: #6b7280;
}

/* Slightly wider layers panel when airspace slot is present */
.layers-panel {
  width: 280px;
}

/* Persistent map-canvas legend (visible while Drone flight is on, even if Layers closed) */
.airspace-map-legend {
  position: absolute;
  left: 16px;
  bottom: 24px;
  z-index: var(--map-chrome-z, 1100);
  max-width: min(220px, calc(100vw - 40px));
  padding: 8px 10px;
  border-radius: var(--radius-md, 8px);
  background: rgba(26, 30, 36, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  box-shadow: var(--shadow-md, 0 4px 16px rgba(0, 0, 0, 0.35));
  color: var(--text-muted, #9ca3af);
  pointer-events: none;
}

.airspace-map-legend[hidden] {
  display: none !important;
}

.airspace-map-legend-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-main, #f3f4f6);
  margin-bottom: 6px;
}

.airspace-map-legend-title i {
  color: #fd9104;
  font-size: 0.7rem;
}

.airspace-map-legend-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.airspace-map-legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  line-height: 1.2;
  color: var(--text-dim, #9ca3af);
}

.airspace-map-legend-row.is-off {
  opacity: 0.35;
  text-decoration: line-through;
}

.airspace-map-legend-note {
  margin: 6px 0 0;
  font-size: 0.55rem;
  line-height: 1.3;
  color: var(--text-dim, #6b7280);
}

body.ui-mobile .airspace-map-legend {
  left: calc(8px + var(--safe-left, 0px));
  bottom: calc(var(--mobile-plan-h, 56px) + var(--mobile-fab-gap, 8px) + var(--mobile-chrome-bottom, 0px) + 8px);
  max-width: min(160px, calc(100vw - 100px));
  padding: 6px 8px;
}

body.ui-mobile.sheet-open .airspace-map-legend {
  display: none !important;
}

body.car-shell .airspace-map-legend {
  left: 12px;
  bottom: calc(var(--car-sheet-h, 78px) + 12px);
}
