/* public/replay3d.css
 * The replay bar and the 3D replay's readout cards, shared by portal.html and replay3d.html
 * (see replay3d.js). The portal's palette, which portal.html's own :root also sets: */
:root { --accent: #818cf8; --border: rgba(255,255,255,.08); --text: #e8eaf0; --muted: #7b7f93; --blue: #60a5fa; }

/* Cesium ion's terms of service don't allow removing the ion logo credit itself
 * (https://cesium.com/legal/terms-of-service/), so that stays on screen — moved to the top-left
 * corner instead of Cesium's default bottom-left, and given the same dark-glass card look as the
 * HUD readouts below (#hud3d / #hud3d-time) so the ABC logo + "powered by" + ion logo lockup
 * (abc-banner-logo.png, inserted by addPoweredByBadge3d() in replay3d.js) reads clearly over the
 * map instead of sitting bare on the globe. The plain-text credits next to it (e.g. "Upgrade for
 * commercial use.") and the "Data attribution" lightbox link are ours to hide; only the logo
 * (.cesium-credit-logoContainer) remains. Web portal only (not html.credits-in-app, see
 * replay3d.html): the app has its Back/2D buttons over the top-left, shows the ion logo on its own
 * About screen instead (Cesium ion's terms 2.2.3), and hides this whole credits strip on the map.
 * DOM (Cesium Viewer): .cesium-viewer-bottom > .cesium-widget-credits > [our .abc-powered-by,
 * .cesium-credit-logoContainer > .cesium-credit-wrapper > a > img]. The !importants are needed:
 *  - Viewer.resize() writes INLINE left/bottom/right (5px/3px/0px here) onto .cesium-viewer-bottom on
 *    every resize; without !important those win over the offsets below, and with our top: 12px the
 *    card stretches over the whole map.
 *  - Cesium sets display:inline inline on the logo container and credit wrapper, and its injected CSS
 *    makes every logo-container descendant display:inline; flex all the way down instead, so the
 *    ion logo is a tight box centred on the same row as our badge. */
html:not(.credits-in-app) .cesium-viewer-bottom {
  top: 12px !important; left: 12px !important; bottom: auto !important; right: auto !important; z-index: 5;
  padding: 6px 10px;
  background: rgba(15,17,23,.78); border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
html:not(.credits-in-app) .cesium-widget-credits { display: flex !important; align-items: center; gap: 6px; }
html:not(.credits-in-app) .cesium-credit-textContainer,
html:not(.credits-in-app) .cesium-credit-expand-link { display: none !important; }
html:not(.credits-in-app) .cesium-credit-logoContainer,
html:not(.credits-in-app) .cesium-credit-logoContainer .cesium-credit-wrapper,
html:not(.credits-in-app) .cesium-credit-logoContainer a { display: flex !important; align-items: center; }
html:not(.credits-in-app) .cesium-credit-logoContainer img { display: block !important; }

.abc-powered-by { display: flex !important; align-items: center; gap: 4px; }
.abc-powered-by img { display: inline-block !important; height: 24px; width: auto; }
.abc-powered-by span { display: inline !important; font-size: 10px; color: #fff; text-shadow: 0 0 2px #000; white-space: nowrap; }

#replay-bar {
  display: none; align-items: center; gap: 10px; flex-shrink: 0;
  padding: 8px 12px; background: rgba(15,17,23,.92); border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
#replay-btn {
  background: var(--accent); color: #fff; border: none; border-radius: 6px;
  font-size: 12px; font-weight: 600; padding: 5px 12px; cursor: pointer; white-space: nowrap;
}
#replay-btn:hover { opacity: .85; }
#replay-slider { flex: 1; accent-color: var(--accent); cursor: pointer; min-width: 0; }
#replay-time { font-size: 11px; color: var(--muted); white-space: nowrap; min-width: 80px; text-align: right; }
.spd-btn {
  background: rgba(255,255,255,.07); border: 1px solid var(--border); color: var(--muted);
  font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 4px; cursor: pointer;
}
.spd-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.spd-btn:hover:not(.active) { border-color: rgba(255,255,255,.25); color: var(--text); }
#cam-btn {
  background: rgba(255,255,255,.07); border: 1px solid var(--border); color: var(--muted);
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap;
}
#cam-btn.active { background: rgba(96,165,250,.2); color: var(--blue); border-color: var(--blue); }
#video-btn {
  background: rgba(255,255,255,.07); border: 1px solid var(--border); color: var(--muted);
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap;
}
#video-btn.recording { background: rgba(248,113,113,.2); color: #f87171; border-color: #f87171; }
/* While a video records it plays straight through: Play, speed and the slider wait */
#replay-bar.recording #replay-btn, #replay-bar.recording .spd-btn, #replay-bar.recording #replay-slider { pointer-events: none; opacity: .35; }
/* The recording's time, then how saving went: a line over the top of the map */
.video-status {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; pointer-events: none;
  background: rgba(15,17,23,.85); color: #f8fafc; border: 1px solid rgba(255,255,255,.14); border-radius: 999px;
  padding: 5px 12px; font: 600 12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* 3D replay readouts — dark glass cards over the map: every value white, each label its own colour */
#hud3d, #hud3d-time {
  display: none; position: absolute; bottom: 12px; z-index: 5; pointer-events: none;
  background: rgba(15,17,23,.78); color: #f8fafc; border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}
#hud3d.show, #hud3d-time.show { display: flex; }
#hud3d { left: 12px; bottom: 12px; padding: 8px 4px; }   /* was bottom: 40px, clearing Cesium's credits when those sat bottom-left; they're top-left now */
.hud-cell { display: flex; flex-direction: column; align-items: center; min-width: 62px; padding: 0 9px; border-left: 1px solid rgba(255,255,255,.1); }
.hud-cell:first-child { border-left: none; }
.hud-k { font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.hud-v { font-size: 20px; font-weight: 700; line-height: 1.25; }
.hud-u { font-size: 9px; color: #94a3b8; }
.hud-k.agl { color: #fbbf24; }
.hud-k.msl { color: #60a5fa; }
.hud-k.vs  { color: #a5b4fc; }
.hud-k.spd { color: #34d399; }
.hud-k.hdg { color: #f87171; }
#hud3d-time { right: 12px; flex-direction: column; align-items: center; padding: 6px 14px; }
#hud-time { font-size: 16px; font-weight: 700; }
#hud-date { font-size: 10px; font-weight: 600; color: #94a3b8; }
@media (max-width: 700px) {
  .hud-cell { min-width: 46px; padding: 0 5px; }
  .hud-v { font-size: 15px; }
  /* Too narrow for the time card beside #hud3d at the bottom. Top-right is the portal's 2D/3D button
     (#map-toggle) and top-left the credits card, so it goes just under the credits card: 12 px + the
     card's ~42 px + an 8 px gap. (The app's replay3d.html positions it itself, so this is the portal.) */
  #hud3d-time { top: 62px; bottom: auto; right: auto; left: 12px; }
  #replay-bar { flex-wrap: wrap; row-gap: 6px; }
  #replay-slider { order: 1; flex-basis: 100%; }   /* its own row under the buttons */
}
@media (max-width: 400px) {
  /* Small phones (Samsung's default is 360-384 px wide): smaller logos so the credits card clears the
     portal's 2D/3D button, top-right. */
  .abc-powered-by img { height: 20px; }
  html:not(.credits-in-app) .cesium-credit-logoContainer img { height: 22px; width: auto; }
}
