/* ═══════════════════════════════════════════
   WeatherLens — style.css
   Design: Deep midnight blue + electric amber
   Font: Space Grotesk (display) + DM Mono (data)
═══════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg-base:        #080d1a;
  --bg-card:        rgba(255,255,255,0.04);
  --bg-card-hover:  rgba(255,255,255,0.08);
  --border:         rgba(255,255,255,0.09);
  --border-strong:  rgba(255,255,255,0.16);

  --accent:         #f5a623;       /* electric amber */
  --accent-glow:    rgba(245,166,35,0.25);
  --accent-soft:    rgba(245,166,35,0.12);
  --blue-light:     #7eb8f7;
  --blue-glow:      rgba(126,184,247,0.2);

  --text-primary:   #f0f4ff;
  --text-secondary: #8899bb;
  --text-muted:     #4a5a7a;

  --font-display:   'Space Grotesk', sans-serif;
  --font-mono:      'DM Mono', monospace;

  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated Background Blobs ── */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: driftBlob 18s ease-in-out infinite alternate;
}
.blob-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #1a3a6e, transparent);
  top: -100px; left: -100px;
  animation-delay: 0s;
}
.blob-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #f5a623, transparent);
  top: 30%; right: -80px;
  animation-delay: -6s;
  opacity: 0.10;
}
.blob-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #0a4a8a, transparent);
  bottom: -60px; left: 40%;
  animation-delay: -12s;
}
@keyframes driftBlob {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.08); }
}

/* ── App Wrapper ── */
.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ══════════════════════════
   NAVBAR
══════════════════════════ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-icon { font-size: 22px; }
.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.unit-toggle {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 4px;
  gap: 2px;
}
.unit-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
}
.unit-btn.active {
  background: var(--accent);
  color: #1a0d00;
}
.toggle-divider {
  width: 1px;
  height: 14px;
  background: var(--border-strong);
}

/* ══════════════════════════
   HERO SECTION
══════════════════════════ */
.hero-section {
  margin-bottom: 40px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 36px;
  color: var(--text-primary);
}
.hero-accent {
  color: var(--accent);
  display: inline-block;
}

/* API Key Strip */
.api-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 14px;
  transition: border var(--transition);
}
.api-strip:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.api-icon { color: var(--accent); font-size: 14px; }
.api-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.5px;
}
.api-input::placeholder { color: var(--text-muted); }
.api-link {
  font-size: 12px;
  color: var(--blue-light);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.8;
  transition: opacity var(--transition);
}
.api-link:hover { opacity: 1; }

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 8px 8px 8px 22px;
  gap: 12px;
  transition: all var(--transition);
  margin-bottom: 20px;
}
.search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 8px 32px rgba(0,0,0,0.3);
  background: rgba(255,255,255,0.07);
}
.search-icon { color: var(--text-muted); font-size: 16px; }
.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
}
.search-input::placeholder { color: var(--text-muted); }
.search-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #1a0d00;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.search-btn:hover {
  background: #ffbe45;
  transform: scale(1.08);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Quick Cities */
.quick-cities {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.qc-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}
.qc-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
}
.qc-pill:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ══════════════════════════
   ERROR & LOADING
══════════════════════════ */
.error-banner {
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(220, 60, 60, 0.12);
  border: 1px solid rgba(220, 60, 60, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  color: #ff8a8a;
  font-size: 14px;
  margin-bottom: 24px;
  animation: slideDown 0.3s ease;
}
.error-banner.show { display: flex; }

.loading-state {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 0;
  color: var(--text-secondary);
  font-size: 15px;
}
.loading-state.show { display: flex; }

.loader-ring {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════
   RESULT SECTION
══════════════════════════ */
.result-section {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeUp 0.5s ease;
}
.result-section.show { display: flex; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════
   CURRENT WEATHER CARD
══════════════════════════ */
.current-weather-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}
.current-weather-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.7;
}

/* LEFT SIDE */
.cw-location {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.cw-city {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.cw-country {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 10px;
  font-weight: 500;
}

.cw-temp-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}
.cw-temp {
  font-size: clamp(4rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: -4px;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cw-icon { font-size: clamp(3rem, 6vw, 4.5rem); }

.cw-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-transform: capitalize;
  margin-bottom: 10px;
  font-weight: 400;
}
.cw-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
}
.dot-sep { opacity: 0.4; }

/* RIGHT SIDE: Stats panel */
.cw-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: background var(--transition);
  min-width: 110px;
}
.stat-item:hover { background: var(--bg-card-hover); }
.stat-icon-wrap {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  font-size: 13px;
}
.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
  margin-bottom: 2px;
}
.stat-val {
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* ══════════════════════════
   SUN ROW
══════════════════════════ */
.sun-row {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 32px;
  overflow: hidden;
}
.sun-card {
  flex: 1;
  text-align: center;
}
.sun-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.sun-emoji { font-size: 32px; margin-bottom: 8px; }
.sun-time {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
}

.sun-divider {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 80px;
}
.sun-arc {
  width: 100%;
  height: 60px;
  border-top: 2px dashed rgba(245,166,35,0.3);
  border-radius: 50% 50% 0 0;
  position: relative;
  margin: 0 16px;
}
.sun-ball {
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: -8px;
  box-shadow: 0 0 12px var(--accent);
  transition: left 0.8s ease;
}

/* ══════════════════════════
   BLOCK HEADER (shared)
══════════════════════════ */
.block-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.block-header i { color: var(--accent); }

/* ══════════════════════════
   5-DAY FORECAST
══════════════════════════ */
.forecast-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.forecast-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 12px;
  text-align: center;
  cursor: default;
  transition: all var(--transition);
}
.forecast-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(245,166,35,0.1);
}
.f-day {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.f-date {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
  opacity: 0.6;
}
.f-icon { font-size: 32px; margin: 6px 0 10px; }
.f-max {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}
.f-min {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 3px;
}
.f-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: capitalize;
  opacity: 0.7;
}

/* ══════════════════════════
   HOURLY STRIP
══════════════════════════ */
.hourly-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
}

.hourly-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.hourly-strip::-webkit-scrollbar { height: 4px; }
.hourly-strip::-webkit-scrollbar-track { background: transparent; }
.hourly-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.hour-card {
  flex-shrink: 0;
  min-width: 72px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  text-align: center;
  transition: all var(--transition);
  cursor: default;
}
.hour-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--blue-light);
  transform: translateY(-3px);
}
.hour-card.now {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.hour-time {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.hour-card.now .hour-time { color: var(--accent); }
.hour-icon { font-size: 22px; margin: 4px 0 8px; }
.hour-temp {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}
.hour-rain {
  font-size: 10px;
  color: var(--blue-light);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ══════════════════════════
   FOOTER
══════════════════════════ */
.app-footer {
  text-align: center;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* ══════════════════════════
   RESPONSIVE
══════════════════════════ */
@media (max-width: 768px) {
  .current-weather-card {
    grid-template-columns: 1fr;
    padding: 24px 22px;
  }
  .cw-right {
    grid-template-columns: repeat(3, 1fr);
  }
  .forecast-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .sun-row { padding: 20px 16px; }
  .sun-arc { margin: 0 8px; }
  .hourly-block, .forecast-block { padding: 22px 18px; }
}

@media (max-width: 480px) {
  .forecast-grid { grid-template-columns: repeat(2, 1fr); }
  .cw-right { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 1.8rem; }
  .current-weather-card { padding: 20px 18px; }
}