/**
 * Airport Cards — Sidebar result cards and map popup dot-row styles.
 */

/* === Pinned Home Airport Slot (above scrollable list) === */
.home-airport-card {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-top: calc(-1 * var(--space-5));
  margin-left: calc(-1 * var(--space-5));
  margin-right: calc(-1 * var(--space-5));
  width: calc(100% + 2 * var(--space-5));
}

/* === Departure Strip Home Card === */
.home-departure-card {
  background: #131F2E;
  border-left: 3px solid var(--horizon-teal);
  padding: 14px var(--space-5);
  cursor: pointer;
  user-select: none;
  transition: background 120ms var(--ease-out);
}

.home-departure-card:hover {
  background: #1B2C40;
}

.home-departure-card:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.home-departure-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(150, 199, 232, 0.45);
  margin-bottom: 5px;
}

.home-departure-card__icao {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  color: #F0F4F8;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 3px;
}

.home-departure-card__name {
  font-size: 0.8125rem;
  color: rgba(240, 244, 248, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 9px;
}

.home-departure-card__header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
  min-width: 0;
}

.home-departure-card__header-icao {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: #F0F4F8;
  letter-spacing: 0.04em;
  line-height: 1;
  flex-shrink: 0;
}

.home-departure-card__header-name {
  font-size: 0.75rem;
  color: rgba(240, 244, 248, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  min-width: 0;
}

.home-departure-card__wind {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: rgba(150, 199, 232, 0.6);
}

/* === Airport List Container === */
.airport-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0;
  /* Bleed out of the parent's var(--space-5) padding so cards go edge-to-edge */
  margin-left: calc(-1 * var(--space-5));
  margin-right: calc(-1 * var(--space-5));
  width: calc(100% + 2 * var(--space-5));
}

@media (max-width: 639px) {
  .airport-list {
    padding-bottom: var(--space-12); /* extra breathing room above nav bar */
  }
}

/* When filters expanded, airport list flows with sidebar scroll */
.filters-expanded .airport-list {
  overflow: visible;
  flex: none;
  min-height: auto;
}

.airport-list__empty {
  text-align: center;
  color: var(--gray-500);
  font-size: 0.8125rem;
  padding: var(--space-6) var(--space-4);
}

/* === Airport Card === */
.airport-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: transparent;
  border: none;
  border-left: 8px solid rgba(255,255,255,0.12);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-radius: 0;
  padding: 8px var(--space-4);
  margin-bottom: 0;
  cursor: pointer;
  transition: background 120ms var(--ease-out);
}

.airport-card:hover {
  background: rgba(255,255,255,0.03);
}

.airport-card:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

/* Color variants — left border */
.airport-card--teal  { border-left-color: var(--horizon-teal); }
.airport-card--home {
  background: rgba(150, 199, 232, 0.055);
  border-left: 8px solid transparent;
  position: relative;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 1px 4px rgba(0,0,0,0.3);
}

.airport-card--home .airport-card__icao {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.airport-card--home .airport-card__icao::after {
  content: 'HOME';
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #96C7E8;
  background: rgba(150, 199, 232, 0.12);
  border: 1px solid rgba(150, 199, 232, 0.3);
  border-radius: 3px;
  padding: 1px 6px;
  display: block;
  width: fit-content;
}
.airport-card--green { border-left-color: #45f0d0; }
.airport-card--amber { border-left-color: #F59E0B; }
.airport-card--red   { border-left-color: #EF4444; }
.airport-card--gray  { border-left-color: rgba(255,255,255,0.12); }

/* === Card inner layout === */
.airport-card__icao {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  color: #F0F4F8;
  min-width: 44px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.airport-card__info {
  flex: 1;
  min-width: 0;
}

.airport-card__name {
  font-size: 0.875rem;
  font-weight: 400;
  color: #909090;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.airport-card__meta,
.airport-card__footer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(150, 199, 232, 0.65);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges render as plain colored text on dark sidebar — no pill */
.airport-card .badge {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.airport-card .badge--qualify  { color: rgba(240,244,248,0.8); }
.airport-card .badge--marginal { color: rgba(240,244,248,0.8); }
.airport-card .badge--exceed   { color: rgba(240,244,248,0.8); }
.airport-card .badge--calm     { color: rgba(240,244,248,0.8); }
.airport-card .badge--home     { color: var(--horizon-teal); background: none; }
.airport-card .badge--unknown  { color: var(--gray-400); align-self: stretch; justify-content: center; }

/* Stacked right column: XW value + XW label + FC pill */
.airport-card__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

/* Invisible scroll anchors — position: static so offsetTop is always reliable */
.section-anchor {
  display: block;
  height: 0;
  overflow: hidden;
}

/* === Section divider labels === */
.airport-list__section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8A9099;
  padding: var(--space-2) var(--space-4) var(--space-1);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: #27272A;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* All section label variants use the same dark style on the dark sidebar */
.airport-list__section-label--home,
.airport-list__section-label--within,
.airport-list__section-label--marginal,
.airport-list__section-label--exceed,
.airport-list__section-label--nometar {
  background: #27272A;
  color: #8A9099;
  border-bottom-color: rgba(255,255,255,0.06);
}

/* === Forecast Dots (map popups only) === */
.forecast-dots {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--gray-100);
}

.forecast-dots__row {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.forecast-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  color: #fff;
}

.forecast-dot--green {
  background: var(--qualify-green);
}

.forecast-dot--amber {
  background: var(--marginal-amber, #927000);
}

.forecast-dot--red {
  background: var(--exceed-red);
}

.forecast-dot--gray {
  background: var(--gray-300);
  color: var(--gray-600);
}

.forecast-dots__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.5625rem;
  color: var(--gray-700);
  margin-top: 2px;
  padding: 0 2px;
}

.forecast-dots__summary {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--gray-600);
  font-weight: 500;
  margin-top: var(--space-1);
}

/* === Excluded Section (runway dimensions filter) === */
.excluded-section {
  margin-top: var(--space-3);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-2);
}

.excluded-section__header {
  font-size: 0.75rem;
  font-weight: 600;
  color: #8A9099;
  cursor: pointer;
  padding: var(--space-1) 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.excluded-section__header::-webkit-details-marker {
  display: none;
}

.excluded-section__header::before {
  content: '▶';
  font-size: 0.5rem;
  transition: transform 150ms;
}

.excluded-section[open] > .excluded-section__header::before {
  transform: rotate(90deg);
}

.airport-card--muted {
  opacity: 0.55;
  border-left-color: var(--gray-200);
}
