/* =========================
   BASE RESET
========================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #e3f2fd;
  color: #111;
  text-align: center;
  padding: 30px;
  overflow-x: hidden;
  transition: background 0.6s ease, color 0.4s ease;
}

/* =========================
   APP CONTAINER
========================= */

.app {
  max-width: 420px;
  margin: auto;
  position: relative;
  z-index: 5;
}

/* =========================
   CONTROLS
========================= */

input, button {
  padding: 10px;
  margin: 6px;
  border-radius: 6px;
  border: none;
  font-size: 16px;
}

button {
  cursor: pointer;
}

/* =========================
   WEATHER SUMMARY
========================= */

.weather-output {
  margin: 16px auto;
  padding: 12px 16px;
  max-width: 320px;
  line-height: 1.6;
}

.weather-output .line {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 4px 0;
}

/* =========================
   FORECAST CARDS
========================= */

#forecast {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

#hourlyForecast {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px 6px;
  scroll-snap-type: x mandatory;
}

#hourlyForecast .day {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.day {
  background: white;
  padding: 10px;
  border-radius: 8px;
  width: 120px;
  color: #111;
}

/* =========================
   ANIMATION LAYERS
========================= */

.weather-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* =========================
   SUNNY
========================= */

body.sunny {
  background: linear-gradient(270deg, #fceabb, #f8b500, #fceabb);
  background-size: 600% 600%;
  animation: sunnyMove 15s ease infinite;
}

@keyframes sunnyMove {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* =========================
   CLOUDY (VISIBLE MOVEMENT)
========================= */

body.cloudy {
  background: #bcbcbc;
}

body.cloudy .weather-layer {
  background:
    radial-gradient(circle at 10% 30%, rgba(255,255,255,0.9) 0 22%, transparent 28%),
    radial-gradient(circle at 40% 50%, rgba(255,255,255,0.8) 0 26%, transparent 34%),
    radial-gradient(circle at 70% 35%, rgba(255,255,255,0.85) 0 24%, transparent 32%);
  filter: blur(24px);
  animation: cloudsMove 40s linear infinite;
}

@keyframes cloudsMove {
  from { transform: translateX(-10%); }
  to   { transform: translateX(10%); }
}

/* =========================
   SNOW (CLEAR FALLING)
========================= */

body.snowy {
  background: #dbeeff;
}

body.snowy .weather-layer {
  background: transparent;
}

body.snowy .weather-layer::before {
  content: "";
  position: absolute;
  top: -100vh;
  left: 0;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  box-shadow:
    5vw 0,
    12vw 20vh,
    18vw 40vh,
    26vw 60vh,
    34vw 30vh,
    42vw 50vh,
    50vw 10vh,
    58vw 35vh,
    66vw 70vh,
    74vw 25vh,
    82vw 45vh,
    90vw 15vh,
    98vw 55vh;
  animation: snowFall 14s linear infinite;
}

@keyframes snowFall {
  from { transform: translateY(-100vh) translateX(0); }
  to   { transform: translateY(200vh) translateX(6vw); }
}

/* =========================
   RAIN
========================= */

body.rainy {
  background: linear-gradient(135deg, #4a6ba1, #34527a);
  color: #eef4f7;
}

body.rainy .weather-layer::before {
  content: "";
  position: absolute;
  top: -60vh;
  left: 0;
  width: 1px;
  height: 140px;
  background: transparent;
  box-shadow:
    5vw 0 rgba(255,255,255,.6),
    15vw 40px rgba(255,255,255,.5),
    25vw -30px rgba(255,255,255,.6),
    35vw 60px rgba(255,255,255,.5),
    45vw -20px rgba(255,255,255,.6),
    55vw 30px rgba(255,255,255,.5),
    65vw -10px rgba(255,255,255,.6),
    75vw 50px rgba(255,255,255,.5),
    85vw -40px rgba(255,255,255,.6),
    95vw 20px rgba(255,255,255,.5);
  animation: rainFall 0.8s linear infinite;
}

@keyframes rainFall {
  from { transform: translateY(-140vh); }
  to   { transform: translateY(140vh); }
}

/* =========================
   CLEAR NIGHT + STARS
========================= */

body.clear-night {
  background: linear-gradient(135deg, #0b0c22, #1a1b3d);
  color: #ccd6f6;
}

body.clear-night .weather-layer {
  background:
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(1.5px 1.5px at 80% 40%, white, transparent),
    radial-gradient(1px 1px at 50% 70%, white, transparent);
  animation: starsTwinkle 6s ease-in-out infinite;
}

@keyframes starsTwinkle {
  0%,100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* =========================
   UV BADGE (RESTORED)
========================= */

.uv-badge {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: bold;
  margin-top: 8px;
}

.uv-main {
  font-size: 1em;
}

.uv-advice {
  font-size: 0.85em;
  margin-top: 4px;
}

.uv-low { background: #2ecc71; color: #000; }
.uv-moderate { background: #f1c40f; color: #000; }
.uv-high { background: #e67e22; color: #000; }
.uv-very-high { background: #e74c3c; color: #fff; }
.uv-extreme { background: #8e44ad; color: #fff; }


/* =========================
   SCROLLBAR
========================= */

#hourlyForecast::-webkit-scrollbar {
  height: 8px;
}

#hourlyForecast::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
}
/*==========================
    ALERT STYLES
========================== */


.alert {
  margin: 12px auto;
  padding: 12px;
  border-radius: 8px;
  max-width: 360px;
  font-weight: bold;
}

.alert-yellow { background: #fff3cd; color: #664d03; }
.alert-amber  { background: #ffe0b2; color: #7a3e00; }
.alert-red    { background: #f8d7da; color: #842029; }

/* Nimbus logo layout */
.logo {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

/* 🌿 Outside score base */
.outside-score {
  margin: 10px auto;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: bold;
  width: fit-content;
  transition: background 0.4s ease, color 0.4s ease;
}

/* 🟢 Great */
.outside-score.good {
  background: rgba(76, 175, 80, 0.2);
  color: #2e7d32;
}

/* 🟡 Okay */
.outside-score.okay {
  background: rgba(255, 193, 7, 0.25);
  color: #8a6d00;
}

/* 🔴 Poor */
.outside-score.bad {
  background: rgba(244, 67, 54, 0.25);
  color: #b71c1c;
}

/* Dark mode tweaks (optional but nice) */
body.clear-night .outside-score.good,
body[data-theme="dark"] .outside-score.good {
  background: rgba(76, 175, 80, 0.3);
  color: #a5d6a7;
}

body.clear-night .outside-score.okay,
body[data-theme="dark"] .outside-score.okay {
  background: rgba(255, 193, 7, 0.3);
  color: #ffe082;
}

body.clear-night .outside-score.bad,
body[data-theme="dark"] .outside-score.bad {
  background: rgba(244, 67, 54, 0.3);
  color: #ef9a9a;
}

/* 🗺️ Map */
.map {
  width: 100%;
  max-width: 600px;
  height: 300px;
  margin: 20px auto;
  border-radius: 12px;
  overflow: hidden;
}

.hidden {
  display: none;
}



/* 🌙 FORCE DARK MODE OVERRIDES */
body.dark,
body.dark.sunny,
body.dark.cloudy,
body.dark.rainy,
body.dark.snowy,
body.dark.clear-night {
  background: #121212 !important;
  color: #e0e0e0;
  animation: none !important;
}

/* Cards in dark mode */
body.dark .day {
  background: #1e1e1e;
  color: #e0e0e0;
}

/* Inputs & buttons */
body.dark input,
body.dark button {
  background: #2a2a2a;
  color: #e0e0e0;
  border: none;
}
