/* ═══════════════════════════════════════════
   AETHER — Weather & Air Quality
   Atmospheric Cinema Design System
   ═══════════════════════════════════════════ */

/* ─── Animatable Custom Properties ─── */
@property --bg-top {
  syntax: '<color>';
  inherits: false;
  initial-value: #0a0a1a;
}
@property --bg-mid {
  syntax: '<color>';
  inherits: false;
  initial-value: #121228;
}
@property --bg-bottom {
  syntax: '<color>';
  inherits: false;
  initial-value: #1a1a3e;
}
@property --aqi-offset {
  syntax: '<number>';
  inherits: false;
  initial-value: 534;
}

/* ─── CSS Variables ─── */
:root {
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-heading: 'Syne', sans-serif;
  --font-body: 'Lexend Deca', sans-serif;

  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --glass-blur: 24px;

  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-tertiary: rgba(255, 255, 255, 0.3);

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;

  --transition-smooth: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  --aqi-good: #4ade80;
  --aqi-moderate: #facc15;
  --aqi-sensitive: #fb923c;
  --aqi-unhealthy: #ef4444;
  --aqi-very-unhealthy: #a855f7;
  --aqi-hazardous: #881337;

  --alert-amber: #f59e0b;
  --alert-amber-bg: rgba(245, 158, 11, 0.12);
  --alert-amber-border: rgba(245, 158, 11, 0.35);

  --uv-low: #4ade80;
  --uv-moderate: #facc15;
  --uv-high: #fb923c;
  --uv-very-high: #ef4444;
  --uv-extreme: #a855f7;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
  background: #0a0a1a;
}

a { color: var(--text-secondary); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--text-primary); }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

select {
  font-family: var(--font-body);
}

/* ─── Weather Background ─── */
.weather-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.gradient-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg-bottom) 100%);
  transition: --bg-top 2s ease, --bg-mid 2s ease, --bg-bottom 2s ease;
  opacity: 1;
}

.gradient-layer--next {
  opacity: 0;
  transition: opacity 1.5s ease;
}

.weather-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

#particleCanvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* ─── Loading Screen ─── */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a1a;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader {
  text-align: center;
}

.loader-ring {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
}

.loader-ring svg {
  width: 100%;
  height: 100%;
  animation: loader-rotate 2s linear infinite;
}

.loader-ring circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 3;
}

.loader-ring__progress {
  stroke: rgba(255, 255, 255, 0.7) !important;
  stroke-dasharray: 251;
  stroke-dashoffset: 190;
  stroke-linecap: round;
  animation: loader-dash 1.5s ease-in-out infinite;
}

@keyframes loader-rotate {
  to { transform: rotate(360deg); }
}

@keyframes loader-dash {
  0% { stroke-dashoffset: 190; }
  50% { stroke-dashoffset: 60; }
  100% { stroke-dashoffset: 190; }
}

.loader-text {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.loader-dots {
  display: inline-flex;
  gap: 2px;
  color: var(--text-secondary);
}

.loader-dots span {
  animation: dot-pulse 1.4s ease-in-out infinite;
  font-size: 1.2rem;
}
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

/* ─── Main Content ─── */
.main-content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.main-content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Header ─── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 40px;
}

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

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--text-primary);
  opacity: 0.8;
}

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

.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.temp-toggle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.3s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.temp-toggle:hover { background: rgba(255, 255, 255, 0.12); }

.temp-toggle .inactive {
  opacity: 0.35;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.3s, transform 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ─── Hero Section ─── */
.hero {
  text-align: center;
  margin-bottom: 48px;
}

.hero__location {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  animation: fade-slide-up 0.8s ease both;
  animation-delay: 0.3s;
}

.location-pin {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.city-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.state-country {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 300;
  margin-top: 2px;
}

.hero__weather {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fade-slide-up 0.8s ease both;
  animation-delay: 0.5s;
}

.weather-icon-display {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 24px rgba(255,255,255,0.15));
}

.temperature-block {
  text-align: center;
}

.temperature-display {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  line-height: 1;
}

.temp-value {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 9rem;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.temp-degree {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 3rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.weather-condition {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ─── Feels Like Temperature ─── */
.feels-like {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

/* ─── Local Time ─── */
.local-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 8px;
  font-weight: 400;
}

.last-updated {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 24px;
  font-weight: 300;
  animation: fade-slide-up 0.8s ease both;
  animation-delay: 0.7s;
}

/* ─── Alerts Banner ─── */
.alerts-banner:empty {
  display: none;
}

.alerts-banner {
  margin-bottom: 24px;
  animation: fade-slide-up 0.6s ease both;
  animation-delay: 0.6s;
}

.alerts-banner .glass {
  padding: 0;
  border-left: 3px solid var(--alert-amber);
  overflow: hidden;
}

.alert-item {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.3s ease;
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-item:hover {
  background: rgba(245, 158, 11, 0.06);
}

.alert-item__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-item__icon {
  width: 20px;
  height: 20px;
  color: var(--alert-amber);
  flex-shrink: 0;
}

.alert-item__title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--alert-amber);
  letter-spacing: 0.02em;
  flex: 1;
}

.alert-item__toggle {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.alert-item.expanded .alert-item__toggle {
  transform: rotate(180deg);
}

.alert-item__description {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s ease;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 0 0 0 30px;
}

.alert-item.expanded .alert-item__description {
  max-height: 200px;
  padding: 10px 0 4px 30px;
}

/* ─── Hourly Forecast Section ─── */
.hourly-section {
  margin-bottom: 24px;
  animation: fade-slide-up 0.6s ease both;
  animation-delay: 0.8s;
}

.hourly-section .section-title {
  margin-bottom: 16px;
}

.hourly-scroll {
  display: flex;
  overflow-x: auto;
  gap: 4px;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hourly-scroll::-webkit-scrollbar {
  display: none;
}

.hourly-item {
  min-width: 72px;
  padding: 16px 12px;
  text-align: center;
  scroll-snap-align: start;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  flex-shrink: 0;
}

.hourly-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.09);
}

.hourly-item.now {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
}

.hourly-item__time {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  font-weight: 500;
}

.hourly-item.now .hourly-item__time {
  color: var(--text-primary);
}

.hourly-item__icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.hourly-item__icon img {
  width: 100%;
  height: 100%;
}

.hourly-item__temp {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
}

/* ─── 3-Day Forecast Section ─── */
.forecast-section {
  margin-bottom: 24px;
  animation: fade-slide-up 0.6s ease both;
  animation-delay: 0.9s;
}

.forecast-section .section-title {
  margin-bottom: 16px;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.forecast-card {
  padding: 24px 20px;
  text-align: center;
  animation: fade-slide-up 0.6s ease both;
  transition: transform 0.3s ease, background 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.forecast-card:nth-child(1) { animation-delay: 0.9s; }
.forecast-card:nth-child(2) { animation-delay: 1.0s; }
.forecast-card:nth-child(3) { animation-delay: 1.1s; }

.forecast-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.09);
}

.forecast-card__day {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.forecast-card__icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.forecast-card__icon img {
  width: 100%;
  height: 100%;
}

.forecast-card__condition {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.forecast-card__temps {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.forecast-card__temp-max {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
}

.forecast-card__temp-min {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-tertiary);
}

.forecast-card__rain {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.forecast-card__rain svg {
  width: 12px;
  height: 12px;
  color: rgba(96, 165, 250, 0.7);
}

/* ─── Astronomy Section ─── */
.astro-section {
  padding: 32px;
  margin-bottom: 24px;
  animation: fade-slide-up 0.6s ease both;
  animation-delay: 1.05s;
}

.astro-section .section-title {
  margin-bottom: 24px;
}

.astro-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

.sun-arc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sun-arc__svg {
  width: 100%;
  max-width: 280px;
}

.sun-arc__svg svg {
  width: 100%;
  height: auto;
}

.sun-times {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 280px;
}

.sun-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.sun-time svg {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

.moon-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.moon-visual {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 2px 12px rgba(255, 255, 255, 0.1));
}

.moon-phase-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.moon-illumination {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

.moon-times {
  display: flex;
  gap: 20px;
  margin-top: 4px;
}

.moon-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.moon-time__label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  font-weight: 500;
}

.moon-time__value {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ─── Glass Cards ─── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

/* ─── Details Grid ─── */
.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.detail-card {
  padding: 24px 20px;
  text-align: center;
  animation: fade-slide-up 0.6s ease both;
  transition: transform 0.3s ease, background 0.3s ease;
}

.detail-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.09);
}

.detail-card[data-delay="0"] { animation-delay: 0.6s; }
.detail-card[data-delay="1"] { animation-delay: 0.75s; }
.detail-card[data-delay="2"] { animation-delay: 0.9s; }
.detail-card[data-delay="3"] { animation-delay: 1.05s; }
.detail-card[data-delay="4"] { animation-delay: 1.2s; }
.detail-card[data-delay="5"] { animation-delay: 1.35s; }

.detail-card__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-icon {
  width: 24px;
  height: 24px;
  color: var(--text-secondary);
}

.detail-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  font-weight: 500;
}

.detail-value {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2rem;
  margin-bottom: 8px;
}

.detail-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.detail-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.7));
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-sub {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* ─── UV Index Scale ─── */
.uv-scale {
  position: relative;
  margin-top: 8px;
}

.uv-scale__bar {
  display: flex;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  gap: 1px;
}

.uv-scale__segment {
  flex: 1;
  border-radius: 2px;
  opacity: 0.6;
}

.uv-scale__segment:nth-child(1) { background: var(--uv-low); }
.uv-scale__segment:nth-child(2) { background: var(--uv-moderate); }
.uv-scale__segment:nth-child(3) { background: var(--uv-high); }
.uv-scale__segment:nth-child(4) { background: var(--uv-very-high); }
.uv-scale__segment:nth-child(5) { background: var(--uv-extreme); }

.uv-scale__marker {
  position: absolute;
  top: -2px;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
  transition: left 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  left: 0%;
  transform: translateX(-50%);
}

.uv-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 6px;
}

/* ─── Wind Compass ─── */
.wind-compass {
  margin-top: 8px;
}

.wind-compass svg {
  width: 100px;
  height: 100px;
}

#windArrow {
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── AQI Section ─── */
.aqi-section {
  padding: 32px;
  margin-bottom: 24px;
  animation: fade-slide-up 0.6s ease both;
  animation-delay: 1s;
}

.aqi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.aqi-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 14px;
  border-radius: 100px;
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  transition: background 0.5s, color 0.5s;
}

.aqi-content {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
}

.aqi-gauge {
  position: relative;
  width: 160px;
  height: 160px;
}

.aqi-ring {
  width: 100%;
  height: 100%;
}

#aqiProgress {
  transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.aqi-gauge__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.aqi-value {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 3.2rem;
  line-height: 1;
}

.aqi-us-label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

.aqi-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.aqi-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.aqi-detail-label {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

.aqi-detail-value {
  font-weight: 500;
  font-size: 0.85rem;
}

.aqi-scale {
  position: relative;
  margin-top: 8px;
}

.aqi-scale__bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  gap: 2px;
}

.aqi-scale__segment {
  flex: 1;
  border-radius: 3px;
  opacity: 0.6;
}

.aqi-scale__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.aqi-scale__marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 14px;
  background: white;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
  transition: left 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  left: 0%;
}

/* ─── Skeleton Loading ─── */
.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  min-height: 1em;
}

.skeleton--text { width: 140px; height: 28px; }
.skeleton--text-sm { width: 100px; height: 18px; }
.skeleton--icon { width: 64px; height: 64px; border-radius: 50%; }
.skeleton--value { width: 80px; height: 36px; }
.skeleton--badge { width: 60px; height: 20px; }

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

/* ─── Search Panel ─── */
.search-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
  visibility: hidden;
}

.search-panel.open {
  pointer-events: auto;
  visibility: visible;
}

.search-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.search-panel.open .search-overlay {
  opacity: 1;
}

.search-content {
  position: relative;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  padding: 32px 28px;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
  overflow-y: auto;
  border-radius: 0;
  border-left: 1px solid var(--glass-border);
  background: rgba(10, 10, 30, 0.85);
}

.search-panel.open .search-content {
  transform: translateX(0);
}

.search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.search-close {
  width: 36px;
  height: 36px;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Search Autocomplete ─── */
.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  padding: 14px 44px 14px 42px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.3s, background 0.3s;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.search-input-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-spinner {
  position: absolute;
  right: 14px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  display: none;
}

.search-spinner.active {
  display: block;
  animation: loader-rotate 0.8s linear infinite;
}

.search-results {
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.search-results:empty {
  display: none;
}

.search-result-item {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-result-item__name {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.search-result-item__region {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* ─── Legacy Select Styles (kept for compatibility) ─── */
.select-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.select-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  font-weight: 500;
}

.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  padding: 14px 44px 14px 16px;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
}

.select-wrapper select:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.select-wrapper select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.select-wrapper select option {
  background: #1a1a2e;
  color: #fff;
}

.select-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.select-loader {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: rgba(255,255,255,0.6);
  border-radius: 50%;
  display: none;
}

.select-loader.active {
  display: block;
  animation: loader-rotate 0.8s linear infinite;
}

.select-loader.active + .select-chevron { display: none; }

.search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  transition: background 0.3s, transform 0.2s;
  margin-top: 8px;
}

.search-submit:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.search-submit:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.search-submit svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s;
}

.search-submit:hover:not(:disabled) svg {
  transform: translateX(4px);
}

/* ─── Error Toast ─── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 0.85rem;
  color: #fca5a5;
  transition: transform var(--transition-smooth), opacity 0.4s ease, visibility 0.4s ease;
  max-width: 90vw;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.toast svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #ef4444;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ─── Footer ─── */
.footer {
  text-align: center;
  padding: 32px 0 16px;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  animation: fade-slide-up 0.6s ease both;
  animation-delay: 1.2s;
}

/* ─── Weather Effect: Rain ─── */
.rain-drop {
  position: absolute;
  width: 1.5px;
  top: -40px;
  background: linear-gradient(180deg, transparent, rgba(174, 194, 224, 0.5));
  border-radius: 0 0 2px 2px;
  animation: rain-fall linear infinite;
}

@keyframes rain-fall {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(105vh) translateX(-20px); opacity: 0; }
}

/* ─── Weather Effect: Snow ─── */
.snowflake {
  position: absolute;
  top: -10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  animation: snow-fall linear infinite;
  filter: blur(0.5px);
}

@keyframes snow-fall {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.8; }
  100% { transform: translateY(105vh) translateX(80px) rotate(360deg); opacity: 0; }
}

/* ─── Weather Effect: Clouds ─── */
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  filter: blur(30px);
  animation: cloud-drift linear infinite;
}

@keyframes cloud-drift {
  0% { transform: translateX(-200px); }
  100% { transform: translateX(calc(100vw + 200px)); }
}

/* ─── Weather Effect: Sun ─── */
.sun-effect {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 50, 0.3) 0%, rgba(255, 150, 0, 0.1) 40%, transparent 70%);
  animation: sun-pulse 4s ease-in-out infinite alternate;
}

@keyframes sun-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.15); opacity: 1; }
}

.sun-rays {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 50, 0.08);
  animation: sun-rays-rotate 30s linear infinite;
}

.sun-rays::before,
.sun-rays::after {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 200, 50, 0.05);
}

.sun-rays::after {
  inset: -45px;
  border-color: rgba(255, 200, 50, 0.03);
}

@keyframes sun-rays-rotate {
  to { transform: rotate(360deg); }
}

/* ─── Weather Effect: Moon ─── */
.moon-effect {
  position: absolute;
  top: 40px;
  right: 60px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e8e0d0, #c4b99a);
  box-shadow: 0 0 60px rgba(200, 190, 160, 0.3), 0 0 120px rgba(200, 190, 160, 0.1);
  animation: moon-glow 5s ease-in-out infinite alternate;
}

.moon-effect::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 5px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(0,0,0,0.05) 100%);
}

@keyframes moon-glow {
  0% { box-shadow: 0 0 60px rgba(200, 190, 160, 0.2), 0 0 120px rgba(200, 190, 160, 0.08); }
  100% { box-shadow: 0 0 80px rgba(200, 190, 160, 0.35), 0 0 160px rgba(200, 190, 160, 0.12); }
}

.star {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: star-twinkle ease-in-out infinite alternate;
}

@keyframes star-twinkle {
  0% { opacity: 0.2; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.3); }
}

/* ─── Weather Effect: Lightning ─── */
.lightning-flash {
  position: absolute;
  inset: 0;
  background: rgba(200, 200, 255, 0.15);
  animation: lightning 0.15s ease-out;
  pointer-events: none;
}

@keyframes lightning {
  0% { opacity: 1; }
  20% { opacity: 0; }
  40% { opacity: 0.6; }
  100% { opacity: 0; }
}

/* ─── Weather Effect: Mist ─── */
.mist-layer {
  position: absolute;
  width: 200%;
  height: 120px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 20%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 80%, transparent 100%);
  animation: mist-drift linear infinite;
}

@keyframes mist-drift {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0%); }
}

/* ─── Animations ─── */
@keyframes fade-slide-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .main-content {
    padding: 16px 16px 40px;
  }

  .header {
    margin-bottom: 28px;
  }

  .city-name {
    font-size: 1.3rem;
  }

  .temp-value {
    font-size: 6.5rem;
  }

  .temp-degree {
    font-size: 2rem;
    margin-top: 0.5rem;
  }

  .weather-icon-display {
    font-size: 3rem;
  }

  .details-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .detail-card:last-child {
    grid-column: 1 / -1;
  }

  .detail-card {
    padding: 20px 16px;
  }

  .detail-value {
    font-size: 1.7rem;
  }

  .wind-compass svg {
    width: 80px;
    height: 80px;
  }

  .aqi-section {
    padding: 24px 20px;
  }

  .aqi-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .aqi-gauge {
    margin: 0 auto;
    width: 140px;
    height: 140px;
  }

  .aqi-value {
    font-size: 2.5rem;
  }

  .search-content {
    width: 100%;
    max-width: 100vw;
  }

  .sun-effect {
    width: 200px;
    height: 200px;
    top: -40px;
    right: -40px;
  }

  .sun-rays {
    width: 160px;
    height: 160px;
  }

  .moon-effect {
    width: 50px;
    height: 50px;
    top: 20px;
    right: 30px;
  }

  /* Hourly: slightly smaller items on tablet */
  .hourly-item {
    min-width: 64px;
    padding: 12px 10px;
  }

  .hourly-item__icon {
    width: 30px;
    height: 30px;
  }

  .hourly-item__temp {
    font-size: 1rem;
  }

  /* Forecast grid stays 3 columns on tablet */

  /* Astro content stays 2 columns on tablet */
  .astro-section {
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .temp-value {
    font-size: 5rem;
  }

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

  .detail-card:last-child {
    grid-column: auto;
  }

  .hero {
    margin-bottom: 32px;
  }

  /* Forecast grid: single column on mobile */
  .forecast-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .forecast-card {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    padding: 16px 20px;
    gap: 12px;
  }

  .forecast-card__icon {
    width: 36px;
    height: 36px;
  }

  /* Astro content: single column on mobile */
  .astro-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .astro-section {
    padding: 20px 16px;
  }

  /* Hourly: even smaller on mobile */
  .hourly-item {
    min-width: 60px;
    padding: 12px 8px;
  }

  .hourly-item__icon {
    width: 28px;
    height: 28px;
  }

  .hourly-item__temp {
    font-size: 0.95rem;
  }

  .hourly-item__time {
    font-size: 0.6rem;
  }

  /* Alert items tighter on mobile */
  .alert-item {
    padding: 12px 16px;
  }

  .alert-item__title {
    font-size: 0.8rem;
  }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 4px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ─── Selection ─── */
::selection {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
