@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.min.css");

:root {
  /* Saint Lucia flag inspired */
  --sky-blue: #66ccff;
  --deep-blue: #0057a8;
  --gold: #f9c74f;
  --black: #111111;
  --white: #ffffff;

  --bg: #f4fbff;
  --panel: #ffffff;
  --text: #12324a;
  --muted: #54748d;
  --line: #cfe6f5;

  --info: #2d9cdb;
  --watch: #f39c12;
  --warning: #e63946;
  --ok: #2a9d8f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, #dff5ff 0%, transparent 45%),
    radial-gradient(circle at 90% 20%, #eaf9ff 0%, transparent 45%),
    var(--bg);
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  background: linear-gradient(90deg, var(--deep-blue), #0a79d6);
  color: var(--white);
  box-shadow: 0 4px 18px rgba(0, 65, 120, .18);
}
.topbar h1 { margin: 0; font-size: 1.1rem; }
.muted { color: var(--muted); }

.topbar nav a {
  color: #e8f6ff;
  text-decoration: none;
  margin-left: .85rem;
  padding: .45rem .65rem;
  border-radius: 8px;
  font-weight: 600;
}
.topbar nav a:hover {
  background: rgba(255,255,255,.16);
  color: #fff;
}

/* Layout */
.container {
  width: min(1100px, 94%);
  margin: 1rem auto 1.5rem;
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
}

.observation-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Cards */
.card, .alert-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem 1.05rem;
  box-shadow: 0 6px 20px rgba(10, 90, 145, .08);
}

.card h2, .card h3 { margin-top: 0; }

.alert-card {
  border-left: 7px solid var(--gold);
  background: linear-gradient(180deg, #fffefa, #ffffff);
}
.alert-card h2 {
  margin: .4rem 0;
  color: #7a4b00;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .62rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}
.badge::before { font-size: .9rem; }

.badge.info {
  background: #e8f6ff;
  color: #0b78b8;
}
.badge.info::before { content: "ℹ️"; }

.badge.warning {
  background: #fff4e8;
  color: #b56b00;
}
.badge.warning::before { content: "⚠️"; }

.badge.danger {
  background: #ffecef;
  color: #c2172a;
}
.badge.danger::before { content: "🚨"; }

/* MET-style section titles with icon accent */
.section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .6rem;
  color: var(--deep-blue);
  font-weight: 800;
}
.section-title .icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e7f5ff;
  border: 1px solid #c9e8ff;
}

/* Form */
.form-grid {
  display: grid;
  gap: .75rem;
}
label {
  display: grid;
  gap: .3rem;
  font-weight: 600;
  color: #214a66;
}
input, select, textarea, button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid #bcdff3;
  padding: .62rem .72rem;
  background: #fff;
  color: #153b55;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid #cfeeff;
  border-color: #6ec2f3;
}
textarea { resize: vertical; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .35rem;
}
button {
  cursor: pointer;
  border: none;
  font-weight: 700;
  color: white;
  background: linear-gradient(90deg, #0b6fb8, #1695e8);
  box-shadow: 0 4px 10px rgba(12, 120, 190, .2);
}
button:hover { filter: brightness(1.03); }
button.secondary {
  background: linear-gradient(90deg, #5d7b92, #6f92ac);
}
button.danger {
  background: linear-gradient(90deg, #c1121f, #e63946);
}

/* Filters */
.filters {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  gap: .5rem;
}

.filter-panel .filters {
  grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) minmax(145px, 1fr) minmax(145px, 1fr) auto auto;
  align-items: end;
}
.filter-date {
  font-size: .82rem;
}
.observation-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
  gap: .6rem;
}

/* Detail block */
.detail-list {
  display: grid;
  gap: .65rem;
  margin: 0;
}
.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--line);
}
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 700; text-align: right; }

pre {
  white-space: pre-wrap;
  background: #f2fbff;
  border: 1px dashed #9ed0ee;
  border-radius: 10px;
  padding: .65rem;
  color: #184663;
}

/* Footer */
.footer {
  margin-top: 1rem;
  text-align: center;
  color: #4d6f87;
  border-top: 1px solid #d8ebf7;
  background: #f6fcff;
  padding: 1rem;
}

/* Utility */
.hidden { display: none !important; }

/* Mobile */
@media (max-width: 760px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .filters, .filter-panel .filters { grid-template-columns: 1fr; }
}

/* Add these extra styles to your existing styles.css */

.filters-extended {
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 1.2fr auto auto;
}

.timeline-card {
  display: grid;
  grid-template-columns: 8px 1fr;
  padding: 0;
  overflow: hidden;
}
.timeline-card .timeline-accent { background: #2d9cdb; }
.timeline-card.warning .timeline-accent { background: #f39c12; }
.timeline-card.danger .timeline-accent { background: #e63946; }

.timeline-card .timeline-content {
  padding: 1rem 1rem 1rem .9rem;
}

.loc-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: .35rem 0 .65rem;
}
.loc-chip {
  display: inline-block;
  padding: .22rem .55rem;
  border-radius: 999px;
  background: #eaf6ff;
  border: 1px solid #c8e6fb;
  color: #1d5e85;
  font-size: .78rem;
  font-weight: 600;
}

@media (max-width: 980px) {
  .filters-extended {
    grid-template-columns: 1fr;
  }
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}
.day-card {
  background: #fff;
  border: 1px solid #cfe6f5;
  border-radius: 14px;
  padding: .9rem;
  box-shadow: 0 6px 18px rgba(10, 90, 145, .08);
}
.day-card h4 { margin: .2rem 0 .4rem; color: #0057a8; }
.day-icon { font-size: 1.6rem; }
.temp {
  font-weight: 700;
  color: #12324a;
}



/* ================= Satellite Loop Player Styles ================= */


    .player-container {
      border: 2px solid #334155;
      background: #000;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    }
    #satellite-frame {
      display: block;
      max-width: 100%;
      height: auto;
    }
    .controls {
      margin-top: 15px;
      display: flex;
      gap: 10px;
      align-items: center;
    }
    button {
      background: #2563eb;
      color: white;
      border: none;
      padding: 8px 16px;
      border-radius: 4px;
      cursor: pointer;
      font-weight: bold;
    }
    button:hover { background: #1d4ed8; }
    #timestamp-display {
      font-family: monospace;
      font-size: 1.1rem;
      background: #1e293b;
      padding: 6px 12px;
      border-radius: 4px;
      color: white;
    }

/* ================= Day Progress Meter Styles ================= */

.progress-container {
  width: 300px;
  position: relative;
  font-family: sans-serif;
  text-align: center;
}

.progress-meter {
  width: 100%;
  height: auto;
}

.progress-meter path {
  fill: none;
  stroke-width: 2px; /* Thickness of the curve */
  stroke-linecap: round; /* Rounded line ends */
}

/* Gray background arc */
.progress-meter .track {
  stroke: #e0e0e0;
}

/* Colored progress line */
.progress-meter .fill {
  stroke: #d3db34;
  /* Scales the stroke total path distance mapping to exactly 100 */
  pathLength: 100; 
  stroke-dasharray: 100;
  /* Offsets the dash based on your custom CSS variable percentage */
  stroke-dashoffset: calc(100 - var(--progress)); 
  transition: stroke-dashoffset 0.5s ease-in-out;
}

.time-label {
  margin-top: -10px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
}

/* ================= Weather Service visual system ================= */

:root {
  --weather-ink: #f7fbff;
  --weather-muted: #b8c7df;
  --weather-navy: #071a3b;
  --weather-deep: #0a1e43;
  --weather-panel: rgba(18, 37, 76, .76);
  --weather-border: rgba(179, 205, 242, .35);
  --weather-cyan: #11b9eb;
  --weather-blue: #0649ad;
  --weather-yellow: #ffaf2f;
}

html, body { min-height: 100%; }

body {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--weather-ink);
  background:
    radial-gradient(circle at 72% 2%, rgba(34, 84, 158, .38), transparent 27rem),
    radial-gradient(circle at 22% 30%, rgba(14, 54, 117, .34), transparent 32rem),
    linear-gradient(145deg, #071a3b 0%, #0b2047 48%, #06152f 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: .36;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.78) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(126,199,255,.5) 0 1px, transparent 1.5px);
  background-position: 12px 20px, 80px 70px;
  background-size: 148px 126px, 205px 180px;
}

.utility-bar {
  min-height: 2.5rem;
  padding: .55rem 0;
  color: #e8edf7;
  background: #030303;
  font-size: .78rem;
  letter-spacing: .03em;
}
.utility-mark::before {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: .45rem;
  content: "✦";
  color: var(--weather-cyan);
}

.site-nav {
  min-height: 6rem;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.agency-brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  color: #182032 !important;
  font-size: 1.08rem;
  line-height: 1.05;
}
.agency-brand small {
  display: block;
  margin-top: .35rem;
  color: #8b94a2;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.agency-emblem {
  display: grid;
  width: 3.55rem;
  height: 3.55rem;
  place-items: center;
  border: .45rem solid var(--weather-cyan);
  border-radius: 50%;
  color: var(--weather-blue);
  background: #fff;
  font-size: 1.45rem;
  box-shadow: inset 0 0 0 .18rem #ffb31b;
}
.site-nav .nav-link {
  padding: 1rem .75rem !important;
  color: #252a34 !important;
  font-size: .9rem;
  font-weight: 700;
}
.site-nav .nav-link:hover { color: var(--weather-blue) !important; }
.site-nav .navbar-toggler {
  width: auto;
  border-color: #cdd4df;
  background: var(--weather-blue);
}

.service-alert {
  min-height: 3.7rem;
  padding: .85rem 0;
  color: #fff;
  background: linear-gradient(90deg, #063d99, #0b4daf);
  font-size: .92rem;
}
.service-alert a {
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}
.alert-symbol {
  display: inline-grid;
  width: 1.75rem;
  height: 1.75rem;
  margin-right: .5rem;
  place-items: center;
  border-radius: .45rem;
  color: #fff;
  background: rgba(255,255,255,.2);
}

main { min-height: calc(100vh - 14rem); }
main > .container { padding-top: 2.25rem; padding-bottom: 2.8rem; }
.container { width: min(1120px, 92%); }
.muted { color: var(--weather-muted) !important; }
.text-danger { color: #ffb6bd !important; }
h1, h2, h3, h4, h5 { letter-spacing: -.02em; }
h2 { font-weight: 800; }
a { color: #76dfff; }
a:hover { color: #c3f4ff; }

.card, .alert-card {
  border: 1px solid var(--weather-border);
  border-radius: .55rem;
  color: var(--weather-ink);
  background: var(--weather-panel);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .17);
  backdrop-filter: blur(9px);
}
.alert-card {
  border-left: 5px solid var(--weather-yellow);
  background: rgba(45, 42, 32, .7);
}
.section-title { color: #fff; }
.section-title .icon {
  border: 1px solid rgba(113, 222, 255, .48);
  color: var(--weather-cyan);
  background: rgba(7, 91, 155, .3);
}

.row-between > a button,
.actions button,
.filter-panel button,
.observation-list a button {
  width: auto;
}
button {
  width: auto;
  border: 0;
  border-radius: .28rem;
  padding: .66rem 1rem;
  color: #fff;
  background: linear-gradient(135deg, #078ecc, #08b9e9);
  box-shadow: none;
}
button:hover { background: linear-gradient(135deg, #0aa7e3, #1cc9f2); }
button.secondary {
  color: #fff;
  background: #345073;
}

input, select, textarea {
  border: 1px solid rgba(185, 208, 242, .42);
  border-radius: .3rem;
  color: #17243b;
  background: rgba(248, 251, 255, .96);
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(17, 185, 235, .25);
  border-color: var(--weather-cyan);
}
label { color: #dce8fa; }
.filter-date { color: var(--weather-muted); }
.filter-panel .filters { grid-template-columns: minmax(180px, 1.3fr) minmax(150px, 1fr) minmax(145px, 1fr) minmax(145px, 1fr) auto auto; }

.badge.info {
  color: #bff4ff;
  background: rgba(8, 139, 202, .3);
}
.badge.info::before { content: "◉"; }
.observation-list .card { transition: transform .2s ease, border-color .2s ease; }
.observation-list .card:hover {
  transform: translateY(-2px);
  border-color: rgba(17, 185, 235, .75);
}
.detail-list div { border-bottom-color: rgba(179, 205, 242, .2); }
.detail-list dt { color: var(--weather-muted); }
.detail-list dd { color: #fff; }

.footer {
  margin-top: 0;
  border-top: 1px solid rgba(179, 205, 242, .2);
  color: var(--weather-muted);
  background: rgba(3, 11, 29, .82);
}

@media (max-width: 760px) {
  .site-nav { min-height: auto; padding: .7rem 0; }
  .agency-emblem { width: 2.8rem; height: 2.8rem; border-width: .3rem; }
  .agency-brand { font-size: .95rem; }
  .service-alert { font-size: .8rem; }
  .service-alert a { display: none; }
  main > .container { padding-top: 1.5rem; }
}

/* ================= Current forecast dashboard ================= */

.forecast-page {
  min-height: calc(100vh - 14rem);
  background: linear-gradient(180deg, transparent, rgba(2, 12, 33, .32));
}
.forecast-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem 0 1.5rem;
}
.forecast-kicker {
  display: inline-block;
  margin-bottom: .65rem;
  padding: .45rem .75rem;
  border-radius: .2rem;
  color: #fff;
  background: var(--weather-cyan);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .12em;
}
.forecast-heading h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.3rem);
  font-weight: 800;
}
.forecast-heading p {
  max-width: 38rem;
  margin: .6rem 0 0;
  color: var(--weather-muted);
}
.forecast-station-filter {
  min-width: 15rem;
}
.forecast-station-filter label {
  display: block;
  margin-bottom: .4rem;
  color: var(--weather-muted);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.forecast-station-filter select { width: 100%; }
.forecast-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-bottom: 1rem;
  padding: .75rem 1rem;
  border-left: 3px solid var(--weather-cyan);
  color: var(--weather-muted);
  background: rgba(12, 36, 78, .55);
  font-size: .86rem;
}
.forecast-meta strong { color: #fff; }
.forecast-live-dot::before {
  display: inline-block;
  width: .5rem;
  height: .5rem;
  margin-right: .35rem;
  border-radius: 50%;
  content: "";
  background: #3be58b;
  box-shadow: 0 0 10px #3be58b;
}
.forecast-days {
  display: grid;
  gap: 1rem;
}
.forecast-day-card {
  overflow: hidden;
  border: 1px solid var(--weather-border);
  border-radius: .6rem;
  background: rgba(11, 29, 63, .72);
  box-shadow: 0 15px 40px rgba(0, 0, 0, .18);
}
.forecast-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(179, 205, 242, .18);
  background: linear-gradient(90deg, rgba(29, 58, 112, .7), rgba(16, 42, 86, .35));
}
.forecast-day-name {
  color: var(--weather-cyan);
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.forecast-day-header h2 {
  margin: .25rem 0 0;
  color: #fff;
  font-size: 1.3rem;
}
.forecast-extremes {
  display: flex;
  gap: .8rem;
}
.forecast-extremes span {
  display: grid;
  gap: .2rem;
  min-width: 4.4rem;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
}
.forecast-extremes small {
  color: var(--weather-muted);
  font-size: .62rem;
  letter-spacing: .1em;
}
.forecast-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.forecast-slot {
  min-height: 12rem;
  padding: 1.1rem 1.25rem;
  border-right: 1px solid rgba(179, 205, 242, .16);
}
.forecast-slot:last-child { border-right: 0; }
.forecast-slot-active { background: linear-gradient(145deg, rgba(16, 88, 147, .5), rgba(13, 37, 78, .34)); }
.forecast-slot-time {
  color: #fff;
  font-weight: 900;
}
.forecast-slot-time small {
  color: var(--weather-muted);
  font-size: .62rem;
  letter-spacing: .08em;
}
.forecast-temperature {
  margin-top: .8rem;
  color: #fff;
  font-size: 3.1rem;
  font-weight: 800;
  line-height: 1;
}
.forecast-temperature sup { font-size: 1.2rem; }
.forecast-missing { color: var(--weather-muted); }
.forecast-condition {
  margin-top: .5rem;
  color: var(--weather-muted);
  font-size: .8rem;
}
.forecast-slot-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  margin-top: 1.1rem;
  color: #dbe9fc;
  font-size: .78rem;
}
.forecast-slot-stats b { color: var(--weather-cyan); }
.forecast-empty {
  padding: 3rem;
  text-align: center;
  border: 1px solid var(--weather-border);
  background: var(--weather-panel);
}

@media (max-width: 760px) {
  .forecast-heading { display: block; }
  .forecast-station-filter { min-width: 0; margin-top: 1rem; }
  .forecast-day-header { align-items: flex-start; }
  .forecast-slots { grid-template-columns: 1fr; }
  .forecast-slot { min-height: auto; border-right: 0; border-bottom: 1px solid rgba(179, 205, 242, .16); }
  .forecast-slot:last-child { border-bottom: 0; }
}
