/* First Class airport card tab: open ATC positions, frequencies and the ATIS broadcast. */

.airport-atc-pane {
  --aap-lit: #74f2ac;
  --aap-amber: #ffc247;
  flex: 0 0 330px;
  box-sizing: border-box;
  padding: 10px 12px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(2, 6, 13, 0.78), rgba(4, 9, 18, 0.56));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #eef3fa;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
/* Engraved cockpit placard. */
.aap-placard {
  padding: 2px 7px 1px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, #232b38, #151b25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 0 rgba(0, 0, 0, 0.5);
  color: rgba(232, 238, 247, 0.86);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.aap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.aap-src {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(196, 210, 228, 0.72);
}
.aap-src i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--aap-lit);
  box-shadow: 0 0 6px rgba(116, 242, 172, 0.8);
}

/* Annunciator lights: etched legend when closed, lit green when the position is open. */
.aap-caps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-top: 9px;
}
.aap-cap {
  display: grid;
  place-items: center;
  height: 23px;
  border-radius: 3px;
  background: linear-gradient(180deg, #1b2029, #0f1319);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 -2px 0 rgba(0, 0, 0, 0.55), 0 1px 1px rgba(0, 0, 0, 0.5);
  color: rgba(214, 224, 238, 0.24);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  transition: color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}
.aap-cap.is-on {
  background: radial-gradient(ellipse at 50% 40%, #1a5a3a, #0b2a1b 75%);
  box-shadow: inset 0 0 0 1px rgba(116, 242, 172, 0.5), inset 0 0 9px rgba(116, 242, 172, 0.32), 0 0 8px rgba(116, 242, 172, 0.18);
  color: var(--aap-lit);
  text-shadow: 0 0 6px rgba(116, 242, 172, 0.75);
}
.aap-cap.is-lighting { animation: aap-flicker 260ms linear 1; }
@keyframes aap-flicker {
  0% { opacity: 0.3; }
  30% { opacity: 1; }
  45% { opacity: 0.55; }
  100% { opacity: 1; }
}

/* Split-flap frequency board. */
.aap-board {
  list-style: none;
  margin: 8px 0 0;
  padding: 3px 8px;
  border-radius: 6px;
  background: #04070c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 6px 14px rgba(0, 0, 0, 0.6);
}
.aap-row {
  display: grid;
  grid-template-columns: 74px 86px 1fr;
  align-items: center;
  gap: 8px;
  height: 27px;
}
.aap-row + .aap-row { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.aap-pos {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 234, 244, 0.9);
}
.aap-freq {
  display: flex;
  gap: 1.5px;
}
.aap-flap {
  display: grid;
  place-items: center;
  width: 11px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #262d38 0 calc(50% - 0.5px), #05080c calc(50% - 0.5px) calc(50% + 0.5px), #1b212b calc(50% + 0.5px) 100%);
  color: #f6f7f2;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.aap-flap.is-dot {
  width: 5px;
  background: none;
}
.aap-who {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}
.aap-who b {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 650;
  color: #f4f7fb;
}
.aap-who i {
  font-style: normal;
  font-size: 10.5px;
  color: rgba(190, 204, 222, 0.66);
}
.aap-row.is-closed .aap-pos { color: rgba(214, 224, 238, 0.36); }
.aap-row.is-closed .aap-flap { background: #11151c; color: transparent; }
.aap-row.is-closed .aap-flap.is-dot { background: none; }
.aap-row.is-closed .aap-who { font-size: 11px; color: rgba(190, 204, 222, 0.38); }
.aap-row.is-flipping .aap-flap {
  animation: aap-flip 230ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
  animation-delay: calc(var(--i) * 28ms);
}
.aap-row.is-flipping .aap-who { animation: aap-fade 250ms ease-out both 120ms; }
@keyframes aap-flip {
  from { transform: perspective(120px) rotateX(-90deg); filter: brightness(1.8); }
  to { transform: none; filter: none; }
}
@keyframes aap-fade {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: none; }
}

.aap-sub {
  margin-top: 10px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(178, 194, 214, 0.78);
}
.aap-atis {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 9px;
  align-items: center;
  margin-top: 5px;
}
.aap-letter {
  display: grid;
  place-items: center;
  width: 36px;
  height: 40px;
  border-radius: 4px;
  background: linear-gradient(180deg, #262d38 0 calc(50% - 0.5px), #05080c calc(50% - 0.5px) calc(50% + 0.5px), #1b212b calc(50% + 0.5px) 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: var(--aap-amber);
  font-size: 25px;
  font-weight: 800;
}
.aap-atis-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.aap-atis-meta b { font-size: 12.5px; font-weight: 700; color: #ffffff; }
.aap-atis-meta span { font-size: 10.5px; color: rgba(190, 204, 222, 0.7); }
.aap-atis-text {
  grid-column: 1 / -1;
  max-height: 150px;
  margin: 7px 0 0;
  overflow-y: auto;
  font-size: 11.5px;
  line-height: 1.45;
  color: rgba(226, 234, 244, 0.88);
}
.aap-atis.is-none .aap-letter { color: rgba(214, 224, 238, 0.3); }
.aap-atis.is-none .aap-atis-text { grid-column: 2; margin: 0; color: rgba(190, 204, 222, 0.6); }
.aap-atis.is-flipping .aap-letter { animation: aap-flip 260ms cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.aap-atis.is-flipping .aap-atis-meta,
.aap-atis.is-flipping .aap-atis-text { animation: aap-fade 250ms ease-out both 140ms; }

/* Phone: only the open positions, and the ATIS cut to two lines. */

html.airshow-mobile-runtime .airport-atc-pane { padding: 6px 9px 7px; font-size: 11px; }
html.airshow-mobile-runtime .airport-atc-pane > .aap-head,
html.airshow-mobile-runtime .aap-row.is-closed,
html.airshow-mobile-runtime .aap-sub { display: none; }
html.airshow-mobile-runtime .aap-caps { margin-top: 0; gap: 3px; }
html.airshow-mobile-runtime .aap-cap { height: 17px; font-size: 9px; }
html.airshow-mobile-runtime .aap-board { margin-top: 5px; padding: 1px 7px; }
html.airshow-mobile-runtime .aap-row { height: 18px; grid-template-columns: 66px 82px 1fr; }
html.airshow-mobile-runtime .aap-flap { width: 10px; height: 15px; font-size: 11px; }
html.airshow-mobile-runtime .aap-atis { grid-template-columns: 26px 1fr; column-gap: 7px; margin-top: 3px; }
html.airshow-mobile-runtime .aap-letter { width: 26px; height: 27px; font-size: 17px; }
html.airshow-mobile-runtime .aap-atis-meta { flex-direction: row; align-items: baseline; gap: 8px; }
html.airshow-mobile-runtime .aap-atis-text {
  margin-top: 4px;
  max-height: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 10.5px;
  line-height: 1.38;
  cursor: pointer;
}
html.airshow-mobile-runtime .aap-atis-text.is-open { display: block; }

@media (prefers-reduced-motion: reduce) {
  .aap-cap.is-lighting,
  .aap-row.is-flipping .aap-flap,
  .aap-row.is-flipping .aap-who,
  .aap-atis.is-flipping .aap-letter,
  .aap-atis.is-flipping .aap-atis-meta,
  .aap-atis.is-flipping .aap-atis-text { animation: none; }
  .aap-cap { transition: none; }
}
