/* JANX — Light Theme — Auto-Scaling */
:root { --scale: 1; }
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #f2f4f7;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #1a1e2e;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

/* ── Page Container ─────────────────────────────────────────────── */
#app {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
}

.page-container {
  position: absolute;
  top: calc(138px * var(--scale)); left: calc(96px * var(--scale)); right: calc(202px * var(--scale));
  bottom: calc(36px * var(--scale));
  width: auto; height: auto;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  contain: layout style paint;
}
.page-container.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

/* ── Persistent Top Banner ──────────────────────────────────────── */
#top-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(138px * var(--scale));
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(28px * var(--scale));
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  pointer-events: none;
}
#banner-left {
  flex: 0 0 auto;
}
#banner-logo {
  font-size: calc(36px * var(--scale));
  font-weight: 300;
  letter-spacing: calc(6px * var(--scale));
  text-transform: uppercase;
  color: #2a6cb8;
}
#banner-url {
  font-size: calc(10px * var(--scale));
  font-weight: 300;
  color: #b0bec5;
  letter-spacing: calc(1px * var(--scale));
  margin-top: calc(2px * var(--scale));
}
#banner-coords {
  font-size: calc(10px * var(--scale));
  font-weight: 300;
  color: #b0bec5;
  letter-spacing: calc(1px * var(--scale));
  margin-top: calc(1px * var(--scale));
}
#banner-featured {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(14px * var(--scale));
  min-width: 0;
}
#featured-photo-wrap {
  flex-shrink: 0;
  width: calc(202px * var(--scale));
  height: calc(129px * var(--scale));
  border-radius: calc(6px * var(--scale));
  overflow: hidden;
  background: rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}
#featured-photo-wrap img {
  width: calc(202px * var(--scale));
  height: calc(129px * var(--scale));
  object-fit: cover;
}
#featured-info {
  min-width: 0;
}
#featured-line1 {
  display: flex;
  align-items: baseline;
  gap: calc(10px * var(--scale));
  white-space: nowrap;
}
#featured-callsign {
  font-size: calc(20px * var(--scale));
  font-weight: 600;
  color: #1a1e2e;
  letter-spacing: calc(1px * var(--scale));
}
#featured-airline {
  font-size: calc(13px * var(--scale));
  color: #5a6a7e;
}
#featured-type {
  font-size: calc(13px * var(--scale));
  color: #2a6cb8;
  font-weight: 500;
}
#featured-line1b {
  white-space: nowrap;
  margin-top: calc(1px * var(--scale));
}
#featured-engine {
  font-size: calc(11px * var(--scale));
  color: #6b7a8d;
  letter-spacing: calc(0.5px * var(--scale));
}
#featured-line1c {
  white-space: nowrap;
  margin-top: calc(1px * var(--scale));
}
#featured-lifecycle {
  font-size: calc(11px * var(--scale));
  color: #6b7a8d;
  letter-spacing: calc(0.5px * var(--scale));
}
#featured-line2 {
  display: flex;
  align-items: center;
  gap: calc(6px * var(--scale));
  white-space: nowrap;
  margin-top: calc(2px * var(--scale));
}
.feat-stat {
  font-size: calc(15px * var(--scale));
  font-weight: 500;
  color: #1a1e2e;
  font-variant-numeric: tabular-nums;
  min-width: calc(70px * var(--scale));
}
.feat-sep {
  color: #ccc;
  font-size: calc(14px * var(--scale));
}
#banner-minimap {
  flex-shrink: 0;
  width: calc(120px * var(--scale));
  height: calc(105px * var(--scale));
  border-radius: calc(6px * var(--scale));
  overflow: hidden;
  border: 1px solid rgba(42, 108, 184, 0.15);
  pointer-events: none;
}
#banner-minimap .leaflet-container {
  background: #f2f4f7 !important;
}
#banner-right {
  flex: 0 0 auto;
  text-align: right;
}
#banner-right .count {
  font-size: calc(40px * var(--scale));
  font-weight: 200;
  color: #2a6cb8;
  line-height: 1;
}
#banner-right .label {
  font-size: calc(11px * var(--scale));
  font-weight: 300;
  letter-spacing: calc(3px * var(--scale));
  text-transform: uppercase;
  color: #2a6cb8;
  opacity: 0.6;
}
#branding-bottom {
  position: fixed;
  bottom: calc(12px * var(--scale)); right: calc(20px * var(--scale));
  z-index: 100;
  font-size: calc(11px * var(--scale));
  letter-spacing: calc(2px * var(--scale));
  text-transform: uppercase;
  color: #2a6cb8;
  opacity: 0.3;
  pointer-events: none;
}

/* ── QR Code (inline in banner) ────────────────────────────────── */
#qr-code {
  opacity: 0.3;
  pointer-events: none;
  flex-shrink: 0;
}

/* ── Page Progress Dots ─────────────────────────────────────────── */
#page-dots {
  position: fixed;
  bottom: calc(16px * var(--scale)); left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: calc(8px * var(--scale));
  pointer-events: none;
}
.page-dot {
  width: calc(6px * var(--scale)); height: calc(6px * var(--scale));
  border-radius: 50%;
  background: rgba(42, 108, 184, 0.2);
  /* no transition — instant dot update */
}
.page-dot.active {
  background: rgba(42, 108, 184, 0.7);
  transform: scale(1.4);
}

/* ── Mini-Map Overlay ───────────────────────────────────────────── */
#mini-map-overlay {
  position: fixed;
  bottom: calc(40px * var(--scale)); right: calc(20px * var(--scale));
  width: calc(200px * var(--scale)); height: calc(150px * var(--scale));
  z-index: 90;
  border-radius: calc(8px * var(--scale));
  overflow: hidden;
  border: 1px solid rgba(42, 108, 184, 0.2);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  opacity: 0.9;
  pointer-events: none;
}
#mini-map-overlay.hidden { opacity: 0; }
#mini-map-overlay .leaflet-container {
  background: #f2f4f7 !important;
}

/* ── Altitude Gauge (winds aloft) ──────────────────────────────── */
#altitude-gauge {
  position: fixed;
  left: 0;
  top: calc(139px * var(--scale));
  bottom: calc(2px * var(--scale));
  width: calc(94px * var(--scale));
  z-index: 90;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(10px * var(--scale)) calc(6px * var(--scale));
  border-right: 1px solid rgba(42, 108, 184, 0.15);
  background: rgba(255,255,255,0.5);
  opacity: 0.9;
  overflow: hidden;
}
#altitude-gauge.hidden { opacity: 0; }
.ag-header {
  text-align: center;
  font-size: calc(8px * var(--scale));
  font-weight: 600;
  color: rgba(42, 108, 184, 0.6);
  line-height: 1.3;
  margin-bottom: calc(2px * var(--scale));
  flex-shrink: 0;
}
.ag-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.ag-alt {
  font-size: calc(11px * var(--scale));
  font-weight: 600;
  color: #2a6cb8;
  letter-spacing: calc(0.5px * var(--scale));
}
.ag-temp {
  font-size: calc(9px * var(--scale));
  color: #5a6a7e;
}
.ag-wind {
  font-size: calc(9px * var(--scale));
  color: #6b7a8d;
  display: flex;
  align-items: center;
  gap: calc(1px * var(--scale));
}
.ag-wind-arrow {
  display: inline-block;
  font-size: calc(10px * var(--scale));
  line-height: 1;
}

/* ── Right Stats Panel ──────────────────────────────────────────── */
#right-stats {
  position: fixed;
  right: 0;
  top: calc(139px * var(--scale));
  bottom: calc(200px * var(--scale));
  width: calc(200px * var(--scale));
  z-index: 90;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(8px * var(--scale)) calc(6px * var(--scale));
  border-left: 1px solid rgba(42, 108, 184, 0.15);
  background: rgba(255,255,255,0.5);
  opacity: 0.9;
}
#right-stats.hidden { opacity: 0; }
.rs-section {
  text-align: center;
}
.rs-label {
  font-size: calc(18px * var(--scale));
  font-weight: 600;
  color: #2a6cb8;
  letter-spacing: calc(0.5px * var(--scale));
  text-transform: uppercase;
  margin-bottom: calc(2px * var(--scale));
}
.rs-value {
  font-size: calc(24px * var(--scale));
  font-weight: 500;
  color: #1a1e2e;
  line-height: 1.2;
}
.rs-detail {
  font-size: calc(20px * var(--scale));
  color: #6b7a8d;
  line-height: 1.2;
}
.rs-divider {
  height: 1px;
  background: rgba(42, 108, 184, 0.1);
  margin: calc(3px * var(--scale)) 0;
}

/* ── Page Title Headers ─────────────────────────────────────────── */
.page-title {
  font-size: calc(28px * var(--scale));
  font-weight: 200;
  color: #1a1e2e;
  letter-spacing: calc(2px * var(--scale));
  text-transform: uppercase;
  margin-bottom: calc(24px * var(--scale));
}
.page-subtitle {
  font-size: calc(14px * var(--scale));
  font-weight: 300;
  color: #6b7a8d;
  letter-spacing: calc(1px * var(--scale));
  text-transform: uppercase;
}

/* ── Stat Cards ─────────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: calc(12px * var(--scale));
  padding: calc(24px * var(--scale));
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.stat-value {
  font-size: calc(48px * var(--scale));
  font-weight: 200;
  color: #2a6cb8;
  line-height: 1.1;
}
.stat-label {
  font-size: calc(13px * var(--scale));
  font-weight: 300;
  color: #6b7a8d;
  letter-spacing: calc(2px * var(--scale));
  text-transform: uppercase;
  margin-top: calc(4px * var(--scale));
}
.stat-detail {
  font-size: calc(15px * var(--scale));
  color: #5a6a7e;
  margin-top: calc(8px * var(--scale));
}

/* ── Arrivals Board ─────────────────────────────────────────────── */
.arrivals-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Courier New', 'Consolas', monospace;
}
.arrivals-table th {
  font-size: calc(13px * var(--scale));
  font-weight: 600;
  color: #2a6cb8;
  text-transform: uppercase;
  letter-spacing: calc(2px * var(--scale));
  padding: calc(8px * var(--scale)) calc(12px * var(--scale));
  text-align: left;
  border-bottom: 2px solid rgba(42, 108, 184, 0.15);
}
.arrivals-table td {
  font-size: calc(18px * var(--scale));
  padding: calc(6px * var(--scale)) calc(12px * var(--scale));
  color: #1a1e2e;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}
.arrivals-table tr {
}

/* ── Bar Charts ─────────────────────────────────────────────────── */
.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: calc(8px * var(--scale));
  gap: calc(12px * var(--scale));
}
.bar-label {
  flex: 0 0 calc(140px * var(--scale));
  font-size: calc(15px * var(--scale));
  color: #3a4a5e;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  flex: 1;
  height: calc(28px * var(--scale));
  background: rgba(0, 0, 0, 0.03);
  border-radius: calc(4px * var(--scale));
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: calc(4px * var(--scale));
  /* no transition — bars render at final width instantly */
  min-width: 2px;
}
.bar-value {
  flex: 0 0 calc(50px * var(--scale));
  font-size: calc(15px * var(--scale));
  color: #5a6a7e;
  text-align: right;
}

/* ── Ticker ─────────────────────────────────────────────────────── */
.ticker-row {
  display: flex;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  padding: calc(8px * var(--scale)) calc(20px * var(--scale));
  margin: calc(4px * var(--scale)) calc(8px * var(--scale));
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: calc(6px * var(--scale));
  font-size: calc(18px * var(--scale));
  color: #1a1e2e;
  gap: calc(8px * var(--scale));
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ticker-item .dot {
  width: calc(8px * var(--scale)); height: calc(8px * var(--scale));
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Trivia Card ────────────────────────────────────────────────── */
.trivia-card {
  max-width: calc(900px * var(--scale));
  margin: 0 auto;
  text-align: center;
  padding: calc(80px * var(--scale)) calc(60px * var(--scale));
}
.trivia-text {
  font-size: calc(36px * var(--scale));
  font-weight: 300;
  line-height: 1.5;
  color: #1a1e2e;
}
.trivia-label {
  font-size: calc(14px * var(--scale));
  color: #2a6cb8;
  letter-spacing: calc(4px * var(--scale));
  text-transform: uppercase;
  margin-bottom: calc(40px * var(--scale));
}

/* ── Donut Chart ────────────────────────────────────────────────── */
.donut-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(60px * var(--scale));
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: calc(12px * var(--scale));
}
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: calc(10px * var(--scale));
  font-size: calc(18px * var(--scale));
  color: #3a4a5e;
}
.donut-legend-swatch {
  width: calc(14px * var(--scale)); height: calc(14px * var(--scale));
  border-radius: calc(3px * var(--scale));
  flex-shrink: 0;
}

/* ── Leaflet Overrides (light theme) ────────────────────────────── */
.leaflet-container {
  background: #f2f4f7 !important;
  font-family: inherit !important;
}
.leaflet-control-zoom,
.leaflet-control-attribution {
  display: none !important;
}

/* ── Setup Mode ─────────────────────────────────────────────────── */
.setup-panel {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: calc(12px * var(--scale));
  padding: calc(20px * var(--scale));
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.setup-label {
  font-size: calc(12px * var(--scale));
  color: #6b7a8d;
  letter-spacing: calc(2px * var(--scale));
  text-transform: uppercase;
  margin-bottom: calc(8px * var(--scale));
}
.rssi-good { color: #22a355; }
.rssi-fair { color: #c89b1d; }
.rssi-poor { color: #d93636; }

/* ── Portrait Overrides ────────────────────────────────────────── */
html[data-orient="portrait"] #banner-featured { flex-direction: column; gap: calc(6px * var(--scale)); }
html[data-orient="portrait"] #featured-photo-wrap { width: calc(138px * var(--scale)); height: calc(87px * var(--scale)); }
html[data-orient="portrait"] #featured-photo-wrap img { width: calc(138px * var(--scale)); height: calc(87px * var(--scale)); }

/* ── Scrollbar hide ─────────────────────────────────────────────── */
::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }
