/* ═══════════════════════════════════════════════════════════════
   PROFESSIONAL THEME — Dark Default + Light Mode Override
   Shared CSS for all pages
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg-primary:    #0f1117;
  --bg-secondary:  #161821;
  --bg-card:       #1c1e2a;
  --bg-card-alt:   #22253a;
  --bg-card-hover: #282c42;
  --bg-metric:     rgba(255, 255, 255, 0.03);
  --border-color:  #2a2e3f;
  --border-hover:  #3a3f55;
  --text-primary:  #e8eaed;
  --text-secondary:#a1a7b4;
  --text-muted:    #6b7280;
  --text-dim:      #4d5463;
  --accent:        #5b7bf7;
  --accent-hover:  #4568e0;
  --accent-subtle: rgba(91, 123, 247, 0.12);
  --accent-glow:   rgba(91, 123, 247, 0.2);
  --accent-green:  #3dbb78;
  --accent-amber:  #e5a12e;
  --accent-red:    #e05555;
  --accent-purple: #9278e0;
  --accent-cyan:   #35b4c9;
  --border-glow:   #3a3f55;
  --alert-bg:      rgba(229, 161, 46, 0.08);
  --alert-border:  rgba(229, 161, 46, 0.3);
  --alert-text:    #e5a12e;
  --alert-glow:    rgba(229, 161, 46, 0.15);
  --completed-dot: #3dbb78;
  --upcoming-dot:  #2a2e3f;
  --ring-size:     clamp(9rem, 20vmin, 20rem);
  --bar-height:    3.2vh;
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     14px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:     0 2px 8px rgba(0,0,0,0.35);
  --shadow-lg:     0 4px 16px rgba(0,0,0,0.4);
  --transition:    0.2s ease;
}

*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Background — clean subtle gradient, no animated orbs ── */
.bg-mesh,
.bg-mesh::before,
.bg-mesh::after,
.bg-orb,
.bg-orb-1,
.bg-orb-2,
.bg-orb2 {
  display: none !important;
}
.scanlines {
  display: none !important;
}

/* ── Top Bar ── */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8vh 2vw;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}
.top-bar-left { display: flex; align-items: center; gap: 1vw; }
.top-bar-right { display: flex; align-items: center; gap: 1.2vw; }

.back-link {
  font-size: clamp(0.7rem, 1.2vmin, 1.1rem);
  color: var(--text-muted); text-decoration: none;
  padding: 0.3vh 0.6vw;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  letter-spacing: 0.05vw;
}
.back-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.page-title {
  font-size: clamp(1.2rem, 2.5vmin, 2.5rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.05vw;
}

.page-title-group { display: flex; align-items: baseline; gap: 0.6vw; }
.page-icao {
  font-size: clamp(2rem, 4vmin, 4rem);
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.08vw;
}
.page-airport-name {
  font-size: clamp(0.8rem, 1.4vmin, 1.3rem);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.2vw;
  font-weight: 600;
}

.obs-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.7rem, 1.2vmin, 1.1rem);
  color: var(--text-dim);
  padding: 0.25vh 0.6vw;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.status-dot {
  width: clamp(0.6rem, 1.1vmin, 1rem);
  height: clamp(0.6rem, 1.1vmin, 1rem);
  border-radius: 50%;
  background: var(--accent-green);
}
.status-dot.error { background: var(--accent-red); }

.date-display {
  font-size: clamp(0.75rem, 1.3vmin, 1.2rem);
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.1vw;
}

.live-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.9rem, 1.6vmin, 1.5rem);
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Glass Card → Clean Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5vh 1.2vw;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: cardIn 0.4s ease-out both;
}
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.10s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.20s; }
.card.full-width { grid-column: 1 / -1; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1vh;
  padding-bottom: 0.6vh;
  border-bottom: 1px solid var(--border-color);
}
.card-title {
  font-size: clamp(0.8rem, 1.3vmin, 1.2rem);
  text-transform: uppercase;
  letter-spacing: 0.2vw;
  color: var(--text-muted);
  font-weight: 700;
}
.card-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.6rem, 1vmin, 0.9rem);
  color: var(--text-dim);
}

/* ── Section Card (Countdowns etc) ── */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5vh 1.2vw;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  position: relative;
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-md);
  animation: cardIn 0.4s ease-out both;
}
.section-card:nth-child(2) { animation-delay: 0.08s; }

/* ── Flight Category Badges (dark default) ── */
.cat-vfr  { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.2); }
.cat-mvfr { background: rgba(96,165,250,0.12); color: #60a5fa; border: 1px solid rgba(96,165,250,0.2); }
.cat-ifr  { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }
.cat-lifr { background: rgba(192,132,252,0.12); color: #c084fc; border: 1px solid rgba(192,132,252,0.2); }

.wx-ok    { color: var(--text-muted); }
.wx-stale { color: var(--accent-amber); }

/* ── Metric Value Color Coding (dark default) ── */
.val-green  { color: #3dbb78; }
.val-yellow { color: #fbbf24; }
.val-amber  { color: #f59e0b; }
.val-red    { color: #f87171; }

/* ── Light Mode Overrides ── */
body.light-mode .cat-vfr  { background: rgba(22,163,74,0.08); color: #15803d; border-color: rgba(22,163,74,0.2); }
body.light-mode .cat-mvfr { background: rgba(79,107,237,0.08); color: #3b5bdb; border-color: rgba(79,107,237,0.2); }
body.light-mode .cat-ifr  { background: rgba(220,38,38,0.08); color: #dc2626; border-color: rgba(220,38,38,0.2); }
body.light-mode .cat-lifr { background: rgba(124,58,237,0.08); color: #7c3aed; border-color: rgba(124,58,237,0.2); }
body.light-mode .val-green  { color: #16a34a; }
body.light-mode .val-yellow { color: #ca8a04; }
body.light-mode .val-amber  { color: #d97706; }
body.light-mode .val-red    { color: #dc2626; }

/* ── Bottom Bar ── */
.bottom-bar {
  position: fixed; bottom: 0; left: 0;
  width: 100vw; height: var(--bar-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex; justify-content: space-between;
  align-items: center;
  padding: 0 1.5vw;
  font-size: clamp(0.75rem, 1.4vmin, 1.3rem);
  color: var(--text-dim); z-index: 10;
}
.bottom-bar-title {
  letter-spacing: 0.15vw; font-weight: 700;
  color: var(--text-muted);
  font-size: clamp(0.85rem, 1.6vmin, 1.5rem);
}
.bottom-bar-center {
  display: flex; gap: 1.5vw; align-items: center;
  font-size: clamp(0.8rem, 1.5vmin, 1.4rem);
}
.clock {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(1rem, 1.8vmin, 1.7rem);
}

/* ── Alert Buttons ── */
.alert-btns { display: flex; gap: 0.3vw; align-items: center; }
.alert-btn {
  text-decoration: none;
  font-size: clamp(0.7rem, 1.2vmin, 1.1rem);
  padding: 0.2vh 0.35vw;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card-alt);
  color: var(--text-dim);
  line-height: 1;
  transition: all var(--transition);
  cursor: pointer;
}
.alert-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

/* ── Settings Button ── */
.settings-btn {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: clamp(0.9rem, 1.6vmin, 1.5rem);
  padding: 0.3vh 0.6vw;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; gap: 0.3vw;
  letter-spacing: 0.05vw;
}
.settings-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-subtle);
}
.settings-btn .gear-icon {
  display: inline-block;
  transition: transform 0.4s ease;
}
.settings-btn:hover .gear-icon {
  transform: rotate(90deg);
}

/* ── Settings Modal ── */
.settings-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
body.light-mode .settings-overlay {
  background: rgba(0,0,0,0.25);
}
.settings-overlay.open {
  opacity: 1; pointer-events: all;
}
.settings-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3vh 2.5vw;
  width: min(90vw, 600px);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  transform: scale(0.95) translateY(12px);
  transition: transform 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(128,128,128,0.2) transparent;
}
.settings-overlay.open .settings-modal {
  transform: scale(1) translateY(0);
}
.settings-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2.5vh;
  padding-bottom: 1.5vh;
  border-bottom: 1px solid var(--border-color);
}
.settings-modal-title {
  font-size: clamp(1.2rem, 2.2vmin, 2rem);
  font-weight: 800; color: var(--accent);
  letter-spacing: 0.08vw;
}
.settings-close-btn {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: clamp(1rem, 1.6vmin, 1.5rem);
  padding: 0.3vh 0.6vw;
  cursor: pointer;
  transition: all var(--transition);
}
.settings-close-btn:hover {
  color: var(--accent-red);
  border-color: rgba(220,38,38,0.3);
  background: rgba(220,38,38,0.08);
}
.settings-section { margin-bottom: 2.5vh; }
.settings-section-title {
  font-size: clamp(0.85rem, 1.4vmin, 1.3rem);
  text-transform: uppercase; letter-spacing: 0.2vw;
  color: var(--text-muted); font-weight: 700;
  margin-bottom: 1.2vh;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1vh 1vw;
}
.theme-card {
  background: var(--bg-card-alt);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5vh 1vw;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.theme-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}
.theme-card.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
}
.theme-preview {
  width: 100%; height: clamp(2rem, 4vmin, 3.5rem);
  border-radius: var(--radius-sm); margin-bottom: 0.8vh;
  position: relative; overflow: hidden;
}
.theme-name {
  font-size: clamp(0.7rem, 1.2vmin, 1.1rem);
  font-weight: 700; color: var(--text-primary);
  margin-bottom: 0.2vh;
}
.theme-desc {
  font-size: clamp(0.55rem, 0.9vmin, 0.85rem);
  color: var(--text-dim);
}
.settings-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1vh 0;
  border-bottom: 1px solid var(--border-color);
}
.settings-option:last-child { border-bottom: none; }
.settings-option-label {
  font-size: clamp(0.8rem, 1.3vmin, 1.2rem);
  color: var(--text-secondary);
}
.settings-option-desc {
  font-size: clamp(0.55rem, 0.9vmin, 0.85rem);
  color: var(--text-dim); margin-top: 0.2vh;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: clamp(2.5rem, 4vmin, 3.5rem);
  height: clamp(1.3rem, 2.2vmin, 2rem);
  background: var(--bg-card-hover);
  border-radius: 2rem;
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid var(--border-color);
}
.toggle-switch.on {
  background: var(--accent);
  border-color: var(--accent-hover);
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: calc(clamp(1.3rem, 2.2vmin, 2rem) - 6px);
  height: calc(clamp(1.3rem, 2.2vmin, 2rem) - 6px);
  background: #ffffff;
  border-radius: 50%;
  transition: all var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.toggle-switch.on::after {
  left: calc(100% - clamp(1.3rem, 2.2vmin, 2rem) + 4px);
  background: #ffffff;
}

/* Settings Select */
.settings-select {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.65rem, 1.1vmin, 1rem);
  padding: 0.4vh 0.6vw;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5vw center;
  padding-right: 1.5vw;
}
.settings-select:focus {
  border-color: var(--accent);
}
.settings-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* Settings Range */
.settings-range-wrap {
  display: flex; align-items: center; gap: 0.5vw;
}
.settings-range-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.6rem, 1vmin, 0.9rem);
  color: var(--accent); min-width: 2.5em; text-align: center;
}
.settings-range {
  -webkit-appearance: none; appearance: none;
  width: clamp(5rem, 10vmin, 8rem);
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.settings-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: clamp(0.8rem, 1.4vmin, 1.2rem);
  height: clamp(0.8rem, 1.4vmin, 1.2rem);
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}
.settings-range::-moz-range-thumb {
  width: clamp(0.8rem, 1.4vmin, 1.2rem);
  height: clamp(0.8rem, 1.4vmin, 1.2rem);
  background: var(--accent);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

/* ── Disable futuristic body classes ── */
body.no-hover .airport-card:hover {
  background: var(--bg-card-alt);
  border-color: var(--border-color);
  box-shadow: none;
  transform: none;
}
body.no-color-code .val-green,
body.no-color-code .val-amber,
body.no-color-code .val-red {
  color: var(--text-primary) !important;
}
body.no-cat-accent .airport-card::before {
  display: none !important;
}

/* ── Scrollbar Styling ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }
body.light-mode ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* ── Theme Group Label ── */
.theme-group-label {
  grid-column: 1 / -1;
  font-size: clamp(0.6rem, 1vmin, 0.85rem);
  text-transform: uppercase;
  letter-spacing: 0.15vw;
  color: var(--text-dim);
  font-weight: 700;
  padding: 0.5vh 0 0.2vh;
}
