/* ===== Aura Weather — Advanced Glassmorphism ===== */

:root {
  --primary: #2196F3;
  --primary-glow: rgba(33, 150, 243, 0.3);
  --bg: #FFFFFF;
  --card: #F5F5F5;
  --text: #222222;
  --muted: #5b6470;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.75);
  --focus: #1976D2;
  --severe: #dc2626;
  --warning: #f59e0b;
  --radius: 20px;
  --grad: linear-gradient(135deg, #74b9ff, #a3d8ff 60%, #ffffff);
}

[data-theme='dark'] {
  --primary: #64B5F6;
  --primary-glow: rgba(100, 181, 246, 0.25);
  --bg: #121212;
  --card: #1E1E1E;
  --text: #FFFFFF;
  --muted: #a4adba;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --glass: rgba(30, 30, 30, 0.55);
  --glass-strong: rgba(30, 30, 30, 0.8);
  --focus: #90CAF9;
  --grad: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

[data-weather='clear-day'] {
  --grad: linear-gradient(135deg, #56CCF2, #2F80ED);
}

[data-weather='clear-night'] {
  --grad: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

[data-weather='cloudy'] {
  --grad: linear-gradient(135deg, #bdc3c7, #2c3e50);
}

[data-weather='rainy'] {
  --grad: linear-gradient(135deg, #3a7bd5, #3a6073);
}

[data-weather='snowy'] {
  --grad: linear-gradient(135deg, #e6dada, #274046);
}

[data-weather='storm'] {
  --grad: linear-gradient(135deg, #141E30, #243B55);
}

[data-weather='fog'] {
  --grad: linear-gradient(135deg, #757F9A, #D7DDE8);
}

/* ===== Base ===== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.8s ease, color 0.5s ease;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#weatherCanvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--grad);
  opacity: 0.35;
  transition: background 1.2s ease;
}

[data-theme='dark'] .bg-layer {
  opacity: 0.55;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

.muted {
  color: var(--muted);
  font-size: 0.875rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Skip link ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 12px;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ===== Focus States ===== */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
.hour-card:focus-visible,
.recent-chip:focus-visible,
.region-card:focus-visible,
.bar-wrap:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ===== Topbar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  flex-wrap: wrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: var(--glass);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.brand svg {
  color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand strong {
  color: var(--primary);
  font-weight: 800;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 420px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 240px;
  flex: 1 1 280px;
  box-shadow: var(--shadow);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.search:focus-within {
  transform: scale(1.02) translateY(-1px);
  box-shadow: var(--shadow), 0 0 0 3px var(--primary-glow);
}

.search svg {
  color: var(--muted);
  flex-shrink: 0;
}

.search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--glass-strong);
  color: var(--text);
  font: 500 14px/1 'Inter', sans-serif;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow);
  min-height: 40px;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--primary-glow);
}

.btn:active,
.icon-btn:active {
  transform: translateY(0) scale(0.98);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), #1976D2);
}

.btn.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 8px 25px var(--primary-glow);
}

.icon-btn {
  padding: 10px;
  min-width: 40px;
  justify-content: center;
}

.icon-btn.ghost {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  color: var(--muted);
}

.icon-btn.ghost:hover {
  background: rgba(0, 0, 0, 0.04);
  box-shadow: none;
}

[data-theme='dark'] .icon-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ===== Unit Toggle ===== */
.unit-toggle {
  display: inline-flex;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: var(--shadow);
}

.unit-btn {
  border: none;
  background: transparent;
  color: var(--text);
  font: 600 13px/1 'Inter', sans-serif;
  padding: 8px 12px;
  border-radius: 16px;
  cursor: pointer;
  min-width: 44px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.unit-btn:hover {
  background: var(--card);
  transform: scale(1.05);
}

.unit-btn.is-active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ===== Recent Searches ===== */
.recent-row {
  display: flex;
  gap: 8px;
  padding: 12px 24px 8px;
  flex-wrap: wrap;
}

.recent-chip {
  background: var(--glass);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
  font-weight: 500;
}

.recent-chip:hover {
  transform: translateY(-2px) scale(1.05);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: linear-gradient(135deg, var(--primary), #1565C0);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
  z-index: 50;
  font-weight: 600;
  opacity: 0;
  max-width: 90vw;
  text-align: center;
  backdrop-filter: blur(10px);
}

.toast:not([hidden]) {
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast[hidden] {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
}

/* ===== Alert Banner ===== */
.alert-banner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  pointer-events: none;
}

.alert-severe {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.92), rgba(185, 28, 28, 0.92));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
  animation: alertPulse 2s ease-in-out infinite;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.92), rgba(217, 119, 6, 0.92));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

@keyframes alertPulse {
  0%,
  100% {
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.3);
  }
  50% {
    box-shadow: 0 12px 40px rgba(220, 38, 38, 0.5);
  }
}

.alert-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.alert-header strong {
  font-size: 0.97rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.alert-level {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert-time {
  font-size: 0.8rem;
  opacity: 0.9;
  font-weight: 500;
}

.alert-msg {
  font-size: 0.88rem;
  opacity: 0.95;
  line-height: 1.5;
}

.alert-actions {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.alert-toggle,
.alert-dismiss {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: inherit;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.alert-toggle:hover,
.alert-dismiss:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* ===== Dashboard Layout ===== */
.dashboard {
  display: grid;
  gap: 22px;
  padding: 8px 24px 32px;
  grid-template-columns: 1fr;
}

.dashboard:focus {
  outline: none;
}

@media (min-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
  }

  .hero,
  .alert-banner,
  .precip {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1200px) {
  .dashboard {
    grid-template-columns: 2fr 1fr;
  }

  .hero,
  .alert-banner,
  .precip,
  .regions {
    grid-column: 1 / -1;
  }

  .hourly {
    grid-column: 1 / 2;
  }

  .daily {
    grid-column: 2 / 3;
  }
}

/* ===== Cards (Advanced) ===== */
.card {
  background: var(--glass-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), 0 0 0 1px var(--primary-glow);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 8px;
  flex-wrap: wrap;
}

.card-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ===== Hero Card ===== */
.hero {
  min-height: 280px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
}

.hero-content {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  position: relative;
  z-index: 1;
}

@media (min-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr 1.2fr;
    align-items: center;
  }
}

.location h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.now {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.now-icon {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  color: var(--primary);
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.2));
  animation: floatIcon 4s ease-in-out infinite;
}

@keyframes floatIcon {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.now-icon svg {
  width: 100%;
  height: 100%;
}

.temp {
  font-size: clamp(3.2rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  transition: color 0.3s ease;
}

.temp sup {
  font-size: 0.35em;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
  vertical-align: super;
}

.desc {
  font-size: 1.15rem;
  font-weight: 500;
  text-transform: capitalize;
  margin-top: 4px;
  color: var(--text);
}

.feels {
  margin-top: 2px;
}

/* ===== Sun Tracker ===== */
.sun-track {
  margin-top: 16px;
  opacity: 0.9;
}

.sun-arc {
  width: 100%;
  height: 60px;
  overflow: visible;
}

.sun-arc-path {
  stroke: var(--muted);
  stroke-dasharray: 4 4;
  opacity: 0.4;
}

.sun-dot {
  fill: #FFC107;
  filter: drop-shadow(0 0 6px rgba(255, 193, 7, 0.6));
  transition: cx 0.5s ease, cy 0.5s ease;
}

.sun-label {
  font-size: 9px;
  fill: var(--muted);
  font-weight: 500;
}

/* ===== Hero Right Stats ===== */
.hero-right {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 540px) {
  .hero-right {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 900px) {
  .hero-right {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .hero-right {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stat-val {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stat-detail {
  font-size: 0.75rem;
  margin-top: 2px;
  font-weight: 500;
}

/* ===== Mini Gauges ===== */
.humidity-gauge {
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

[data-theme='dark'] .humidity-gauge {
  background: rgba(255, 255, 255, 0.1);
}

.gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #2196F3, #64B5F6);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pressure-bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

[data-theme='dark'] .pressure-bar {
  background: rgba(255, 255, 255, 0.1);
}

.pressure-fill {
  height: 100%;
  background: linear-gradient(90deg, #9C27B0, #E040FB);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Wind Rose ===== */
.wind-rose {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass-strong);
  border: 2px solid var(--border);
  position: relative;
  margin-top: auto;
  align-self: center;
}

.wind-arrow {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wind-arrow::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 14px solid var(--primary);
  filter: drop-shadow(0 0 2px var(--primary-glow));
}

#windStat {
  grid-row: span 1;
}

/* ===== UV Gauge ===== */
.uv-display {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.uv-gauge {
  width: 70px;
  height: 70px;
  transform: rotate(-90deg);
}

.uv-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.uv-arc {
  fill: none;
  stroke: #4CAF50;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.5s ease;
}

.uv-text {
  text-anchor: middle;
  dominant-baseline: central;
  font-weight: 800;
  font-size: 18px;
  fill: var(--text);
  transform: rotate(90deg);
  transform-origin: center;
  transition: fill 0.5s ease;
}

.stat-uv {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.08), rgba(255, 193, 7, 0.04));
}

/* ===== Precipitation Chart ===== */
.precip-chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 180px;
  padding: 12px 4px 0;
  border-bottom: 2px solid var(--border);
  position: relative;
}

.bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
  position: relative;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  transition: background 0.2s ease;
  padding: 4px 0;
}

.bar-wrap:hover {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme='dark'] .bar-wrap:hover {
  background: rgba(255, 255, 255, 0.03);
}

.bar-wrap:focus {
  outline: none;
}

.bar-wrap:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
  z-index: 5;
  background: rgba(0, 0, 0, 0.03);
}

.bar {
  width: 100%;
  max-width: 24px;
  background: linear-gradient(180deg, var(--primary), #1565C0);
  border-radius: 8px 8px 0 0;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
  min-height: 3px;
  box-shadow: 0 0 10px var(--primary-glow);
}

.bar-focus-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
  line-height: 1.5;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bar-focus-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text);
}

.bar-wrap:hover .bar-focus-tooltip,
.bar-wrap:focus .bar-focus-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bar-wrap:hover .bar {
  transform: scaleY(1.08) scaleX(1.1);
  filter: brightness(1.2);
}

.bar-val {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.bar:hover .bar-val {
  opacity: 1;
}

.bar-label {
  font-size: 0.65rem;
  color: var(--muted);
  height: 14px;
  white-space: nowrap;
  font-weight: 500;
}

/* ===== Hourly Forecast ===== */
.hourly-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.hourly-scroll::-webkit-scrollbar {
  height: 6px;
}

.hourly-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

.hour-card {
  flex: 0 0 100px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  scroll-snap-align: start;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.hour-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hour-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.15);
}

.hour-card:hover::before {
  opacity: 1;
}

.hour-card .h-time {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.hour-card svg {
  width: 38px;
  height: 38px;
  color: var(--primary);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.hour-card .h-temp {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.hour-card .h-rain {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
}

.hour-card .h-wind {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
}

/* ===== Daily Forecast ===== */
.daily-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-row {
  display: grid;
  grid-template-columns: 1.2fr 40px 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.day-row::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 50%);
  pointer-events: none;
}

.day-row:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  z-index: 2;
}

.day-row .d-name {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.day-row svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
  filter: drop-shadow(0 2px 6px var(--primary-glow));
}

.day-row .d-rain {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

.day-row .d-temps {
  font-size: 0.95rem;
  text-align: right;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.day-row .d-temps .d-min {
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
}

/* ===== Regions ===== */
.regions {
  transition: all 0.3s ease;
}

.regions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 520px) {
  .regions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .regions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .regions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.region-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.region-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.region-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--primary-glow);
  border-color: var(--primary);
  color: #fff;
}

.region-card:hover::before {
  opacity: 1;
}

.region-card:hover .region-name,
.region-card:hover .region-weather,
.region-card:hover .region-temp,
.region-card:hover .region-flag {
  color: #fff;
  position: relative;
  z-index: 1;
}

.region-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.region-flag {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.region-card:hover .region-flag {
  transform: scale(1.15) rotate(5deg);
}

.region-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.region-name {
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.region-weather {
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.3s ease;
}

.region-weather svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.region-temp {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.region-card:hover .region-weather {
  color: rgba(255, 255, 255, 0.92);
}

.region-card:hover .region-temp {
  color: #fff;
  transform: scale(1.1);
}

.regions-empty {
  text-align: center;
  color: var(--muted);
  padding: 24px;
  font-size: 0.92rem;
  grid-column: 1 / -1;
}

/* ===== Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, var(--card) 25%, var(--border) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 12px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.hero-skeleton {
  height: 280px;
}

.h-skel {
  flex: 0 0 100px;
  height: 130px;
}

.d-skel {
  height: 54px;
}

.r-skel {
  height: 80px;
  border-radius: 16px;
}

/* ===== Footer ===== */
.foot {
  text-align: center;
  padding: 22px;
  font-size: 0.82rem;
  color: var(--muted);
  backdrop-filter: blur(10px);
  background: var(--glass);
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .search-wrap {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    gap: 8px;
    padding-top: 10px;
    flex: 1 1 100%;
  }

  .search {
    flex: 1 1 100%;
    min-width: 0;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .search-wrap {
    flex: 1 1 100%;
  }

  .btn span {
    display: none;
  }

  .dashboard {
    padding: 8px 14px 24px;
  }

  .card {
    padding: 18px;
  }

  .day-row {
    grid-template-columns: 1fr 30px 1fr;
  }

  .day-row .d-rain {
    display: none;
  }

  .precip-chart {
    height: 140px;
  }

  .regions-grid {
    grid-template-columns: 1fr;
  }

  .hero-content {
    text-align: center;
  }

  .now {
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero-right {
    justify-items: center;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 12px 14px;
  }

  .brand span {
    font-size: 1.05rem;
  }

  .unit-toggle {
    order: -1;
    flex: 0 0 auto;
  }

  .search-wrap {
    order: 4;
    flex-wrap: wrap;
  }

  .location h1 {
    font-size: 1.5rem;
  }

  .now-icon {
    width: 80px;
    height: 80px;
  }

  .temp {
    font-size: 2.8rem;
  }

  .stat {
    padding: 12px 10px;
  }

  .stat-val {
    font-size: 0.95rem;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .toast,
  .alert,
  .card,
  .hero-content,
  .now-icon,
  .bar,
  .bar-focus-tooltip,
  .region-card,
  .hour-card,
  .day-row,
  .stat {
    animation: none !important;
    transition: none !important;
  }

  .bar-focus-tooltip {
    transform: translateX(-50%) translateY(0);
  }

  .bar-wrap:hover .bar-focus-tooltip,
  .bar-wrap:focus .bar-focus-tooltip {
    transform: translateX(-50%) translateY(0);
  }
}
