/* =============================================================================
   JARVIS HOLOGRAM THEME
   Overlay for the NeoWX Material weewx skin.
   Loaded AFTER style.min.css (see head.inc) so every rule here wins.

   NOTE on scoping: this skin's body class is "${Extras.Appearance.mode}-theme"
   (dark-theme / light-theme / auto-theme depending on skin.conf). JARVIS is
   a dark-only design (skin.conf forces mode = dark), so every rule below is
   applied unconditionally rather than gated behind ".dark-theme"/".auto-theme"
   selectors. This is intentional: gating on the body class would silently
   half-break the page (e.g. dark navbar + footer over a light body) if
   "mode" is ever changed back to "light" or "auto" by mistake. Applying the
   theme unconditionally makes it immune to that config value entirely.
   ============================================================================= */

:root {
  --jv-blue:        #00c8ff;
  --jv-blue-dim:    #0077aa;
  --jv-blue-deep:   #003344;
  --jv-bg:          #020a0f;
  --jv-panel:       #050f18;
  --jv-panel-2:     #081420;
  --jv-border:      rgba(0, 200, 255, 0.22);
  --jv-border-soft: rgba(0, 200, 255, 0.12);
  --jv-text:        #a8e8f8;
  --jv-text-dim:    #4a8899;
  --jv-green:       #00ff88;
  --jv-red:         #ff3b5c;
  --jv-glow:        0 0 8px rgba(0, 200, 255, .65), 0 0 22px rgba(0, 200, 255, .25);
  --jv-glow-lg:     0 0 10px rgba(0, 200, 255, .8), 0 0 40px rgba(0, 200, 255, .3);
  --jv-font-display: 'Orbitron', 'Rubik', sans-serif;
  --jv-font-mono:    'Share Tech Mono', 'Rubik', monospace;
}

/* ── Base page ───────────────────────────────────────────────────────── */

body {
  background: var(--jv-bg) !important;
  color: var(--jv-text) !important;
  font-family: var(--jv-font-mono);
}

body.main-bg {
  background: var(--jv-bg) !important;
}

/* Scanline overlay across the whole page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 200, 255, .015) 2px,
    rgba(0, 200, 255, .015) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Corner HUD frame, fixed to viewport */
body::after {
  content: '';
  position: fixed;
  top: 10px; left: 10px; right: 10px; bottom: 10px;
  border: 1px solid var(--jv-border-soft);
  pointer-events: none;
  z-index: 9998;
}

/* ── Typography ──────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--jv-font-display);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--jv-blue);
  text-shadow: var(--jv-glow);
}

.h2-responsive {
  font-family: var(--jv-font-display);
  font-weight: 900;
  color: var(--jv-blue);
  text-shadow: var(--jv-glow-lg);
}

.h5-responsive {
  font-family: var(--jv-font-display);
  font-weight: 700;
  font-size: .85rem !important;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.light-blue-text {
  color: var(--jv-blue) !important;
  text-shadow: var(--jv-glow);
}

.text-muted {
  color: var(--jv-text-dim) !important;
  font-size: .72rem;
  letter-spacing: .04em;
}

.font-small {
  font-size: .72rem;
}

/* The skin hardcodes .text-dark (near-black, #212121) on several page
   titles and on monthly summary values in year.html. Left as-is it would
   be invisible against the hologram background, so it must be repainted. */
.text-dark {
  color: var(--jv-blue) !important;
}

/* ── Cards ───────────────────────────────────────────────────────────── */

.card {
  background-color: var(--jv-panel) !important;
  color: var(--jv-text) !important;
  border: 1px solid var(--jv-border) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  position: relative;
  transition: box-shadow .2s, border-color .2s;
}

.card:hover {
  border-color: var(--jv-blue) !important;
  box-shadow: 0 0 24px rgba(0, 200, 255, .12), inset 0 0 30px rgba(0, 200, 255, .05) !important;
}

/* Corner accent on every card, JARVIS HUD style */
.card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 16px; height: 16px;
  border-top: 2px solid var(--jv-blue);
  border-right: 2px solid var(--jv-blue);
  opacity: .8;
  pointer-events: none;
}

.card .card-body {
  padding: 1rem .9rem;
}

.lo-text,
.hi-text {
  font-family: var(--jv-font-mono);
  font-weight: 700;
}

/* ── Navbar / header ─────────────────────────────────────────────────── */

nav.navbar {
  background: linear-gradient(180deg, var(--jv-panel-2) 0%, var(--jv-bg) 100%) !important;
  border-bottom: 1px solid var(--jv-border);
  box-shadow: 0 1px 0 var(--jv-border), 0 0 24px rgba(0, 200, 255, .08) !important;
}

nav.navbar .navbar-brand strong {
  font-family: var(--jv-font-display);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--jv-blue);
  text-shadow: var(--jv-glow);
  font-size: .95rem;
}

nav.navbar .navbar-brand .font-small {
  color: var(--jv-text-dim) !important;
  font-family: var(--jv-font-mono);
}

nav.navbar .nav-link {
  font-family: var(--jv-font-display);
  font-size: .68rem !important;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--jv-text-dim) !important;
  transition: color .15s, text-shadow .15s;
}

nav.navbar .nav-link:hover {
  color: var(--jv-blue) !important;
  text-shadow: var(--jv-glow);
}

nav.navbar .nav-item.active .nav-link {
  color: var(--jv-blue) !important;
  text-shadow: var(--jv-glow);
  background-color: transparent !important;
  border-bottom: 2px solid var(--jv-blue);
}

nav.navbar .nav-flex-icons .nav-item.text-white,
nav.navbar .nav-flex-icons .nav-item .wi {
  color: var(--jv-text) !important;
}

nav.navbar img {
  filter: drop-shadow(0 0 6px rgba(0, 200, 255, .6));
}

/* Live status indicator injected next to current dateTime, see header.inc */
.jv-live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jv-green);
  box-shadow: 0 0 6px var(--jv-green);
  margin-right: 5px;
  animation: jv-blink 2s ease-in-out infinite;
}

@keyframes jv-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

/* ── Footer ──────────────────────────────────────────────────────────── */

footer.page-footer {
  background: var(--jv-panel-2) !important;
  border-top: 1px solid var(--jv-border);
  color: var(--jv-text-dim) !important;
}

footer.page-footer h5 {
  font-family: var(--jv-font-display);
  font-weight: 700;
  font-size: .68rem !important;
  letter-spacing: .16em;
  color: var(--jv-blue-dim) !important;
  text-shadow: none;
}

footer.page-footer a {
  color: var(--jv-blue-dim) !important;
  transition: color .15s;
}

footer.page-footer a:hover {
  color: var(--jv-blue) !important;
  text-shadow: var(--jv-glow);
}

footer.page-footer table td {
  color: var(--jv-text-dim);
  font-size: .78rem;
  border: none;
}

footer.page-footer .footer-copyright {
  background-color: rgba(0, 200, 255, .04) !important;
  color: var(--jv-text-dim) !important;
  border-top: 1px solid var(--jv-border-soft);
  font-size: .7rem;
  letter-spacing: .06em;
}

/* ── Weather icons tinted blue ──────────────────────────────────────── */

.wi {
  color: var(--jv-blue);
  filter: drop-shadow(0 0 4px rgba(0, 200, 255, .5));
}

/* ── Tables (telemetry, archive, almanac) ───────────────────────────── */

table.table {
  color: var(--jv-text);
}

table.table th {
  color: var(--jv-blue-dim);
  font-family: var(--jv-font-display);
  font-weight: 700;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--jv-border) !important;
}

table.table td {
  border-top: 1px solid var(--jv-border-soft) !important;
  font-size: .8rem;
}

table.table-hover tbody tr:hover {
  background-color: rgba(0, 200, 255, .06) !important;
}

table.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 200, 255, .05) !important;
}

/* ── Dropdowns (navbar collapse on mobile) ──────────────────────────── */

.dropdown-menu {
  background-color: var(--jv-panel) !important;
  border: 1px solid var(--jv-border) !important;
  color: var(--jv-text) !important;
}

/* ── Buttons (archive year links) ───────────────────────────────────── */

.btn {
  font-family: var(--jv-font-display);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 3px;
  box-shadow: none !important;
}

.btn.light-blue,
.btn-light-blue {
  background-color: transparent !important;
  border: 1px solid var(--jv-border) !important;
  color: var(--jv-blue) !important;
}

.btn.light-blue:hover,
.btn-light-blue:hover {
  background-color: rgba(0, 200, 255, .08) !important;
  border-color: var(--jv-blue) !important;
  box-shadow: 0 0 16px rgba(0, 200, 255, .25) !important;
}

.btn-primary {
  background-color: transparent !important;
  border: 1px solid var(--jv-blue-dim) !important;
  color: var(--jv-text-dim) !important;
}

.btn-primary:hover {
  background-color: rgba(0, 119, 170, .12) !important;
  border-color: var(--jv-blue) !important;
  color: var(--jv-blue) !important;
}

/* ── ApexCharts container polish (colors/series set in js.inc) ──────── */

.apexcharts-canvas {
  background: transparent !important;
}

.apexcharts-tooltip {
  background: var(--jv-panel) !important;
  border: 1px solid var(--jv-border) !important;
  color: var(--jv-text) !important;
  font-family: var(--jv-font-mono) !important;
}

.apexcharts-tooltip-title {
  background: var(--jv-panel-2) !important;
  border-bottom: 1px solid var(--jv-border) !important;
  color: var(--jv-blue) !important;
}

.apexcharts-xaxis text,
.apexcharts-yaxis text {
  fill: var(--jv-text-dim) !important;
  font-family: var(--jv-font-mono) !important;
  font-size: 10px !important;
}

.apexcharts-gridline {
  stroke: rgba(0, 200, 255, .08) !important;
}

.apexcharts-legend-text {
  color: var(--jv-text-dim) !important;
  font-family: var(--jv-font-mono) !important;
}

.apexcharts-toolbar svg {
  fill: var(--jv-text-dim) !important;
}

.apexcharts-radar-series polygon {
  fill-opacity: .35 !important;
}

/* ── Almanac icons / extras ──────────────────────────────────────────── */

.rowdivider {
  border-color: var(--jv-border) !important;
  opacity: .6;
}

/* ── Scrollbar, purely cosmetic ─────────────────────────────────────── */

::-webkit-scrollbar {
  width: 8px; height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--jv-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--jv-blue-dim);
  border-radius: 4px;
}

/* ── Webcams page: camera frame, live state, offline fallback ───────── */

.card img {
  border-radius: 3px;
  filter: brightness(.92) saturate(1.05);
}

.cam-frame {
  position: relative;
  border: 1px solid var(--jv-border);
  border-radius: 3px;
  overflow: hidden;
  background: var(--jv-bg);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.cam-frame:hover,
.cam-frame:focus {
  border-color: var(--jv-blue);
  box-shadow: 0 0 18px rgba(0, 200, 255, .18);
  outline: none;
}

.cam-frame img {
  width: 100%;
  display: block;
  filter: brightness(.92) saturate(1.05);
}

.cam-frame .cam-error-msg {
  display: none;
}

.cam-frame.cam-error img {
  display: none;
}

.cam-frame.cam-error {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.cam-frame.cam-error .cam-error-msg {
  display: block;
  padding: 30px 16px;
  color: var(--jv-red);
  font-family: var(--jv-font-display);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 59, 92, .5);
}

.cam-frame.cam-error .cam-expand-hint {
  display: none;
}

.cam-expand-hint {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 8px 10px 6px;
  background: linear-gradient(to top, rgba(2, 10, 15, .85), transparent);
  color: var(--jv-blue);
  font-family: var(--jv-font-display);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}

.cam-frame:hover .cam-expand-hint,
.cam-frame:focus .cam-expand-hint {
  opacity: 1;
}

/* ── Webcams page: full-size lightbox overlay ───────────────────────── */
/* Clicking a camera preview opens the SAME image at full size inside  */
/* this JARVIS-framed overlay instead of navigating to a plain .jpg.   */

.cam-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 10, 15, .92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10050;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease;
  padding: 24px;
}

.cam-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.cam-lightbox-inner {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cam-lightbox-frame {
  border: 1px solid var(--jv-border);
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0, 200, 255, .25), inset 0 0 40px rgba(0, 200, 255, .05);
  overflow: hidden;
  max-width: 92vw;
  max-height: 80vh;
  background: var(--jv-bg);
}

.cam-lightbox-frame img {
  display: block;
  max-width: 92vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  filter: brightness(.96) saturate(1.05);
}

.cam-lightbox-label {
  margin-top: 10px;
  text-align: center;
}

.cam-lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(2, 10, 15, .75);
  border: 1px solid var(--jv-border);
  color: var(--jv-blue);
  width: 32px;
  height: 32px;
  border-radius: 3px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
  transition: background .15s, box-shadow .15s;
}

.cam-lightbox-close:hover {
  background: rgba(0, 200, 255, .1);
  box-shadow: 0 0 16px rgba(0, 200, 255, .3);
}

.cam-lightbox-zoom {
  position: absolute;
  top: 8px;
  right: 48px;
  background: rgba(2, 10, 15, .75);
  border: 1px solid var(--jv-border);
  color: var(--jv-blue);
  height: 32px;
  padding: 0 12px;
  border-radius: 3px;
  font-family: var(--jv-font-display);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 1;
  transition: background .15s, box-shadow .15s;
}

.cam-lightbox-zoom:hover {
  background: rgba(0, 200, 255, .1);
  box-shadow: 0 0 16px rgba(0, 200, 255, .3);
}

/* "Fit to screen" (default): image always shrinks to stay within the
   frame, never upscaled past its native size. */
.cam-lightbox-frame img {
  cursor: zoom-in;
}

/* "Native resolution" mode: drop every size cap so the image renders at
   its real pixel dimensions, and let the surrounding box scroll/pan
   instead of squeezing it down to fit the viewport. */
.cam-lightbox.zoomed .cam-lightbox-inner {
  max-width: 96vw;
  max-height: 96vh;
  align-items: flex-start;
  overflow: auto;
}

.cam-lightbox.zoomed .cam-lightbox-frame {
  max-width: none;
  max-height: none;
}

.cam-lightbox.zoomed .cam-lightbox-frame img {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  cursor: zoom-out;
}

/* ── Mobile tightening ──────────────────────────────────────────────── */

@media (max-width: 600px) {
  body::after {
    top: 6px; left: 6px; right: 6px; bottom: 6px;
  }
  .h2-responsive {
    font-size: 150% !important;
  }
  .cam-lightbox-zoom {
    font-size: 0;
    width: 32px;
    padding: 0;
  }
  .cam-lightbox-zoom::before {
    content: '⤢';
    font-size: 1.1rem;
  }
  .cam-lightbox.zoomed .cam-lightbox-zoom::before {
    content: '⤡';
  }
}

/* ── Statistics table (statistics.html) ─────────────────────────────── */

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--jv-font-mono);
  font-size: .8rem;
}

.stats-table thead th {
  color: var(--jv-blue-dim);
  font-family: var(--jv-font-display);
  font-weight: 700;
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--jv-border);
  white-space: nowrap;
}

/* AllTime sloupec zlatá */
.stats-table thead th.alltime-col {
  color: #c8a400;
}

/* Label sloupec – název veličiny */
.stats-table td.label {
  color: var(--jv-text-dim);
  padding: 5px 10px 5px 4px;
  white-space: nowrap;
  font-size: .75rem;
  letter-spacing: .04em;
}

/* Datový sloupec */
.stats-table td.data {
  text-align: center;
  padding: 4px 6px;
  color: var(--jv-text);
  line-height: 1.45;
  border-top: 1px solid var(--jv-border-soft);
}

/* AllTime buňka – zlatá */
.stats-table td.data.alltime {
  color: #e8c000;
  text-shadow: 0 0 8px rgba(232, 192, 0, .5);
}

/* Jednotky */
.stats-table td.units {
  color: var(--jv-text-dim);
  font-size: .7rem;
  padding: 4px 4px 4px 2px;
  white-space: nowrap;
  border-top: 1px solid var(--jv-border-soft);
}

/* Max hodnota – červená */
.stats-table .hi {
  color: var(--jv-red);
  font-weight: 700;
}

/* Min hodnota – modrá */
.stats-table .lo {
  color: var(--jv-blue);
  font-weight: 700;
}

/* Hover řádek */
.stats-table tbody tr:hover td {
  background: rgba(0, 200, 255, .05);
}

/* Separátor každých N řádků (volitelně ručně přidej class="section-sep") */
.stats-table tr.section-sep td {
  border-top: 1px solid var(--jv-border);
}
