/* ================================================================
   WEATHERWHISPER — GLOBAL STYLESHEET
   Fluid color-shifting glassmorphism aesthetic.
================================================================ */

:root {
  /* These variables will be dynamically modified by app.js based on temperature */
  --bg-hue: 220; /* 220 for cold blue, 0 for hot red */
  --bg-sat: 60%;
  --bg-lit: 12%;
  
  --bg-base:        hsl(var(--bg-hue), var(--bg-sat), var(--bg-lit));
  --bg-card:        rgba(15, 15, 20, 0.5);
  --bg-card-hover:  rgba(25, 25, 30, 0.7);

  --accent-primary: hsl(var(--bg-hue), 80%, 60%);
  --accent-white:   #ffffff;

  --text-primary:   #f4f4f8;
  --text-secondary: hsl(var(--bg-hue), 20%, 75%);
  --text-muted:     #5a6080;

  --border:         rgba(255, 255, 255, 0.08);

  --sp-xs:  0.25rem; --sp-sm:  0.5rem; --sp-md:  1rem; --sp-lg:  1.5rem; --sp-xl:  2rem; --sp-2xl: 3rem;
  --font-sans: 'InterVariable', 'Inter', system-ui, sans-serif;
  --font-mono: 'InterVariable', 'Inter', system-ui, sans-serif;

  --r-sm:   6px; --r-md:   12px; --r-lg:   20px; --r-full: 9999px;
  --shadow-card: 0 8px 32px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
  --t-fast: 0.15s ease; --t-med: 0.5s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  background-image: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
  display: flex; flex-direction: column;
  transition: background-color var(--t-med);
}

h1, h2, h3 { color: var(--text-primary); font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }

.site-header { padding: var(--sp-xl) var(--sp-md); text-align: center; }
.header-inner { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: var(--sp-md); }
.logo-icon { width: 64px; height: 64px; filter: drop-shadow(0 0 12px var(--accent-primary)); transition: filter var(--t-med); }

.header-text h1 {
  font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 700; letter-spacing: -0.02em;
  color: var(--accent-white); line-height: 1.1;
}
.tagline { color: var(--text-secondary); font-size: 0.95rem; text-transform: uppercase; margin-top: var(--sp-xs); letter-spacing: 0.06em; transition: color var(--t-med); }

.main-content { flex: 1; padding: 0 var(--sp-md) var(--sp-2xl); display: flex; flex-direction: column; align-items: center; gap: var(--sp-xl); }

.card {
  background: var(--bg-card); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-xl);
  box-shadow: var(--shadow-card); position: relative; overflow: hidden; width: 100%; max-width: 600px;
}

/* Input Labels */
.input-label { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--sp-xs); text-align: left; width: 100%; }

/* City Select */
.city-select-wrapper { margin-bottom: var(--sp-lg); }
.city-select {
  width: 100%; padding: 1rem; border-radius: var(--r-md); background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  color: var(--text-primary); font-size: 1rem; font-family: var(--font-sans); cursor: text; transition: border-color var(--t-fast);
}
.city-select:focus { outline: none; border-color: var(--accent-primary); }
.city-contact { text-align: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.6rem; }
.city-contact a { color: var(--text-secondary); text-decoration: underline; transition: color var(--t-fast); }
.city-contact a:hover { color: var(--accent-white); }

/* Date Range */
.date-range-wrapper { display: flex; align-items: center; gap: var(--sp-md); margin-bottom: var(--sp-xl); width: 100%; }
.date-input { flex: 1; width: 100%; padding: 1rem; border-radius: var(--r-md); background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: var(--text-primary); font-family: var(--font-sans); font-size: 1rem; color-scheme: dark; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.date-input:focus { outline: none; border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(255,255,255,0.1); }
.date-input::-webkit-calendar-picker-indicator { cursor: pointer; filter: invert(0.8) sepia(0) saturate(0) hue-rotate(0deg); opacity: 0.7; transition: opacity var(--t-fast); }
.date-input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.date-separator { color: var(--text-muted); font-weight: 600; padding: 0 0.5rem; }

/* Range View */
.range-title { font-size: 1rem; margin-bottom: var(--sp-sm); color: var(--text-secondary); text-align: center; }
.range-list { max-height: 250px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-xs); padding-right: 0.5rem; }
.range-item { display: flex; justify-content: space-between; background: rgba(0,0,0,0.2); padding: 0.75rem 1rem; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,0.03); }
.range-date { color: var(--accent-white); font-weight: 600; font-variant-numeric: tabular-nums; }
.range-temps { color: var(--text-secondary); display: flex; gap: 1rem; }
.range-min { color: #88ccff; }
.range-max { color: #ff8855; font-weight: 600; }

/* Result Display */
.result-box { text-align: center; padding-top: var(--sp-xs); margin-bottom: var(--sp-lg); }
.result-label { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: var(--sp-xs); transition: color var(--t-med); text-transform: uppercase; letter-spacing: 0.05em; }
.result-temp { font-size: clamp(3rem, 10vw, 5rem); font-weight: 800; color: var(--accent-white); font-variant-numeric: tabular-nums; line-height: 1; text-shadow: 0 0 20px var(--accent-primary); transition: text-shadow var(--t-med); }

/* Range Slider */
.slider-container { margin-bottom: var(--sp-xl); display: flex; flex-direction: column; gap: var(--sp-sm); }
.slider-label { display: flex; justify-content: space-between; font-weight: 600; font-size: 0.9rem; color: var(--text-secondary); }
.slider-val { color: var(--accent-white); font-variant-numeric: tabular-nums; }

input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; margin: 10px 0; }
input[type=range]:focus { outline: none; }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 8px; cursor: pointer; background: rgba(255,255,255,0.1); border-radius: 4px; }
input[type=range]::-webkit-slider-thumb { height: 24px; width: 24px; border-radius: 50%; background: var(--accent-white); cursor: pointer; -webkit-appearance: none; margin-top: -8px; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }

/* App Switcher Carousel */
.app-switcher-container { padding: 3rem 0; text-align: center; margin-top: 2rem; border-top: 1px solid var(--border); }
.switcher-title { font-size: 1.2rem; margin-bottom: 1.5rem; color: var(--text-secondary); font-weight: 600; letter-spacing: -0.5px; }
.app-switcher-marquee { display: flex; overflow: hidden; padding-bottom: 1rem; width: 100%; }
.app-switcher-track { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.app-switcher-marquee:hover .app-switcher-track { animation-play-state: paused; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-10%); } }
.switcher-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; color: var(--text-primary); text-decoration: none; font-weight: 600; transition: transform 0.2s, background 0.2s, box-shadow 0.2s; white-space: nowrap; flex-shrink: 0; margin-right: 1rem; }
.switcher-card:hover { transform: translateY(-3px); background: var(--bg-card-hover); box-shadow: 0 4px 12px var(--shadow-card); }
.switcher-card img { width: 20px !important; height: 20px !important; opacity: 0.8; }
@media (max-width: 768px) { .app-switcher-marquee { padding: 0.5rem 1rem 1.5rem 1rem; } }

.site-footer { background: var(--bg-base); border-top: 1px solid var(--border); padding: 4rem 1.5rem 2rem; margin-top: auto; transition: background-color var(--t-med); }
.footer-inner { max-width: 680px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3rem; flex-wrap: wrap; gap: 2rem; }
.footer-brand { max-width: 320px; }
.footer-logo { font-family: var(--font-sans); font-size: 1.5rem; font-weight: 700; color: var(--text-primary); text-decoration: none; display: inline-block; margin-bottom: 0.5rem; }
.footer-dot { color: var(--accent-primary); transition: color var(--t-med); }
.footer-tagline { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; transition: color var(--t-med); }
.footer-powered p { color: var(--text-secondary); font-size: 0.88rem; text-align: right; max-width: 250px; line-height: 1.6; transition: color var(--t-med); }

.footer-bottom { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1rem; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 2rem; text-align: center; }
.footer-social { display: flex; gap: 1.25rem; }
.footer-social a { color: var(--text-muted); transition: color var(--t-fast), transform var(--t-fast); }
.footer-social a:hover { color: var(--text-primary); transform: translateY(-2px); }
.footer-bottom p { color: var(--text-muted); font-size: 0.85rem; }
.footer-bottom a { color: var(--text-secondary); text-decoration: none; transition: color var(--t-med); }
.footer-bottom a:hover { color: var(--text-primary); text-decoration: underline; }
.footer-privacy, .footer-ai { opacity: 0.7; }
