/* ============================================================
   KRDWEATHER.HELP — Premium Dark Design System
   Author: Areen.Saber
   ============================================================ */

/* ── Imports & Base Reset ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ─ Core palette ─ */
  --black:          #000000;
  --black-soft:     #04040a;

  /* ─ Glass surfaces ─ */
  --s1:             rgba(255,255,255,0.028);
  --s2:             rgba(255,255,255,0.048);
  --s-hover:        rgba(255,255,255,0.062);

  /* ─ Borders ─ */
  --b1:             rgba(255,255,255,0.055);
  --b2:             rgba(255,255,255,0.10);
  --b3:             rgba(255,255,255,0.16);

  /* ─ Brand accents ─ */
  --cyan:           #00d4ff;
  --cyan-10:        rgba(0,212,255,0.10);
  --cyan-20:        rgba(0,212,255,0.20);
  --purple:         #a855f7;
  --purple-10:      rgba(168,85,247,0.10);
  --purple-20:      rgba(168,85,247,0.20);
  --emerald:        #10b981;
  --emerald-10:     rgba(16,185,129,0.10);
  --amber:          #f59e0b;
  --amber-10:       rgba(245,158,11,0.10);
  --rose:           #f43f5e;
  --rose-10:        rgba(244,63,94,0.10);
  --orange:         #f97316;
  --lime:           #84cc16;
  --blue:           #3b82f6;
  --blue-10:        rgba(59,130,246,0.10);
  --teal:           #14b8a6;
  --teal-10:        rgba(20,184,166,0.10);
  --yellow:         #eab308;

  /* ─ Text ─ */
  --t1:             #f8fafc;
  --t2:             rgba(248,250,252,0.55);
  --t3:             rgba(248,250,252,0.28);
  --t-label:        rgba(248,250,252,0.38);

  /* ─ Typography ─ */
  --font:           'Inter', system-ui, -apple-system, sans-serif;
  --mono:           'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* ─ Motion ─ */
  --spring:         cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth:         cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast:         150ms var(--smooth);
  --t-base:         300ms var(--smooth);
  --t-slow:         600ms var(--smooth);

  /* ─ Shape ─ */
  --r-sm:           10px;
  --r-md:           16px;
  --r-lg:           20px;
  --r-xl:           28px;

  /* ─ Blur ─ */
  --blur:           blur(24px) saturate(180%);
  --blur-sm:        blur(12px) saturate(160%);

  /* ─ Layout ─ */
  --header-h:       66px;
}

html {
  font-family: var(--font);
  background: var(--black);
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body { min-height: 100vh; background: var(--black); }

img { display: block; }
button { cursor: pointer; font-family: var(--font); }
a { color: inherit; }
a:hover { color: var(--cyan); transition: color var(--t-fast); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ─────────────────────────────────────────────────────────
   AMBIENT BACKGROUND
───────────────────────────────────────────────────────── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  animation: orbDrift linear infinite;
}

.orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle at 50% 50%, rgba(0,212,255,0.22), transparent 65%);
  top: -250px; left: -150px;
  animation-duration: 28s;
  filter: blur(1px);
}

.orb-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle at 50% 50%, rgba(168,85,247,0.18), transparent 65%);
  bottom: 5%; right: -150px;
  animation-duration: 22s;
  animation-delay: -10s;
  filter: blur(1px);
}

.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle at 50% 50%, rgba(16,185,129,0.12), transparent 65%);
  top: 40%; left: 40%;
  transform: translate(-50%,-50%);
  animation-duration: 35s;
  animation-delay: -18s;
}

@keyframes orbDrift {
  0%   { transform: translate(0,0) scale(1); }
  25%  { transform: translate(40px,-25px) scale(1.04); }
  50%  { transform: translate(-25px,35px) scale(0.96); }
  75%  { transform: translate(25px,20px) scale(1.02); }
  100% { transform: translate(0,0) scale(1); }
}

.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.013) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.013) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black, transparent);
}

/* ─────────────────────────────────────────────────────────
   HEADER
───────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 0 24px;
  background: rgba(0,0,0,0.82);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--b1);
  animation: hdrSlide 0.55s var(--smooth) both;
}

@keyframes hdrSlide {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* Brand */
.header-brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.brand-logo { display: flex; align-items: center; gap: 10px; }

.logo-icon { width: 34px; height: 34px; flex-shrink: 0; }

.brand-name {
  font-size: 1.05rem; font-weight: 700; letter-spacing: -0.025em;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-tld { font-weight: 400; opacity: 0.6; }

.live-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.22);
  border-radius: 99px;
}

.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--emerald);
  animation: livePulse 2.2s ease-in-out infinite;
}

@keyframes livePulse {
  0%,100% { opacity:1; transform:scale(1); box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  50%     { opacity:0.8; transform:scale(0.88); box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

.live-text {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.12em;
  color: var(--emerald);
}

/* Search */
.header-center { flex: 1; max-width: 420px; margin: 0 auto; }

.search-wrapper { position: relative; display: flex; align-items: center; }

.search-icon {
  position: absolute; left: 13px;
  width: 15px; height: 15px;
  color: var(--t3); pointer-events: none;
}

.search-input {
  width: 100%; height: 40px; padding: 0 16px 0 38px;
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  color: var(--t1);
  font-family: var(--font); font-size: 0.875rem;
  outline: none;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
  backdrop-filter: var(--blur-sm);
}
.search-input::placeholder { color: var(--t3); }
.search-input:focus {
  border-color: var(--cyan-20);
  background: rgba(0,212,255,0.04);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.07);
}

.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: rgba(6,6,14,0.96);
  backdrop-filter: blur(36px) saturate(180%);
  border: 1px solid var(--b2);
  border-radius: var(--r-md);
  overflow: hidden; z-index: 200;
  display: none;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
}
.search-results.open { display: block; }

.sr-item {
  padding: 12px 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--b1);
  transition: background var(--t-fast);
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--s2); }
.sr-name { font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: 7px; }
.sr-flag { font-size: 1rem; line-height: 1; }
.sr-meta { font-size: 0.72rem; color: var(--t3); }
.sr-pop  { font-size: 0.65rem; color: var(--t3); font-family: var(--mono); }

/* Search section headers (Kurdistan / Global) */
.sr-section-header {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 16px 6px;
  font-size: 0.67rem; font-weight: 600; letter-spacing: 0.09em;
  color: var(--cyan); text-transform: uppercase;
  border-bottom: 1px solid var(--b1);
  background: rgba(0,212,255,0.03);
  pointer-events: none;
}
.sr-section-header svg { width: 11px; height: 11px; stroke: var(--cyan); flex-shrink: 0; }

/* KRD city rows: subtle left accent */
.sr-item-krd {
  border-left: 2px solid rgba(0,212,255,0.28);
  padding-left: 14px;
}
.sr-item-krd:hover { background: rgba(0,212,255,0.06); }

/* "Did you mean…" fuzzy-fallback header */
.sr-fuzzy-hint {
  color: #f59e0b;
  background: rgba(245,158,11,0.04);
}
.sr-fuzzy-hint svg { stroke: #f59e0b; }

/* ─────────────────────────────────────────────────────────
   SEARCH SKELETON (inline shimmer rows while API loads)
───────────────────────────────────────────────────────── */

/* Shimmer bar — reusable inline element */
.sr-sk-bar {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.05) 0%,
    rgba(255,255,255,0.12) 40%,
    rgba(0,212,255,0.07)   50%,
    rgba(255,255,255,0.12) 60%,
    rgba(255,255,255,0.05) 100%
  );
  background-size: 400px 100%;
  animation: srShimmer 1.4s ease-in-out infinite;
}
@keyframes srShimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

/* Flag placeholder circle */
.sr-sk-flag {
  display: inline-block;
  width: 20px; height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255,255,255,0.07);
  animation: srShimmer 1.4s ease-in-out infinite;
}

/* "Searching…" pulse text */
.sr-sk-pulse {
  font-size: 0.66rem; font-weight: 600;
  color: var(--t3);
  letter-spacing: 0.05em;
  animation: srPulse 1.2s ease-in-out infinite;
}
@keyframes srPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1;   }
}

/* Skeleton header override */
.sr-skeleton-hdr {
  color: var(--t3);
  background: transparent;
  gap: 10px;
  padding-bottom: 8px;
}

/* Skeleton rows — staggered slide-in */
.sr-skeleton-row {
  display: flex; align-items: center; gap: 12px;
  pointer-events: none;
  animation: srRowIn 0.25s var(--spring) both;
}
@keyframes srRowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0);     }
}

/* Body inside each skeleton row */
.sr-skeleton-row .sr-body {
  flex: 1; display: flex; flex-direction: column; gap: 0;
}




/* Geo-locate button */
.geo-btn {
  position: absolute; right: 10px;
  width: 28px; height: 28px;
  background: none; border: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--t3);
  border-radius: 6px;
  transition: color var(--t-fast), background var(--t-fast), transform 0.3s var(--spring);
  flex-shrink: 0;
}
.geo-btn svg { width: 16px; height: 16px; }
.geo-btn:hover { color: var(--cyan); background: var(--cyan-10); }
.geo-btn:active { transform: scale(0.88); }
.geo-btn.locating svg { animation: geoSpin 1.2s linear infinite; color: var(--cyan); }
.geo-btn.located  { color: var(--emerald); }

@keyframes geoSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Adjust search input padding to not overlap the geo button */
.search-input { padding-right: 42px; }

/* Search loading spinner (appears inside input while fetching) */
.search-wrapper.searching::after {
  content: '';
  position: absolute;
  right: 42px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px;
  border: 2px solid rgba(0,212,255,0.2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: srSpin 0.7s linear infinite;
  pointer-events: none;
}
@keyframes srSpin { to { transform: translateY(-50%) rotate(360deg); } }


/* Geo toast notification */
.geo-toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  z-index: 999;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.18);
  backdrop-filter: blur(20px);
  border-radius: 99px;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--t2); font-weight: 500;
  opacity: 0;
  transition: transform 0.45s var(--spring), opacity 0.35s ease;
  pointer-events: none;
  white-space: nowrap;
}
.geo-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.geo-toast svg { width: 13px; height: 13px; color: var(--cyan); flex-shrink: 0; }


/* Header right */
.header-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

.location-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--s1); border: 1px solid var(--b1); border-radius: 99px;
  font-size: 0.78rem; font-weight: 500; color: var(--t2);
}
.loc-icon { width: 11px; height: 11px; }

.clock-display {
  font-family: var(--mono); font-size: 0.8rem; font-weight: 400;
  color: var(--t3); letter-spacing: 0.06em;
}

/* ─────────────────────────────────────────────────────────
   DASHBOARD GRID
───────────────────────────────────────────────────────── */
.dashboard {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  padding: 20px 24px 36px;
  max-width: 1700px;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────
   SKELETON LOADING SYSTEM
───────────────────────────────────────────────────────── */

/* Shimmer keyframe */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.sk-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.10) 40%,
    rgba(0,212,255,0.07)   50%,
    rgba(255,255,255,0.10) 60%,
    rgba(255,255,255,0.04) 100%
  );
  background-size: 600px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}

/* Skeleton grid — mirrors dashboard grid */
.skeleton-grid {
  display: contents; /* children flow into the dashboard grid */
  pointer-events: none;
}

/* Skeleton card base */
.sk-card {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  animation: cardReveal 0.5s var(--spring) both;
}

/* Grid placements matching the real cards */
.sk-hero    { grid-column: span 4; grid-row: span 2; }
.sk-aqi     { grid-column: span 5; grid-row: span 2; }
.sk-sun     { grid-column: span 3; grid-row: span 2; }
.sk-metric  { grid-column: span 3; }
.sk-chart   { grid-column: span 12; }

/* Skeleton elements */
.sk-label   { height: 10px; width: 110px; }
.sk-temp    { height: 80px; width: 160px; margin: 8px 0; }
.sk-desc    { height: 14px; width: 100px; }
.sk-divider { height: 1px; background: var(--b1) !important; animation: none !important; }
.sk-row     { display: flex; gap: 12px; align-items: center; }
.sk-pill    { height: 30px; width: 90px; border-radius: 99px; }
.sk-pill-sm { width: 70px; }
.sk-circle  { width: 110px; height: 110px; border-radius: 50%; flex-shrink: 0; }
.sk-aqi-body { display: flex; align-items: center; gap: 22px; }
.sk-aqi-text { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.sk-line    { height: 14px; width: 80%; }
.sk-line-lg { height: 28px; width: 60%; }
.sk-line-sm { height: 10px; width: 90%; }
.sk-arc     { flex: 1; height: 90px; border-radius: 12px; }
.sk-big-num { height: 52px; width: 120px; border-radius: 12px; }
.sk-bar     { height: 6px; border-radius: 99px; margin-top: 4px; }
.sk-compass { width: 64px; height: 64px; border-radius: 50%; margin-top: 4px; }
.sk-chart-area { flex: 1; min-height: 160px; border-radius: 12px; }

/* Apply shimmer to all skeleton elements except dividers */
.sk-label, .sk-temp, .sk-desc, .sk-pill, .sk-circle,
.sk-line, .sk-arc, .sk-big-num, .sk-bar, .sk-compass,
.sk-chart-area { @extend .sk-shimmer; /* fallback below */ }

.sk-label, .sk-temp, .sk-desc, .sk-pill, .sk-circle,
.sk-line, .sk-arc, .sk-big-num, .sk-bar, .sk-compass,
.sk-chart-area {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.10) 40%,
    rgba(0,212,255,0.06)   50%,
    rgba(255,255,255,0.10) 60%,
    rgba(255,255,255,0.04) 100%
  );
  background-size: 600px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* Stagger each skeleton card's shimmer slightly */
.sk-card:nth-child(2)  .sk-label,
.sk-card:nth-child(2)  .sk-circle  { animation-delay: 0.1s; }
.sk-card:nth-child(3)  .sk-label,
.sk-card:nth-child(3)  .sk-arc     { animation-delay: 0.2s; }
.sk-card:nth-child(4)  .sk-big-num { animation-delay: 0.15s; }
.sk-card:nth-child(5)  .sk-big-num { animation-delay: 0.25s; }

/* Fade-out when hidden */
#loading-overlay {
  transition: opacity 0.35s ease;
}
#loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}


/* Error banner */
.error-banner {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: var(--rose-10);
  border: 1px solid rgba(244,63,94,0.2);
  border-radius: var(--r-md);
  color: var(--rose); font-size: 0.875rem;
}
.error-banner svg { width: 18px; height: 18px; flex-shrink: 0; }
.retry-btn {
  margin-left: auto; padding: 6px 18px;
  background: rgba(244,63,94,0.12);
  border: 1px solid rgba(244,63,94,0.28);
  border-radius: 99px; color: var(--rose);
  font-size: 0.8rem; font-weight: 500;
  transition: background var(--t-fast);
}
.retry-btn:hover { background: rgba(244,63,94,0.22); }

/* ─────────────────────────────────────────────────────────
   GLASS CARD — Base
───────────────────────────────────────────────────────── */
.glass-card {
  position: relative;
  background: var(--s1);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  padding: 20px;
  overflow: hidden;
  transition: transform var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
  will-change: transform;
}

.glass-card:hover {
  border-color: var(--b2);
  transform: translateY(-2px);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.35),
    0 0 0 1px rgba(255,255,255,0.03) inset;
}

/* Touch active state (OLED) */
@media (hover: none) {
  .glass-card:active {
    transform: scale(0.97);
    background: rgba(255,255,255,0.05);
    transition: transform 0.1s, background 0.1s;
  }
}

/* Mouse spotlight */
.card-spotlight {
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 0;
}
.glass-card:hover .card-spotlight { opacity: 1; }

/* Card label */
.card-label {
  display: block;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.13em;
  color: var(--t-label); text-transform: uppercase;
  margin-bottom: 14px;
  position: relative; z-index: 1;
}

/* Staggered reveal animation */
.anim-card {
  opacity: 0;
  transform: translateY(22px);
  animation: cardReveal 0.65s var(--spring) forwards;
  animation-delay: calc(var(--delay, 0) * 85ms);
}
@keyframes cardReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────
   GRID SLOT ASSIGNMENTS
───────────────────────────────────────────────────────── */
.card-hero      { grid-column: span 4; grid-row: span 2; }
.card-aqi       { grid-column: span 5; grid-row: span 2; }
.card-sun       { grid-column: span 3; grid-row: span 2; }
.card-metric    { grid-column: span 3; }
.card-pollutant { grid-column: span 3; }
.card-chart     { grid-column: span 12; }
.cache-strip    { grid-column: span 12; }

/* ─────────────────────────────────────────────────────────
   HERO TEMPERATURE CARD
───────────────────────────────────────────────────────── */
.card-hero { display: flex; flex-direction: column; }

.hero-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  position: relative; z-index: 1;
}

.weather-icon-wrap { width: 64px; height: 64px; flex-shrink: 0; }

.weather-icon-img {
  width: 64px; height: 64px;
  filter: drop-shadow(0 0 14px rgba(0,212,255,0.45));
  animation: iconFloat 4.5s ease-in-out infinite;
  object-fit: contain;
}
@keyframes iconFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-7px); }
}

.hero-temp-row {
  display: flex; align-items: flex-start; gap: 6px;
  margin: 10px 0 6px;
  position: relative; z-index: 1;
  flex: 1;
}

.temp-value {
  font-size: clamp(4.5rem, 7vw, 7rem);
  font-weight: 800; line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
}

.temp-unit {
  font-size: 1.6rem; font-weight: 300;
  color: var(--t2); margin-top: 14px;
}

.weather-desc {
  font-size: 0.95rem; font-weight: 500; color: var(--t2);
  position: relative; z-index: 1;
  margin-bottom: auto;
}

.hero-divider {
  height: 1px; background: var(--b1);
  margin: 20px 0 16px;
  position: relative; z-index: 1;
}

.hero-bottom {
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 1;
}

.feels-like-block { display: flex; flex-direction: column; gap: 2px; }
.micro-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--t-label); text-transform: uppercase;
}
.feels-val {
  font-family: var(--mono); font-size: 1.1rem; font-weight: 600;
  color: var(--t1);
}

.temp-range-block { display: flex; gap: 18px; }
.range-item {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 0.9rem; font-weight: 500; color: var(--t2);
}
.range-item svg { width: 10px; height: 10px; }
.range-low  svg { color: #60a5fa; }
.range-high svg { color: #f87171; }

/* ─────────────────────────────────────────────────────────
   AQI CARD
───────────────────────────────────────────────────────── */
.aqi-body {
  display: flex; align-items: center; gap: 22px;
  position: relative; z-index: 1;
}

.aqi-ring-wrap {
  position: relative; width: 110px; height: 110px; flex-shrink: 0;
}
.aqi-svg { width: 100%; height: 100%; }

#aqi-ring-arc {
  transition: stroke-dashoffset 1.5s var(--spring), stroke 0.6s var(--smooth);
}

.aqi-ring-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
}
.aqi-number {
  font-family: var(--mono); font-size: 2rem; font-weight: 700;
  color: var(--t1); line-height: 1;
}
.aqi-unit-label {
  font-size: 0.6rem; color: var(--t3); font-weight: 500; letter-spacing: 0.05em;
}

.aqi-info-block {
  flex: 1; display: flex; flex-direction: column; gap: 8px;
  position: relative; z-index: 1;
}
.aqi-status-text {
  font-size: 1.3rem; font-weight: 700; color: var(--t1);
  transition: color var(--t-base);
}
.aqi-desc-text {
  font-size: 0.76rem; color: var(--t2); line-height: 1.5;
}

.aqi-dot-scale {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 6px;
}
.aqi-dot-pair {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.aqi-dot {
  width: 10px; height: 10px; border-radius: 50%;
  opacity: 0.35;
  transition: opacity var(--t-base), transform var(--t-base);
  flex-shrink: 0;
}
.aqi-dot.active {
  opacity: 1; transform: scale(1.4);
  box-shadow: 0 0 8px currentColor;
}
.aqi-dot-lbl {
  font-size: 0.56rem; color: var(--t3);
  white-space: nowrap; text-align: center;
  font-family: var(--mono);
}

/* ─────────────────────────────────────────────────────────
   SOLAR CYCLE CARD
───────────────────────────────────────────────────────── */
.card-sun { display: flex; flex-direction: column; }

.sun-arc-container {
  flex: 1; display: flex; align-items: center;
  position: relative; z-index: 1;
}
.sun-arc-svg { width: 100%; height: auto; }

#sun-arc-prog { transition: stroke-dashoffset 1.5s ease; }

.sun-times-row {
  display: flex; align-items: center; gap: 10px;
  position: relative; z-index: 1; margin-top: 8px;
}

.sun-time-block {
  flex: 1; display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--b1); border-radius: var(--r-sm);
}
.sun-icon { width: 17px; height: 17px; flex-shrink: 0; }

.sun-label {
  display: block; font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.1em; color: var(--t3); text-transform: uppercase; margin-bottom: 2px;
}
.sun-time {
  display: block; font-family: var(--mono); font-size: 0.95rem; font-weight: 600; color: var(--t1);
}

.sun-divider {
  width: 1px; height: 36px;
  background: var(--b1); flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────
   METRIC CARDS (shared)
───────────────────────────────────────────────────────── */
.card-metric { display: flex; flex-direction: column; }

.metric-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 13px;
  flex-shrink: 0; position: relative; z-index: 1;
}
.metric-icon-wrap svg { width: 17px; height: 17px; }

.accent-cyan    { background: var(--cyan-10);    color: var(--cyan);    border: 1px solid var(--cyan-20); }
.accent-purple  { background: var(--purple-10);  color: var(--purple);  border: 1px solid var(--purple-20); }
.accent-emerald { background: var(--emerald-10); color: var(--emerald); border: 1px solid rgba(16,185,129,0.2); }
.accent-amber   { background: var(--amber-10);   color: var(--amber);   border: 1px solid rgba(245,158,11,0.2); }
.accent-blue    { background: var(--blue-10);    color: var(--blue);    border: 1px solid rgba(59,130,246,0.2); }
.accent-teal    { background: var(--teal-10);    color: var(--teal);    border: 1px solid rgba(20,184,166,0.2); }

.metric-val-row {
  display: flex; align-items: baseline; gap: 4px;
  margin-bottom: 12px;
  position: relative; z-index: 1;
}
.metric-big {
  font-family: var(--mono); font-size: 2.2rem; font-weight: 700;
  color: var(--t1); line-height: 1;
}
.metric-unit { font-size: 0.82rem; color: var(--t3); font-weight: 500; }

.metric-prog-track {
  height: 3px; background: rgba(255,255,255,0.06);
  border-radius: 99px; overflow: hidden;
  margin-bottom: 8px; position: relative; z-index: 1;
}
.metric-prog-fill {
  height: 100%; border-radius: 99px;
  width: 0%; transition: width 1.1s var(--spring);
}

.fill-cyan    { background: linear-gradient(90deg, var(--cyan),    rgba(0,212,255,0.3)); }
.fill-purple  { background: linear-gradient(90deg, var(--purple),  rgba(168,85,247,0.3)); }
.fill-emerald { background: linear-gradient(90deg, var(--emerald), rgba(16,185,129,0.3)); }
.fill-amber   { background: linear-gradient(90deg, var(--amber),   rgba(245,158,11,0.3)); }
.fill-blue    { background: linear-gradient(90deg, var(--blue),    rgba(59,130,246,0.3)); }
.fill-teal    { background: linear-gradient(90deg, var(--teal),    rgba(20,184,166,0.3)); }

.metric-caption {
  font-size: 0.7rem; color: var(--t3);
  position: relative; z-index: 1; margin-top: auto;
}

/* Compass */
.compass-row {
  display: flex; align-items: center; gap: 12px;
  margin-top: 6px; position: relative; z-index: 1;
}
.compass {
  position: relative; width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.02);
}
.compass-needle {
  position: absolute;
  width: 2px; height: 20px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
  left: 50%; top: 50%;
  transform-origin: bottom center;
  transform: translateX(-50%) translateY(-100%) rotate(0deg);
  transition: transform 1.2s var(--spring);
  border-radius: 1px;
}
.cp-n,.cp-s,.cp-e,.cp-w {
  position: absolute; font-size: 0.48rem; font-weight: 700; color: var(--t3);
}
.cp-n { top: 3px;  left: 50%; transform: translateX(-50%); }
.cp-s { bottom: 3px; left: 50%; transform: translateX(-50%); }
.cp-e { right: 3px; top: 50%; transform: translateY(-50%); }
.cp-w { left: 3px;  top: 50%; transform: translateY(-50%); }

.wind-dir-text {
  font-family: var(--mono); font-size: 1.2rem; font-weight: 600; color: var(--emerald);
}

/* ─────────────────────────────────────────────────────────
   POLLUTANT CARDS
───────────────────────────────────────────────────────── */
.card-pollutant { display: flex; flex-direction: column; }

.pollutant-header {
  display: flex; flex-direction: column; gap: 2px;
  position: relative; z-index: 1;
}
.pollutant-name {
  font-size: 0.72rem; color: var(--t3);
  margin-bottom: 16px; margin-top: 2px;
}

.pollutant-val-row {
  display: flex; align-items: baseline; gap: 4px;
  flex: 1; align-items: flex-end;
  margin-bottom: 14px;
  position: relative; z-index: 1;
}
.pollutant-big {
  font-family: var(--mono); font-size: 2rem; font-weight: 700;
  color: var(--t1); line-height: 1;
}
.pollutant-unit { font-size: 0.7rem; color: var(--t3); margin-bottom: 4px; }

.pollutant-gauge-track {
  height: 4px; background: rgba(255,255,255,0.06);
  border-radius: 99px; overflow: hidden;
  margin-bottom: 8px; position: relative; z-index: 1;
}
.pollutant-gauge-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  width: 0%; transition: width 1.3s var(--spring);
}

.pollutant-status-label {
  font-size: 0.72rem; font-weight: 600;
  position: relative; z-index: 1;
  transition: color var(--t-base);
}

/* ─────────────────────────────────────────────────────────
   48H FORECAST CHART
───────────────────────────────────────────────────────── */
.card-chart { padding: 24px; }

.chart-header-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
  position: relative; z-index: 1;
}
.chart-header-row .card-label { margin-bottom: 0; }

.chart-legend { display: flex; gap: 20px; }
.legend-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 0.72rem; color: var(--t2);
}
.legend-pip {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.pip-cyan   { background: var(--cyan);   box-shadow: 0 0 6px var(--cyan); }
.pip-purple { background: var(--purple); box-shadow: 0 0 6px var(--purple); }

.chart-canvas-wrap {
  position: relative; z-index: 1;
  height: 270px;
}

/* ─────────────────────────────────────────────────────────
   CACHE STATUS STRIP
───────────────────────────────────────────────────────── */
.cache-strip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
  font-size: 0.7rem; color: var(--t3);
}
.cache-indicator {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--emerald); flex-shrink: 0;
  transition: background var(--t-base);
}
.cache-indicator.stale { background: var(--amber); }
.cache-text { letter-spacing: 0.01em; }

/* ─────────────────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────────────────── */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--b1);
  padding: 36px 24px 52px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: var(--blur-sm);
}

.footer-inner {
  max-width: 1700px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 32px; flex-wrap: wrap;
}

.footer-wordmark {
  font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 8px;
}
.footer-wordmark span { font-weight: 400; opacity: 0.65; }

.footer-tagline {
  font-size: 0.8rem; color: var(--t3); line-height: 1.55; max-width: 320px;
}

.footer-right {
  display: flex; flex-direction: column; gap: 5px; text-align: right;
}

.footer-dev { font-size: 0.875rem; color: var(--t2); }
.footer-author {
  color: var(--cyan); font-weight: 600;
  text-shadow: 0 0 20px rgba(0,212,255,0.35);
}

.footer-powered { font-size: 0.75rem; color: var(--t3); }
.footer-powered a:hover { color: var(--cyan); }

.footer-copy { font-size: 0.7rem; color: var(--t3); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — TABLET LARGE  (≤ 1200px)
═══════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .card-hero      { grid-column: span 6; }
  .card-aqi       { grid-column: span 6; }
  .card-sun       { grid-column: span 6; grid-row: span 1; }
  .card-metric    { grid-column: span 4; }
  .card-pollutant { grid-column: span 6; }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — TABLET  (≤ 960px)
═══════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .card-hero      { grid-column: span 12; grid-row: span 1; }
  .card-aqi       { grid-column: span 12; }
  .card-sun       { grid-column: span 12; }
  .card-metric    { grid-column: span 6; }
  .card-pollutant { grid-column: span 6; }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 640px)
   Design philosophy: app-first, card-based, premium feel
═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Variables ── */
  :root {
    --header-h: 62px;
    --r-lg: 18px;
    --r-md: 14px;
  }

  /* ── Header: compact single row ── */
  .header {
    padding: 0 14px;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }

  .brand-tld    { display: none; }
  .clock-display { display: none; }
  .live-badge   { display: none; }

  .brand-name { font-size: 1rem; letter-spacing: 0.01em; }
  .brand-logo { gap: 6px; }
  .logo-icon  { width: 24px; height: 24px; }

  /* Search takes all remaining space */
  .header-center { flex: 1; max-width: none; }
  .search-input  { font-size: 0.88rem; padding: 10px 42px 10px 36px; }
  .search-icon   { width: 14px; height: 14px; left: 12px; }

  /* Location pill — smaller, right-aligned */
  .header-right { flex-shrink: 0; }
  .location-pill {
    padding: 5px 10px 5px 8px;
    font-size: 0.7rem;
    gap: 4px;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .loc-icon { width: 10px; height: 10px; }
  #location-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 90px;
    display: block;
  }

  /* ── Search results: full-width, bottom-anchored feel ── */
  .search-results {
    top: calc(100% + 6px);
    left: -14px;
    right: -14px;
    border-radius: 0 0 18px 18px;
    max-height: 60vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  }

  /* ── Dashboard grid: 2-col bento ── */
  .dashboard {
    grid-template-columns: repeat(2, 1fr);
    padding: 12px 12px 100px;   /* bottom pad for safe area */
    gap: 10px;
  }

  /* Grid slot assignments for mobile */
  .sk-hero    { grid-column: span 2; }
  .sk-aqi     { grid-column: span 2; }
  .sk-sun     { grid-column: span 2; }
  .sk-metric  { grid-column: span 1; }
  .sk-chart   { grid-column: span 2; }

  .card-hero      { grid-column: span 2; grid-row: span 1; }
  .card-aqi       { grid-column: span 2; }
  .card-sun       { grid-column: span 2; }
  .card-metric    { grid-column: span 1; }
  .card-pollutant { grid-column: span 1; }
  .card-chart     { grid-column: span 2; }
  .cache-strip    { grid-column: span 2; }

  /* ── Glass card: OLED-optimised ── */
  .glass-card {
    background: rgba(8,8,12,0.80);
    border-color: rgba(255,255,255,0.08);
    border-radius: var(--r-lg);
    padding: 16px;
  }
  .glass-card:hover {
    transform: none;     /* no lift on touch */
  }

  /* ── Hero card ── */
  .card-hero { display: flex; flex-direction: column; }

  .hero-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .weather-icon-wrap { width: 56px; height: 56px; }
  .weather-icon-img  { width: 56px; height: 56px; }

  .hero-temp-row {
    margin: 8px 0 4px;
    align-items: flex-start;
  }

  .temp-value {
    font-size: clamp(4rem, 18vw, 5.5rem);
    letter-spacing: -0.04em;
  }
  .temp-unit { font-size: 1.4rem; margin-top: 10px; }

  .weather-desc { font-size: 0.88rem; }

  .hero-divider { margin: 12px 0 10px; }

  .hero-bottom {
    flex-wrap: wrap;
    gap: 10px;
  }
  .feels-val { font-size: 1rem; }
  .range-item { font-size: 0.82rem; }

  /* ── AQI card ── */
  .aqi-body {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  .aqi-ring-wrap { width: 88px; height: 88px; flex-shrink: 0; }
  .aqi-number    { font-size: 1.7rem; }
  .aqi-status-text { font-size: 1.15rem; }
  .aqi-desc-text   { font-size: 0.72rem; }
  .aqi-info-block  { gap: 6px; }

  .aqi-dot-scale { gap: 8px; margin-top: 4px; }
  .aqi-dot-pair  { gap: 4px; }
  .aqi-dot       { width: 8px; height: 8px; }
  .aqi-dot-lbl   { font-size: 0.5rem; }

  /* ── Sun card ── */
  .card-sun { flex-direction: row; align-items: center; gap: 12px; }

  .sun-arc-container {
    width: 100px; height: 70px;
    flex-shrink: 0;
  }

  .sun-times-row {
    flex: 1;
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
  }
  .sun-time-block {
    padding: 8px 10px;
    gap: 7px;
    flex: none;
  }
  .sun-icon { width: 20px; height: 20px; }
  .sun-label { font-size: 0.6rem; }
  .sun-time  { font-size: 0.95rem; }

  /* ── Metric cards: 2-per-row, compact ── */
  .metric-big    { font-size: 1.75rem; }
  .metric-unit   { font-size: 0.75rem; }
  .metric-status { font-size: 0.65rem; }
  .metric-bar    { height: 4px; margin-top: 8px; }
  .progress-track { height: 4px; }

  /* Compass: smaller */
  .compass-wrap  { width: 52px; height: 52px; }

  /* ── Pollutant cards: 2-per-row ── */
  .pollutant-big   { font-size: 1.5rem; }
  .pollutant-unit  { font-size: 0.7rem; }

  /* ── Chart ── */
  .chart-canvas-wrap { height: 180px; }
  .card-label { font-size: 0.58rem; letter-spacing: 0.1em; margin-bottom: 10px; }

  /* ── Cache strip ── */
  .cache-strip {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.68rem;
  }

  /* ── Background orbs: repositioned for mobile ── */
  .orb-1 { width: 280px; height: 280px; top: -60px; left: -80px; }
  .orb-2 { width: 220px; height: 220px; top: 40%; right: -60px; }
  .orb-3 { width: 180px; height: 180px; bottom: 10%; left: -30px; }

  /* ── Footer: compact stacked layout on mobile ── */
  .footer {
    display: block;
    padding: 24px 16px 40px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }

  .footer-wordmark { font-size: 1.1rem; margin-bottom: 4px; }
  .footer-tagline  { font-size: 0.75rem; max-width: 100%; }

  .footer-right {
    text-align: center;
    gap: 4px;
  }

  .footer-dev    { font-size: 0.8rem; }
  .footer-powered { font-size: 0.68rem; }
  .footer-copy   { font-size: 0.65rem; margin-top: 2px; }


  /* ── Geo-toast: higher up on mobile ── */
  .geo-toast { bottom: 84px; font-size: 0.82rem; }

  /* ── Card reveal: faster on mobile (less delay) ── */
  .anim-card { animation-duration: 0.45s; }

  /* ── Touch active state ── */
  .glass-card:active {
    transform: scale(0.975);
    background: rgba(255,255,255,0.04);
    transition: transform 0.1s, background 0.1s;
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE — EXTRA SMALL  (≤ 400px)
═══════════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
    padding: 10px 10px 90px;
    gap: 8px;
  }

  .glass-card { padding: 13px; border-radius: 16px; }

  .temp-value { font-size: clamp(3.5rem, 20vw, 4.8rem); }

  .aqi-body { flex-direction: column; align-items: flex-start; gap: 12px; }
  .aqi-ring-wrap { width: 76px; height: 76px; }

  .card-sun { flex-direction: column; }
  .sun-arc-container { display: none; }
  .sun-times-row { flex-direction: row; margin-top: 4px; }

  .metric-big    { font-size: 1.5rem; }
  .pollutant-big { font-size: 1.35rem; }

  .chart-canvas-wrap { height: 160px; }

  .location-pill { max-width: 90px; }
  #location-name { max-width: 70px; }

  .header { gap: 8px; padding: 0 10px; }
  .search-input { font-size: 0.82rem; }
}

