/* window-views.css — window views, cockpit frame, HUD, controls, labels, Cesium.
   From concept/live-air-traffic.html (lines 401–527). Linked from index.html in a fixed
   order that keeps the cascade identical to the concept. */
/* Window views */
.winview { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #EEF0F3 0%, #CDD2D9 55%, #A8AFB9 100%); }
.winview[hidden] { display: none; }
.wv-frame { position: relative; overflow: hidden; background: #8FB6E8; }
#wv-map { position: absolute; inset: 0; }
.wv-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.45); background: linear-gradient(130deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 35%); }
.wv-post, .wv-tailcam, .wv-dashboard { display: none; }
/* Cabin window */
.winview[data-frame="window"] .wv-frame { width: min(48vh, 78vw); height: min(66vh, 106vw); margin-bottom: 9vh; border-radius: 44% / 31%;
  box-shadow: 0 0 0 16px #DEE2E7, 0 0 0 18px #B5BCC6, 0 0 0 46px #ECEFF2, 0 0 0 48px #C3C9D1, 0 30px 70px rgba(0, 0, 0, 0.35); }
/* Cockpit: full-screen outside view with the flight deck drawn over it */
.ck-wrap { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ck-wrap[hidden] { display: none; }
.ck-wrap svg { width: 100%; height: 100%; display: block; }
/* (No CSS transitions on rotating instruments: they would swing around the wrong pivot mid-turn.) */
.winview[data-frame="deck"] { background: #15181C; }
.winview[data-frame="deck"] .wv-frame { position: absolute; inset: 0; }
.winview[data-frame="deck"] .wv-frame::after { display: none; }
.winview[data-frame="deck"] .wv-bar { bottom: auto; top: calc(14px + env(safe-area-inset-top, 0px)); }
.winview[data-frame="deck"] .wv-hud { top: calc(80px + env(safe-area-inset-top, 0px)); }
.winview[data-frame="deck"] .wv-attrib { bottom: auto; top: calc(124px + env(safe-area-inset-top, 0px)); }
.winview[data-frame="deck"] /* Wing outside the cabin window */
.wv-wing { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46%; z-index: 2; display: none; pointer-events: none; filter: drop-shadow(0 -2px 6px rgba(0, 0, 0, 0.25)); }
.winview[data-seat="wing"][data-side="left"] .wv-wing { display: block; }
.winview[data-seat="wing"][data-side="right"] .wv-wing { display: block; transform: scaleX(-1); }
.winview[data-light="night"] .wv-wing { filter: brightness(0.3); }
/* With the window removed, keep the wing its natural shape, near the fuselage side of the view. */
.winview[data-frame="none"] .wv-wing { width: 62%; height: 38%; }
.winview[data-frame="none"][data-side="left"] .wv-wing { left: auto; right: 0; }
.winview[data-frame="none"][data-side="right"] .wv-wing { left: 0; right: auto; }
.wv-seat { font: inherit; font-size: 12px; background: #101C30; color: var(--text); border: 1px solid var(--edge); border-radius: 6px; padding: 3px 4px; }
/* Window size by aircraft: bigger on the 787 and A220/A350, smaller on regional jets */
.winview[data-family="b787"][data-frame="window"] .wv-frame { width: min(56vh, 82vw); height: min(72vh, 110vw); border-radius: 46% / 32%; }
.winview[data-family="a220"][data-frame="window"] .wv-frame, .winview[data-family="airbuswide"][data-frame="window"] .wv-frame, .winview[data-family="a350"][data-frame="window"] .wv-frame { width: min(52vh, 80vw); height: min(68vh, 108vw); }
.winview[data-family="crj"][data-frame="window"] .wv-frame, .winview[data-family="ejet"][data-frame="window"] .wv-frame { width: min(42vh, 72vw); height: min(56vh, 96vw); }
.winview[data-family="airbus"][data-frame="window"] .wv-frame { border-radius: 42% / 28%; }
/* Light aircraft and business jets: smaller, squarer windows */
.winview[data-family="ga"][data-frame="window"] .wv-frame, .winview[data-family="gaglass"][data-frame="window"] .wv-frame { width: min(60vh, 86vw); height: min(52vh, 80vw); border-radius: 16% / 20%; }
.winview[data-family="bizjet"][data-frame="window"] .wv-frame { width: min(46vh, 74vw); height: min(54vh, 90vw); border-radius: 50% / 46%; }
.winview[data-family="turboprop"][data-frame="window"] .wv-frame { width: min(44vh, 74vw); height: min(58vh, 98vw); }
/* High wing (turboprops, Cessnas): the wing is above the window */
.winview[data-wing="high"] .wv-wing { top: 0; bottom: auto; height: 40%; }
.winview[data-wing="high"][data-seat="wing"][data-side="left"] .wv-wing { transform: scaleY(-1); }
.winview[data-wing="high"][data-seat="wing"][data-side="right"] .wv-wing { transform: scale(-1, -1); }
/* Cockpit windshield (older look, unused) */
.winview[data-frame="cockpit"] { background: linear-gradient(#20252D, #12161C); }
.winview[data-frame="cockpit"] .wv-frame { width: 96vw; height: 60vh; margin-bottom: 18vh; clip-path: polygon(5% 0, 95% 0, 100% 100%, 0 100%); }
.winview[data-frame="cockpit"] .wv-post { display: block; position: absolute; z-index: 4; left: 50%; top: 0; bottom: 0; width: 22px; margin-left: -11px; background: linear-gradient(90deg, #1B1F26, #2E3540, #1B1F26); }
.winview[data-frame="cockpit"] .wv-dashboard { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 26vh; z-index: 1;
  background: linear-gradient(#2A3039, #161A20); border-top: 3px solid #3A424E; }
/* Belly camera */
.winview[data-frame="belly"] { background: #0E1218; }
.winview[data-frame="belly"] .wv-frame { width: min(66vh, 92vw); height: min(66vh, 92vw); margin-bottom: 9vh; border-radius: 50%; box-shadow: 0 0 0 10px #2A313B, 0 0 0 12px #47505D; }
/* Tail camera */
.winview[data-frame="tail"] { background: #0E1218; }
.winview[data-frame="tail"] .wv-frame { width: min(92vw, 112vh); aspect-ratio: 16 / 9; margin-bottom: 9vh; border-radius: 12px; box-shadow: 0 0 0 2px #47505D; }
.winview[data-frame="tail"] .wv-tailcam { display: block; position: absolute; z-index: 4; right: 14px; top: 12px; color: #fff; font: 700 12px/1 var(--font); letter-spacing: 0.08em; opacity: 0.8; text-shadow: 0 1px 2px #000; }
/* No frame */
.winview[data-frame="none"] .wv-frame { position: absolute; inset: 0; }
/* Light */
.winview[data-light="night"] #wv-map canvas, .winview[data-light="night"] #wv-ces canvas { filter: brightness(0.32) saturate(0.55); }
.winview[data-light="dusk"] #wv-map canvas, .winview[data-light="dusk"] #wv-ces canvas { filter: brightness(0.75) sepia(0.25); }
/* HUD and controls */
.wv-hud { position: absolute; z-index: 5; left: 16px; top: calc(16px + env(safe-area-inset-top, 0px)); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; max-width: min(420px, calc(100vw - 32px)); }
.wv-hud b { font-size: 17px; }
.wv-hud span { font-size: 12.5px; color: var(--muted); }
.wv-msg { color: var(--warn) !important; }
.wv-msg:empty { display: none; }
.wv-bar { position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); bottom: calc(30px + env(safe-area-inset-bottom, 0px)); width: min(760px, calc(100vw - 24px)); box-sizing: border-box;
  padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: center; }
.wv-views { display: flex; gap: 4px; }
.wv-line { display: none; }
.wv-views button { font-size: 13px; padding: 7px 11px; background: transparent; color: var(--text); border: 1px solid var(--edge); font-weight: 400; }
.wv-views button[aria-pressed="true"] { background: var(--accent); color: var(--night); border-color: var(--accent); font-weight: 700; }
.wv-adj { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
/* Vertical look up/down control, on the right */
.wv-look { position: absolute; z-index: 6; right: 16px; top: 50%; transform: translateY(-50%); width: 64px; box-sizing: border-box;
  padding: 6px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.wv-look[hidden] { display: none; }
.winview[data-frame="deck"] .wv-look { top: calc(140px + env(safe-area-inset-top, 0px)); transform: none; }
.wv-look input { writing-mode: vertical-lr; direction: ltr; width: 28px; height: 190px; margin: 0; accent-color: var(--accent); cursor: ns-resize; }
.wv-look-lbl { font-size: 10.5px; line-height: 1.2; color: var(--muted); text-align: center; }
.wv-level { font-size: 11px; padding: 4px 6px; width: 100%; }
.drag-grip { align-self: stretch; text-align: center; color: var(--muted); font-size: 13px; letter-spacing: -2px; line-height: 1; padding: 3px 0; cursor: grab; user-select: none; touch-action: none; border-radius: 6px; }
.drag-grip:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.dragging .drag-grip { cursor: grabbing; }
.wv-bar .drag-grip { align-self: center; width: 18px; padding: 8px 0; writing-mode: horizontal-tb; }
.wv-bar.moved, .wv-look.moved { position: fixed; }
.wv-adj[hidden] { display: none; }
.wv-adj input { width: 110px; accent-color: var(--accent); }
.wv-acts { display: flex; gap: 6px; }
.wv-acts button { font-size: 13px; padding: 7px 11px; }
.wv-attrib { position: absolute; z-index: 5; right: 10px; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); font-size: 10.5px; color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 2px #000; }
.wv-lbl { display: flex; flex-direction: column; align-items: center; padding: 0; background: none; border: 0; cursor: pointer; font-weight: 400; }
.wv-lbl b { font: 700 12.5px/1.25 var(--font); color: #fff; background: rgba(8, 14, 26, 0.86); padding: 3px 8px; border-radius: 6px; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45); }
.wv-lbl span { font: 10.5px/1.2 var(--font); color: #E7EDF6; text-shadow: 0 1px 2px #000, 0 0 4px #000; margin-top: 1px; }
.wv-lbl::after { content: ""; width: 2px; height: 14px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 2px #000; }
.wv-lbl:hover b, .wv-lbl:focus-visible b { background: var(--accent); color: var(--night); }
.wv-lbl.mine b { border: 0; border-left: 3px solid #F2C14E; }
.wv-lbl.mine b i { color: #F2C14E; font-style: normal; margin-right: 5px; }
.wv-lbl.mine::after { background: #F2C14E; }
.wv-pop .maplibregl-popup-content { background: #101C30; color: var(--text); border: 1px solid var(--edge); border-radius: 12px; padding: 12px 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); font: 13px/1.45 var(--font); }
.wv-pop .maplibregl-popup-tip { border-top-color: #101C30 !important; border-bottom-color: #101C30 !important; }
.wv-pop .maplibregl-popup-close-button { color: var(--muted); font-size: 18px; right: 4px; top: 2px; }
.wvp-img { float: right; width: 84px; height: 84px; object-fit: cover; border-radius: 8px; margin: 0 0 6px 10px; }
.wvp-t { display: block; font-size: 15px; padding-right: 14px; }
.wvp-f { font-size: 11.5px; color: var(--accent); margin: 2px 0 6px; }
.wvp-x { font-size: 12.5px; color: #D5DDE8; }
.wvp-a { clear: both; display: flex; gap: 14px; margin-top: 8px; font-size: 12px; }
.wvp-a a { color: var(--accent); }
.wv-card { position: absolute; z-index: 6; right: 24px; top: calc(150px + env(safe-area-inset-top, 0px)); width: min(340px, calc(100vw - 48px)); padding: 12px 14px; font: 13px/1.45 var(--font); }
.wv-card[hidden] { display: none; }
.wv-card-x { position: absolute; right: 6px; top: 4px; padding: 0 6px; background: none; color: var(--muted); font-size: 20px; font-weight: 400; }
.wv-ces { position: absolute; inset: 0; }
.wv-ces[hidden] { display: none; }
.wv-ces .cesium-viewer, .wv-ces .cesium-widget, .wv-ces canvas { width: 100%; height: 100%; }
.wv-labels { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.wv-labels .wv-lbl { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; }
.winview.engine-cesium #wv-map { display: none; }
.wv-credits { position: absolute; z-index: 5; left: 12px; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); max-width: 46vw; font-size: 10px; color: #fff; }
.wv-credits .cesium-credit-logoContainer img, .wv-credits img { max-height: 18px; vertical-align: middle; }
.wv-credits a { color: #fff; }
.winview[data-frame="deck"] .wv-credits { bottom: auto; top: calc(124px + env(safe-area-inset-top, 0px)); left: auto; right: 12px; text-align: right; }
.winview:not(.engine-cesium) .wv-credits { display: none; }
.winview.engine-cesium .attr-std { display: none; }
.wv-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.wv-fx[hidden] { display: none; }
#wv-wx[aria-pressed="true"] { background: var(--accent); color: var(--night); border-color: var(--accent); }
body.wv-open .mode-tabs { display: none; }
@media (max-width: 760px) { .wv-views button { padding: 6px 8px; font-size: 12px; } .wv-look input { height: 140px; } }

/* Small windows (the /trips mini map shrunk back, small phones in landscape): the view first.
   Just the title, the view buttons and Close; the rest is in the full-size view. */
@media (max-height: 620px) and (max-width: 640px), (max-height: 420px) {
  .winview .wv-hud { left: 8px !important; top: 8px !important; padding: 5px 9px !important; gap: 0 !important; max-width: calc(100% - 16px) !important; }
  .winview .wv-hud b { font-size: 13px; }
  .winview .wv-hud { display: flex !important; }
  .winview .wv-line { display: none !important; }
  .winview .wv-hud span:not(.wv-msg) { display: none; }
  /* the look up / down slider stays, slim, against the right edge between the credits and the controls */
  .winview .wv-look:not([hidden]) { display: flex !important; position: absolute !important; right: max(2px, env(safe-area-inset-right, 0px)) !important; left: auto !important; top: 50% !important; bottom: auto !important;
    transform: translateY(-50%) !important; width: 40px; padding: 4px 2px 6px; gap: 2px; }
  .winview .wv-look .drag-grip { display: none; }
  .winview .wv-look-lbl { font-size: 9.5px; }
  .winview .wv-look input { height: min(150px, calc(100vh - 200px)) !important; width: 24px; }
  .winview .wv-bar, .winview[data-frame="deck"] .wv-bar { left: 8px !important; right: 8px !important; top: auto !important; bottom: 8px !important; transform: none !important;
    width: auto !important; padding: 5px 6px !important; gap: 6px !important; flex-wrap: nowrap !important; justify-content: space-between !important; position: absolute !important; }
  .winview .wv-bar .drag-grip, .winview #wv-seat-row, .winview #wv-ckseat-row, .winview #wv-wx, .winview #wv-day, .winview #wv-frame-toggle { display: none !important; }
  .winview .wv-views { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .winview .wv-views::-webkit-scrollbar { display: none; }
  .winview .wv-views button, .winview .wv-acts button { flex: none; min-height: 0 !important; padding: 5px 8px !important; font-size: 11.5px !important; }
  .winview .wv-acts { flex: none; }
  /* map credits at the top right, clear of the controls along the bottom (the title is top left) */
  .winview .wv-credits, .winview.winview.deck3d .wv-credits { top: 8px !important; bottom: auto !important; left: auto !important; right: 8px !important; max-width: 55% !important; text-align: right; transform: scale(0.75); transform-origin: right top; }
  .winview .wv-attrib { display: none; }
  .winview .wv-card { max-height: 50%; overflow: auto; }
}

/* Light-aircraft cockpit (js/windowview/cockpit-ga.js): the propeller spins */
.ck-ga .ga-blades { animation: ga-spin 0.11s linear infinite; }
@keyframes ga-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ck-ga .ga-blades { animation: none; } }

/* A real 3D flight deck (deck3d.js): the drawn cockpit steps aside; the model's credit sits bottom-right */
.winview.deck3d .ck-wrap, .winview.deck3d-loading .ck-wrap { display: none !important; }
/* the 3D deck is always fully lit: the night/dusk dimming is done on the scenery only (deck3d.js) */
.winview.deck3d #wv-ces canvas { filter: none !important; }
.wv-ckseat-row { display: none !important; }
.winview.deck3d .wv-ckseat-row { display: flex !important; }
.wv-deck-credit { position: absolute; z-index: 5; right: 10px; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); font-size: 10.5px; color: rgba(255, 255, 255, 0.8); text-shadow: 0 1px 2px #000; text-decoration: none; }
.wv-deck-credit:hover { text-decoration: underline; }
