/* Flight Wall v1 — a full-screen live aviation display.
   Dark "wall" styling: near-black background, amber callsigns, white metrics.
   No external fonts or libraries, so the wall works on any TV / tablet / phone browser. */

:root {
  --bg: #04070b;
  --panel: #0a121d;
  --panel-edge: #1b2a3d;
  --text: #f2f6fa;
  --dim: #8fa5bb;
  --amber: #ffb000;
  --cyan: #3fd2ff;
  --green: #4ade80;
  --red: #fb7185;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 2px solid var(--panel-edge);
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand-plane {
  color: var(--amber);
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1;
  transform: rotate(45deg);
  display: inline-block;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: clamp(17px, 2.4vw, 28px);
}

.topbar-centre { flex: 1; text-align: center; min-width: 0; }

.place-label {
  font-size: clamp(15px, 2vw, 24px);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-line { color: var(--dim); font-size: clamp(11px, 1.4vw, 15px); margin-top: 2px; }

.topbar-right { display: flex; align-items: center; gap: 14px; white-space: nowrap; }

.clock {
  font-variant-numeric: tabular-nums;
  font-size: clamp(16px, 2.2vw, 27px);
  font-weight: 700;
  color: var(--cyan);
}

/* ---------- Wall rows ---------- */

.wall {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  min-height: 0;
}

.rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.flight-row {
  flex: 1 1 0;
  min-height: 86px;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-left: 6px solid var(--amber);
  border-radius: 10px;
  padding: 10px 18px;
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) repeat(5, minmax(96px, 1fr));
  align-items: center;
  gap: 8px 18px;
}

.flight-row.not-found { border-left-color: var(--panel-edge); opacity: 0.65; }

.callsign-block { min-width: 0; }

.callsign {
  color: var(--amber);
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: clamp(26px, 3.6vw, 50px);
  line-height: 1.05;
  white-space: nowrap;
}

.operator {
  color: var(--text);
  font-size: clamp(12px, 1.5vw, 18px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aircraft {
  color: var(--dim);
  font-size: clamp(11px, 1.3vw, 16px);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric { min-width: 0; }

.metric-label {
  color: var(--dim);
  font-size: clamp(10px, 1.1vw, 14px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.metric-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: clamp(20px, 2.7vw, 38px);
  line-height: 1.15;
  white-space: nowrap;
}

.metric-unit { color: var(--dim); font-size: 0.52em; font-weight: 600; margin-left: 4px; }

.vs-up { color: var(--green); }
.vs-down { color: var(--red); }

/* ---------- Empty / location states ---------- */

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 24px;
}

.empty-title { font-size: clamp(26px, 4vw, 46px); font-weight: 800; color: var(--cyan); }
.empty-sub { color: var(--dim); font-size: clamp(14px, 2vw, 21px); max-width: 720px; }
.empty-nearest { color: var(--amber); font-size: clamp(15px, 2.2vw, 24px); font-weight: 700; margin-top: 8px; }

/* ---------- Bottom bar ---------- */

.bottombar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 18px;
  border-top: 1px solid var(--panel-edge);
  color: var(--dim);
  font-size: clamp(11px, 1.3vw, 14px);
}

.more-strip { color: var(--amber); font-weight: 700; }
.credit { margin-left: auto; text-align: right; }

/* ---------- Buttons / dialog ---------- */

.btn {
  background: #122236;
  color: var(--text);
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover { border-color: var(--cyan); }
.btn-primary { background: var(--amber); border-color: var(--amber); color: #161006; }
.btn-ghost { background: transparent; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 9, 0.82);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 22px 12px;
  z-index: 50;
}

.overlay[hidden] { display: none; }

.dialog {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  max-width: 620px;
  width: 100%;
  padding: 20px 22px;
}

.dialog h2 { margin: 0 0 6px; font-size: 22px; }
.dialog-note { color: var(--dim); font-size: 13.5px; margin: 6px 0; }
#settingsNote { color: var(--amber); }

.field { border: 1px solid var(--panel-edge); border-radius: 10px; margin: 14px 0; padding: 12px 14px; }
.field legend { color: var(--cyan); font-weight: 700; padding: 0 6px; }
.radio-row { display: block; padding: 5px 0; font-size: 15.5px; cursor: pointer; }

.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.preset-chip {
  background: #122236;
  border: 1px solid var(--panel-edge);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 14px;
  cursor: pointer;
}
.preset-chip:hover, .preset-chip.active { border-color: var(--amber); color: var(--amber); }

.latlon-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
.latlon-row label, .select-row, .track-label { font-size: 14.5px; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.track-label { flex-direction: column; align-items: stretch; }

input[type="number"], input[type="text"], select {
  background: #060b12;
  border: 1px solid var(--panel-edge);
  border-radius: 7px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 15.5px;
  width: 130px;
}
input[type="text"] { width: 100%; }
select { width: auto; }

.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .topbar-centre { order: 3; flex-basis: 100%; text-align: left; }
  .clock { display: none; }

  .flight-row {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
    padding: 10px 12px;
    gap: 6px 12px;
  }
  .callsign-block { grid-column: 1 / -1; }
  .callsign { font-size: 30px; }
  .metric-value { font-size: 19px; }

  .bottombar { flex-wrap: wrap; }
  .credit { margin-left: 0; text-align: left; }
}
