/* Flightradar8 web – vzhľad podľa iOS aplikácie (Liquid Glass cez backdrop-filter). */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, 0.18);
  --accent: #007aff;
  --yellow: #fac220;
  --header: #2b2b2e;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.7);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f2f2f7;
    --muted: #98989f;
    --line: rgba(84, 84, 88, 0.6);
    --glass: rgba(40, 40, 44, 0.55);
    --glass-border: rgba(255, 255, 255, 0.14);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: var(--accent); text-decoration: none; }
svg { width: 1em; height: 1em; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.danger { color: #ff3b30 !important; }
.warning { color: #ff9500 !important; }
.footnote { color: var(--muted); font-size: 12px; margin: 8px 2px 0; }
#map { position: fixed; inset: 0; }

/* ---------- Sklo ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ---------- Horný pruh (pod Dynamic Islandom) ---------- */
#topbar { position: fixed; top: calc(var(--safe-top) + 8px); left: 0; right: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 64px; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pill { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px;
  font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: auto; }
.pill i { width: 1px; height: 13px; background: var(--line); }
.pill svg { font-size: 14px; }
#utc { font-weight: 600; }
.banner { padding: 6px 12px; border-radius: 999px; color: #fff; font-size: 12.5px; font-weight: 600;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow); pointer-events: auto; }
.banner.blue { background: rgba(0, 122, 255, 0.78); }
.banner.orange { background: rgba(255, 149, 0, 0.82); }

/* MapLibre ovládanie pod horným pruhom */
.maplibregl-ctrl-top-right { top: calc(var(--safe-top) + 52px); }
.maplibregl-ctrl-group { background: var(--glass) !important; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-radius: 12px !important; box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-bottom-left { bottom: calc(var(--safe-bottom) + 4px); }

/* ---------- Ovládacie tlačidlá ---------- */
#controls { position: fixed; right: 12px; bottom: calc(var(--safe-bottom) + 36px); z-index: 5; display: flex; flex-direction: column; gap: 10px; }
.control { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; color: var(--accent);
  transition: transform 0.15s ease; }
.control:active { transform: scale(0.92); }

/* ---------- Spodný panel (mobil) / bočný panel (počítač) ---------- */
.sheet { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; max-height: 46vh; overflow-y: auto;
  background: var(--bg); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
  padding-bottom: calc(var(--safe-bottom) + 10px); transition: max-height 0.25s ease; overscroll-behavior: contain; }
.sheet.expanded { max-height: calc(100vh - var(--safe-top) - 20px); }
.sheet-handle { display: flex; justify-content: center; width: 100%; padding: 7px 0 5px; position: sticky; top: 0; z-index: 2; background: transparent; }
.sheet-handle span { width: 40px; height: 5px; border-radius: 3px; background: rgba(128, 128, 128, 0.5); }
@media (min-width: 900px) {
  .sheet { top: calc(var(--safe-top) + 12px); left: 12px; right: auto; bottom: 12px; width: 410px; max-height: none;
    border-radius: 18px; box-shadow: var(--shadow); }
  .sheet-handle { display: none; }
  #topbar { padding-left: 440px; }
}

.card { background: var(--card); border-radius: 12px; padding: 12px; }
.card-row { display: grid; grid-template-columns: 1fr 150px; gap: 8px; margin: 8px 8px 0; }
.label { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.icon-button { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: rgba(0, 0, 0, 0.45); color: #fff; }

/* Detail lietadla – hlavička ako na Flightradar24 */
.ac-header { position: relative; display: flex; background: var(--header); color: #fff; margin-top: -24px; border-radius: 18px 18px 0 0; overflow: hidden; }
.ac-head-text { flex: 1; padding: 14px 12px; min-width: 0; }
.ac-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.callsign { font-size: 24px; font-weight: 900; color: var(--yellow); }
.badge { font-size: 14px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.25); }
.badge.type { background: #386b9e; }
.airline { font-weight: 600; margin-top: 6px; }
.emergency { display: inline-block; margin-top: 6px; background: #ff3b30; padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 700; }
.ac-photo { position: relative; width: 150px; min-height: 100px; background: rgba(0, 0, 0, 0.3); display: grid; place-items: center; color: rgba(255, 255, 255, 0.5); font-size: 26px; }
.ac-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.credit { position: absolute; left: 4px; bottom: 3px; font-size: 10.5px; font-weight: 600; color: #fff; text-shadow: 0 0 3px #000; }
.ac-header .close { position: absolute; top: 6px; right: 6px; }
@media (min-width: 900px) { .ac-header { margin-top: 0; } }

.route-row { display: flex; align-items: center; justify-content: space-between; }
.apt { text-align: center; min-width: 0; }
.apt .code { font-size: 28px; font-weight: 800; }
.apt .city { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.route-plane { width: 40px; height: 40px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
  display: grid; place-items: center; color: var(--yellow); font-size: 22px; }
.route-plane svg { transform: rotate(90deg); }
.progress { height: 6px; border-radius: 3px; background: rgba(128, 128, 128, 0.25); margin: 10px 0 8px; overflow: hidden; }
.progress div { height: 100%; background: var(--yellow); border-radius: 3px; }
.route-times { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); gap: 6px; }
.data-card .value { margin-bottom: 8px; font-size: 17px; }
.model-card .value, .reg-card .value { font-size: 16px; }
.more { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.info { background: var(--card); border-radius: 12px; padding: 12px; }
.info h3, .group h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; }
.row > span:first-child { color: var(--muted); }
.row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.link-row { display: block; background: var(--card); border-radius: 12px; padding: 12px; }

/* Detail letiska */
.apt-header { background: var(--header); color: #fff; padding: 14px 16px; margin-top: -24px; border-radius: 18px 18px 0 0; }
.apt-title { display: flex; justify-content: space-between; gap: 10px; }
.apt-title h2 { margin: 0; font-size: 20px; color: var(--yellow); }
.apt-codes { font-weight: 600; margin-top: 4px; }
.apt-info { font-size: 13.5px; opacity: 0.85; margin-top: 4px; }
.apt-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.apt-tabs { position: sticky; bottom: calc(-1 * var(--safe-bottom) - 10px); display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 0 calc(var(--safe-bottom) + 8px); background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%); border-top: 1px solid var(--line); }
.apt-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 18px; }
.apt-tabs span { font-size: 11px; }
.apt-tabs em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.apt-tabs button.active span { color: #ff9500; font-weight: 700; }
@media (min-width: 900px) { .apt-header { margin-top: 0; } .apt-tabs { bottom: -10px; } }
.card-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.text-button { color: var(--accent); display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.diagram-small { height: 220px; border-radius: 8px; overflow: hidden; position: relative; cursor: zoom-in; background: #fff; }
.diagram-stage { position: relative; width: 100%; height: 100%; overflow: hidden; touch-action: none; }
.diagram-stage canvas { display: block; }
.diagram-image { width: 100%; height: 100%; object-fit: contain; transform-origin: center; }
.diagram-credit { position: absolute; right: 6px; bottom: 4px; font-size: 10.5px; color: var(--muted); }
.diagram-loading, .diagram-empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; padding: 10px; }
.diagram-full { padding: 0 !important; display: flex; flex-direction: column; }
.diagram-full .diagram-stage { flex: 1; min-height: 60vh; background: #fff; }
.diagram-switch { margin: 8px 16px; }
.apt-photo { position: relative; height: 180px; border-radius: 12px; overflow: hidden; }
.apt-photo img { width: 100%; height: 100%; object-fit: cover; }
.weather { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 6px; }
.weather > div + div { border-left: 1px solid var(--line); }
.big { font-size: 28px; line-height: 1.3; }
.huge { font-size: 34px; font-weight: 600; }
.wind-arrow { display: inline-block; font-weight: 700; }
details.card summary { cursor: pointer; list-style: none; }
details.card summary::after { content: '›'; float: right; transition: transform 0.2s; color: var(--muted); }
details[open].card summary::after { transform: rotate(90deg); }
.metar { white-space: pre-wrap; font: 12.5px ui-monospace, Menlo, monospace; background: rgba(128, 128, 128, 0.12); padding: 8px; border-radius: 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 8px; }
.runway { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.runway span { color: var(--muted); font-size: 12.5px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.flight-row { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border-radius: 10px; padding: 12px; width: 100%; }
.flight-row .main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.flight-row .main small, .flight-row .side small { color: var(--muted); font-size: 12px; }
.flight-row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.flight-row .time { display: flex; flex-direction: column; width: 56px; font-size: 18px; font-variant-numeric: tabular-nums; }
.flight-row .dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(0, 0, 0, 0.6); flex: none; }
.badge-small { font-style: normal; font-size: 11px; font-weight: 600; background: rgba(0, 122, 255, 0.15); border-radius: 4px; padding: 0 5px; margin-left: 6px; }
.status { font-style: normal; color: #fff; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.struck { text-decoration: line-through; }

/* ---------- Prepínače, polia ---------- */
.segmented { display: flex; background: rgba(118, 118, 128, 0.18); border-radius: 9px; padding: 2px; gap: 2px; }
.segmented button { flex: 1; padding: 6px 8px; border-radius: 7px; font-size: 13px; font-weight: 500; }
.segmented button.active { background: var(--card); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; cursor: pointer; }
.toggle-row small { display: block; color: var(--muted); font-size: 12px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { width: 51px; height: 31px; border-radius: 16px; background: rgba(120, 120, 128, 0.32); position: relative; flex: none; transition: background 0.2s; }
.toggle-row i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.toggle-row input:checked + i { background: #34c759; }
.toggle-row input:checked + i::after { transform: translateX(20px); }
.field { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; }
.field select, .field input { font: inherit; color: var(--text); background: rgba(118, 118, 128, 0.12); border: 0; border-radius: 8px; padding: 7px 10px; max-width: 60%; }
.field input { flex: 1; }
/* Rozbaľovací zoznam: vlastné farby položiek, inak by v tmavom režime bol svetlý text na svetlom pozadí. */
.field select option { color: #1c1c1e; background: #ffffff; }
@media (prefers-color-scheme: dark) {
  .field select { color-scheme: dark; }
  .field select option { color: #f2f2f7; background: #2c2c2e; }
}
.slider { display: block; padding: 6px 0; }
.slider input { width: 100%; }

/* ---------- Modálne okná ---------- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.35); display: flex; align-items: flex-end; justify-content: center; }
.modal-sheet { width: 100%; max-width: 620px; height: calc(100vh - var(--safe-top) - 10px); background: var(--bg);
  border-radius: 16px 16px 0 0; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
.modal-sheet.wide { max-width: 1100px; }
@media (min-width: 900px) { .modal { align-items: center; } .modal-sheet { height: 88vh; border-radius: 16px; } }
.modal-header { display: grid; grid-template-columns: 70px 1fr 70px; align-items: center; padding: 12px 10px; border-bottom: 1px solid var(--line);
  background: var(--glass); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.modal-header h2 { margin: 0; font-size: 16px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-header .back { background: none; color: var(--accent); font-size: 20px; }
.modal-header .done { justify-self: end; font-weight: 600; }
.modal-content { flex: 1; overflow-y: auto; padding: 12px 14px calc(var(--safe-bottom) + 20px); }
.group { background: var(--card); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.nav-row, .check-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  padding: 10px 0; border-bottom: 1px solid var(--line); }
.nav-row:last-child, .check-row:last-child { border-bottom: 0; }
.nav-row b, .check-row b { display: block; font-weight: 500; }
.nav-row small, .check-row small { display: block; color: var(--muted); font-size: 12px; }
.check-row > span { flex: 1; min-width: 0; }
.check-row i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.check-row i.on { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--bg); }
.results h3 { margin: 16px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; }
.results .nav-row, .results .check-row { background: var(--card); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; border: 0; }
.search { width: 100%; font: inherit; color: var(--text); padding: 10px 12px; border-radius: 10px; border: 0; background: rgba(118, 118, 128, 0.14); }
.pill-badge { font-style: normal; color: #fff; background: var(--accent); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.live { font-style: normal; color: #34c759; font-size: 13px; }
.legend { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 14px; }
.sil { flex: none; }
.model-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.model-header h2 { margin: 0; font-size: 19px; }
.wiki-image { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin-bottom: 14px; }
.step { display: flex; gap: 12px; padding: 8px 0; }
.step > b { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.step p { margin: 2px 0 4px; color: var(--muted); font-size: 14px; }
.signature { text-align: center; font-weight: 700; margin: 14px 0 0; }
.ok { color: #34c759 !important; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(128, 128, 128, 0.35); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
