/* ============================================================
   90s WEATHER CHANNEL — Retro CSS
   ============================================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --deep-navy: #001428;
  --dark-blue: #002244;
  --mid-blue: #003366;
  --teal: #006688;
  --cyan: #00bcd4;
  --gold: #ffd740;
  --yellow: #ffeb3b;
  --alert-red: #ff1744;
  --warm-orange: #ff6d00;
  --white: #f0f0f0;
  --off-white: #ccd6dd;
  --panel-bg: rgba(0, 34, 68, 0.82);
  --glow-blue: rgba(0, 188, 212, 0.35);
  --scan-opacity: 0.06;
  --font-mono: 'Courier New', Courier, monospace;
  --font-sans: 'Segoe UI', 'Arial Black', Tahoma, sans-serif;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  color: var(--white);
  background: linear-gradient(170deg, var(--deep-navy) 0%, var(--dark-blue) 40%, var(--teal) 100%);
  height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ---------- CRT Scan-line Overlay ---------- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, var(--scan-opacity)) 2px,
      rgba(0, 0, 0, var(--scan-opacity)) 4px);
}

/* ---------- Header / Title Bar ---------- */
.header {
  background: linear-gradient(90deg, var(--mid-blue), var(--teal));
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--cyan);
  box-shadow: 0 2px 20px rgba(0, 188, 212, 0.25);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo .logo-icon {
  width: 42px;
  height: 42px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--deep-navy);
  font-weight: 900;
  box-shadow: 0 0 12px rgba(255, 215, 64, 0.5);
}

.header-logo h1 {
  font-size: 1.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--cyan), 0 0 30px rgba(0, 188, 212, 0.3);
}

.header-logo h1 span {
  color: var(--gold);
}

/* ---------- Search Bar ---------- */
.search-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-area input {
  background: rgba(0, 20, 40, 0.7);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  color: var(--white);
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  width: 240px;
  outline: none;
  transition: box-shadow .2s;
}

.search-area input::placeholder {
  color: var(--off-white);
  opacity: .6;
}

.search-area input:focus {
  box-shadow: 0 0 8px var(--cyan);
}

.btn {
  background: linear-gradient(180deg, var(--cyan), var(--teal));
  color: var(--deep-navy);
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: filter .15s, transform .1s;
}

.btn:hover {
  filter: brightness(1.2);
  transform: scale(1.04);
}

.btn:active {
  transform: scale(0.97);
}

.btn-geo {
  background: linear-gradient(180deg, var(--gold), var(--warm-orange));
  font-size: 1rem;
  padding: 8px 12px;
}

/* ---------- Loading Overlay ---------- */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 20, 40, 0.88);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 5px solid var(--mid-blue);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay p {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% {
    opacity: .4;
  }
}

/* ---------- Location / Clock Bar ---------- */
.location-bar {
  background: linear-gradient(90deg, var(--deep-navy), var(--dark-blue));
  padding: 6px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-bottom: 2px solid var(--teal);
  flex-shrink: 0;
}

.location-bar .loc-name {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 1px;
}

.location-bar .clock {
  color: var(--cyan);
}

/* ---------- Main Content ---------- */
.main-content {
  position: relative;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Panel system — only one visible at a time */
.panel {
  display: none;
  flex: 1;
  animation: fadeSlide .6s ease-out;
}

.panel.active {
  display: flex;
  flex-direction: column;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Panel Navigation Dots ---------- */
.panel-nav {
  text-align: center;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.panel-nav button {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--cyan);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background .2s, box-shadow .2s;
}

.panel-nav button.active {
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.panel-nav button:hover {
  background: rgba(0, 188, 212, 0.2);
}

/* ---------- Section Titles ---------- */
.section-title {
  font-size: 1.15rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--gold);
  margin-bottom: 16px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--teal);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon {
  font-size: 1.3rem;
}

/* ---------- Common Panel Grids ---------- */
.conditions-grid,
.forecast-grid,
.alerts-list,
.water-grid,
.advisory-grid,
.radar-grid {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.ws-conditions-container {
  background: #2b56aa;
  border: 4px solid #6c8cd5;
  border-radius: 4px;
  padding: 24px 34px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  display: flex;
  flex: 1;
  justify-content: space-between;
  font-family: Arial, Helvetica, sans-serif;
  color: #ffffff;
  min-height: 300px;
}

.ws-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ws-temp {
  font-size: 5rem;
  line-height: 1;
  text-shadow: 2px 2px 0px #000000;
  margin-bottom: 10px;
}

.ws-sky {
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 2px 2px 0px #000000;
  margin-bottom: 20px;
}

.ws-icon {
  font-size: 5.5rem;
  margin-bottom: 24px;
  filter: drop-shadow(4px 4px 0px #000000);
}

.ws-wind {
  font-size: 1.8rem;
  font-weight: bold;
  text-shadow: 2px 2px 0px #000000;
}

.ws-wind-val {
  margin-left: 10px;
}

.ws-right {
  flex: 1.2;
  display: flex;
  flex-direction: column;
}

.ws-location {
  color: #ffff00;
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 2px 2px 0px #000000;
  text-align: left;
  margin-bottom: 20px;
}

.ws-stats {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ws-row {
  display: flex;
  justify-content: space-between;
  font-size: 2.1rem;
  font-weight: bold;
  text-shadow: 2px 2px 0px #000000;
}

.ws-label {
  text-align: left;
}

.ws-val {
  text-align: right;
}

/* ---------- Extended Forecast Panel (WS4000) ---------- */

.ws-forecast-container {
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.ws-fcst-header {
  background: var(--teal);
  color: #ffff00;
  text-align: center;
  font-size: 2.2rem;
  font-weight: 900;
  padding: 10px 0;
  text-transform: uppercase;
  border-bottom: 3px solid #6c8cd5;
}

.ws-fcst-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.ws-fcst-body::-webkit-scrollbar {
  width: 10px;
}

.ws-fcst-body::-webkit-scrollbar-thumb {
  background: var(--teal);
  border-radius: 5px;
}

.ws-fcst-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.ws-fcst-row {
  display: flex;
  align-items: center;
  padding: 15px 40px;
  border-bottom: 2px solid rgba(108, 140, 213, 0.4);
  font-size: 1.8rem;
  font-weight: bold;
  text-shadow: 2px 2px 0px #000000;
}

.ws-fcst-row:last-child {
  border-bottom: none;
}

.ws-fcst-day {
  flex: 0 0 100px;
  color: #ffff00;
  text-transform: uppercase;
}

.ws-fcst-icon {
  flex: 0 0 80px;
  font-size: 2.5rem;
  text-align: center;
  filter: drop-shadow(2px 2px 0px #000000);
}

.ws-fcst-desc {
  flex: 1;
  padding-left: 20px;
}

.ws-fcst-temps {
  flex: 0 0 120px;
  display: flex;
  justify-content: flex-end;
  gap: 20px;
}

.ws-fcst-high {
  color: #ffff00;
}

.ws-fcst-low {
  color: #00ffff;
}

/* ---------- Alerts Panel Removed (Now uses WS-Container) ---------- */

.no-alerts .big-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

/* ---------- Water Conditions Panel ---------- */

.no-water {
  text-align: center;
  padding: 40px;
  color: var(--off-white);
  font-family: var(--font-mono);
}

.no-water .big-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

/* ---------- Scrolling Crawl Bar ---------- */
.crawl-bar {
  z-index: 100;
  background: linear-gradient(90deg, #0a0a0a, #1a1a2e, #0a0a0a);
  border-top: 3px solid var(--gold);
  overflow: hidden;
  height: 38px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.crawl-label {
  background: var(--gold);
  color: var(--deep-navy);
  font-weight: 900;
  font-size: 0.75rem;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  z-index: 2;
}

.crawl-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.crawl-text {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--yellow);
  animation: scroll-crawl var(--crawl-duration, 30s) linear infinite;
  padding-left: 100%;
}

@keyframes scroll-crawl {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

/* ---------- Music Controls ---------- */
.music-controls {
  position: fixed;
  bottom: 48px;
  right: 16px;
  z-index: 200;
  background: var(--panel-bg);
  border: 1px solid var(--teal);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 0 14px rgba(0, 102, 136, 0.3);
  backdrop-filter: blur(6px);
}

.music-controls button {
  background: none;
  border: none;
  color: var(--cyan);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color .15s, transform .1s;
}

.music-controls button:hover {
  color: var(--gold);
  transform: scale(1.15);
}

.music-controls input[type=range] {
  width: 80px;
  accent-color: var(--cyan);
}

.music-controls .music-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--off-white);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---------- Welcome / Intro State ---------- */
.welcome-panel {
  text-align: center;
  padding: 60px 20px;
}

.welcome-panel .big-logo {
  font-size: 4rem;
  margin-bottom: 12px;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px var(--cyan);
  }

  to {
    text-shadow: 0 0 30px var(--cyan), 0 0 60px rgba(0, 188, 212, 0.3);
  }
}

.welcome-panel h2 {
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--gold);
  margin-bottom: 10px;
}

.welcome-panel p {
  font-family: var(--font-mono);
  color: var(--off-white);
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ---------- Marine Alerts Panel (Removed) ---------- */
.ws-scroll-track {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ws-scroll-content {
  position: absolute;
  width: 100%;
  display: flex;
  flex-direction: column;
  animation: scroll-vertical linear infinite;
}

.ws-scroll-marquee {
  position: absolute;
  width: 100%;
  display: flex;
  flex-direction: column;
  animation: scroll-marquee linear infinite;
}

.ws-scroll-track:hover .ws-scroll-content,
.ws-scroll-track:hover .ws-scroll-marquee {
  animation-play-state: paused;
}

@keyframes scroll-vertical {
  0% {
    transform: translateY(100vh);
  }

  100% {
    transform: translateY(-100%);
  }
}

@keyframes scroll-marquee {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-100%);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .header {
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
  }

  .search-area input {
    width: 160px;
  }

  .conditions-grid {
    grid-template-columns: 1fr;
  }

  .temp-display {
    font-size: 3rem;
  }

  .forecast-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .water-grid {
    grid-template-columns: 1fr;
  }

  .music-controls {
    bottom: 44px;
    right: 8px;
    padding: 8px 10px;
  }
}