/* ==========================================================================
   AEROSPHERE WEATHER - MODERN GLASSMORPHIC DESIGN SYSTEM
   Full Mobile Responsive Edition (Phones, Tablets & Desktops)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #0b1329;
  --bg-surface: rgba(255, 255, 255, 0.07);
  --bg-surface-hover: rgba(255, 255, 255, 0.12);
  --bg-surface-active: rgba(255, 255, 255, 0.16);
  --border-glass: rgba(255, 255, 255, 0.14);
  --border-glass-light: rgba(255, 255, 255, 0.25);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;

  /* Elevation & Glass */
  --glass-blur: blur(24px);
  --glass-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.45), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  --glass-shadow-hover: 0 20px 44px -6px rgba(0, 0, 0, 0.55), 0 0 2px 1px rgba(255, 255, 255, 0.18);

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Dynamic Canvas */
#weather-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* Overlay for atmospheric depth */
.atmospheric-vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, transparent 40%, rgba(5, 10, 20, 0.45) 100%);
  pointer-events: none;
  z-index: 1;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 2;
  max-width: 1240px;
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(3rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ==========================================================================
   TOP NAVIGATION & CONTROLS
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.4);
}

.brand-icon svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Search Bar */
.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 520px;
  min-width: 240px;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 3.25rem 0 3.25rem;
  font-family: inherit;
  font-size: 1rem; /* 16px avoids iOS Safari auto-zoom on input focus */
  color: var(--text-main);
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  outline: none;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-normal);
}

.search-input:focus {
  background: var(--bg-surface-hover);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), var(--glass-shadow);
}

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

.search-icon-btn {
  position: absolute;
  left: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.geo-btn {
  position: absolute;
  right: 0.5rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.geo-btn:hover, .geo-btn:active {
  background: var(--accent-cyan);
  color: #0b1329;
  transform: scale(1.06);
}

/* Suggestions Dropdown */
.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  z-index: 100;
  overflow-y: auto;
  max-height: 280px;
  display: none;
}

.search-suggestions.active {
  display: block;
}

.suggestion-item {
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-fast);
}

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

.suggestion-item:hover, .suggestion-item:active {
  background: rgba(56, 189, 248, 0.18);
}

.city-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.city-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.action-btn {
  height: 44px;
  min-width: 44px;
  padding: 0 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition-fast);
  box-shadow: var(--glass-shadow);
}

.action-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-glass-light);
  transform: translateY(-2px);
}

.action-btn:active {
  transform: scale(0.96);
}

.action-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Quick City Chips Bar */
.quick-chips-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.2rem 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.quick-chips-wrapper::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.quick-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: var(--border-glass-light);
}

.quick-chip:active {
  transform: scale(0.95);
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
}

/* Status Banner */
.status-banner {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #fde68a;
  line-height: 1.4;
}

.banner-close {
  background: none;
  border: none;
  color: #fde68a;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 0.4rem;
  flex-shrink: 0;
}

/* ==========================================================================
   DASHBOARD GRID LAYOUT
   ========================================================================== */
.weather-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .weather-dashboard {
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
  }
}

.column-left, .column-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Glassmorphic Card Surface */
.glass-card {
  background: var(--bg-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--glass-shadow);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

@media (hover: hover) and (pointer: fine) {
  .glass-card:hover {
    border-color: var(--border-glass-light);
    box-shadow: var(--glass-shadow-hover);
  }
}

/* ==========================================================================
   HERO WEATHER CARD
   ========================================================================== */
.hero-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 80% 20%, rgba(56, 189, 248, 0.15), transparent 50%);
  pointer-events: none;
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.location-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.6rem, 5.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  line-height: 1.15;
  word-break: break-word;
}

.country-code {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-muted);
}

.date-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.status-pill.success {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

.status-pill.warning {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-dot.success { background: #10b981; box-shadow: 0 0 6px #10b981; }
.badge-dot.warning { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }

/* Hero Body & Temperature */
.hero-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.temp-display {
  display: flex;
  align-items: flex-start;
}

.temp-value {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(3.75rem, 14vw, 5.75rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #ffffff 40%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.temp-unit {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  font-weight: 400;
  color: var(--accent-cyan);
  margin-top: 0.25rem;
  margin-left: 0.2rem;
}

.condition-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
}

.condition-icon-container {
  width: clamp(80px, 18vw, 110px);
  height: clamp(80px, 18vw, 110px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.condition-text {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1rem, 3.5vw, 1.25rem);
  font-weight: 600;
  color: var(--text-main);
  margin-top: 0.25rem;
}

.hero-footer {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.92rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.hero-footer strong {
  color: var(--text-main);
}

/* ==========================================================================
   WEATHER SVG ICONS & MICRO-ANIMATIONS
   ========================================================================== */
.weather-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.25));
}

.weather-svg.sunny {
  animation: floatSlow 4s ease-in-out infinite;
}

.weather-svg.sunny circle {
  animation: pulseGlow 3s ease-in-out infinite alternate;
}

.weather-svg.rainy .rain-lines line {
  animation: rainFall 1s linear infinite;
}

.weather-svg.rainy .rain-lines line:nth-child(2) {
  animation-delay: 0.3s;
}
.weather-svg.rainy .rain-lines line:nth-child(3) {
  animation-delay: 0.6s;
}

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

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.95; }
  100% { transform: scale(1.04); opacity: 1; }
}

@keyframes rainFall {
  0% { stroke-dashoffset: -10; opacity: 1; }
  100% { stroke-dashoffset: 20; opacity: 0.2; }
}

/* ==========================================================================
   HOURLY FORECAST CAROUSEL
   ========================================================================== */
.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title svg {
  width: 18px;
  height: 18px;
  color: var(--accent-cyan);
}

.hourly-scroll-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  padding-bottom: 0.5rem;
}

.hourly-scroll-container::-webkit-scrollbar {
  height: 6px;
}
.hourly-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}

.hourly-track {
  display: flex;
  gap: 0.75rem;
}

.hourly-card {
  flex: 0 0 78px;
  scroll-snap-align: start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.9rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-normal);
}

.hourly-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
  border-color: var(--border-glass-light);
}

.hourly-card.now-card {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
}

.hourly-time {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hourly-icon {
  width: 34px;
  height: 34px;
}

.hourly-temp {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.hourly-pop {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* ==========================================================================
   METRICS GRID
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.metric-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  gap: 0.4rem;
}

.metric-header svg {
  width: 18px;
  height: 18px;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.metric-body {
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

.metric-number {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.5rem, 4.5vw, 1.95rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.metric-unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.2rem;
}

.metric-footer {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.metric-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.metric-tag.safe { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.metric-tag.moderate { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.metric-tag.high { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.metric-tag.extreme { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

/* Wind Compass */
.compass-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.4rem;
}

.compass-needle {
  width: 4px;
  height: 36px;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.compass-needle::before {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 12px solid var(--accent-rose);
}

.compass-needle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -4px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 12px solid #cbd5e1;
}

/* Humidity Liquid Gauge */
.humidity-gauge {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.5rem;
}

.humidity-level-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #3b82f6);
  border-radius: var(--radius-full);
  transition: width 0.8s ease-out;
}

/* UV Arc SVG Meter */
.uv-arc-svg {
  width: 70px;
  height: 38px;
}

.uv-arc-bg {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 6;
  fill: none;
}

.uv-arc-fill {
  stroke: url(#uvGradient);
  stroke-width: 6;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-out;
}

/* Sun Arc Tracker */
.sun-arc-container {
  width: 100%;
  height: 44px;
  margin-top: 0.4rem;
}

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

.sun-arc-path {
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 2;
  stroke-dasharray: 4 4;
  fill: none;
}

.sun-arc-dot {
  fill: #fbbf24;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.8));
  transition: all 0.6s ease;
}

/* AQI Gradient Bar */
.aqi-bar-wrapper {
  position: relative;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 50%, #ef4444 80%, #7c3aed 100%);
  margin-top: 0.6rem;
}

.aqi-gradient-indicator {
  position: absolute;
  top: -4px;
  left: 30%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #0b1329;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
  transform: translateX(-50%);
  transition: left 0.6s ease;
}

/* ==========================================================================
   7-DAY FORECAST SECTION
   ========================================================================== */
.daily-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.daily-row {
  display: grid;
  grid-template-columns: 75px 1.2fr 1.6fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.daily-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.daily-day {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.daily-icon-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.daily-icon-wrapper svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.daily-cond-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-temp-bar-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.daily-min, .daily-max {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  width: 30px;
}

.daily-min { color: var(--text-muted); text-align: right; }
.daily-max { color: var(--text-main); text-align: left; }

.temp-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  position: relative;
  overflow: hidden;
}

.temp-bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #f59e0b);
  border-radius: var(--radius-full);
}

/* ==========================================================================
   SETTINGS MODAL & DIALOG
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.input-key {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: monospace;
  font-size: 0.9rem;
  outline: none;
}

.input-key:focus {
  border-color: var(--accent-cyan);
}

.btn-primary {
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.45);
}

.btn-primary:active {
  transform: scale(0.97);
}

/* ==========================================================================
   LOADING OVERLAY & TOAST NOTIFICATIONS
   ========================================================================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 19, 41, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  left: 1.5rem;
  max-width: 420px;
  margin-left: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast-pill {
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass-light);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto;
}

.toast-pill.error {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(30, 15, 20, 0.95);
}

.toast-pill.success {
  border-color: rgba(16, 185, 129, 0.5);
}

.toast-pill.fade-out {
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.4s ease;
}

@keyframes toastIn {
  to { transform: translateY(0); }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE ENHANCEMENTS
   ========================================================================== */

/* Tablets & Small Desktops (<= 1023px) */
@media (max-width: 1023px) {
  .app-container {
    padding: 1.25rem 1rem 3rem;
    gap: 1.25rem;
  }

  .weather-dashboard {
    grid-template-columns: 1fr;
  }
}

/* Phones & Phablets (<= 768px) */
@media (max-width: 768px) {
  .app-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: 
      "brand actions"
      "search search";
    gap: 0.85rem 0.5rem;
  }

  .brand {
    grid-area: brand;
  }

  .header-actions {
    grid-area: actions;
  }

  .search-wrapper {
    grid-area: search;
    max-width: 100%;
    min-width: 100%;
  }

  .glass-card {
    padding: 1.35rem 1.15rem;
    border-radius: var(--radius-md);
  }

  .hourly-card {
    flex: 0 0 74px;
    padding: 0.85rem 0.35rem;
  }

  .hourly-time {
    font-size: 0.78rem;
  }

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

  .hourly-temp {
    font-size: 1.05rem;
  }

  /* 7-Day Forecast adjustments */
  .daily-row {
    grid-template-columns: 60px 1.1fr 130px;
    gap: 0.5rem;
    padding: 0.6rem 0.3rem;
  }
}

/* Compact Phones (<= 480px) */
@media (max-width: 480px) {
  .app-container {
    padding: max(0.85rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(2.5rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    gap: 1rem;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 1.3rem;
  }

  .action-btn {
    height: 40px;
    min-width: 40px;
    padding: 0 0.6rem;
    font-size: 0.82rem;
  }

  .search-input {
    height: 44px;
    padding-left: 2.85rem;
  }

  .search-icon-btn {
    left: 0.85rem;
  }

  .hero-card {
    padding: 1.25rem 1rem;
  }

  .hero-body {
    margin-bottom: 1rem;
  }

  .condition-icon-container {
    width: 75px;
    height: 75px;
  }

  .hero-footer {
    gap: 0.5rem 1.25rem;
    font-size: 0.85rem;
    padding-top: 1rem;
  }

  /* 2-column square tiles on mobile */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .metric-card {
    padding: 0.95rem 0.85rem;
    min-height: 145px;
  }

  .metric-header {
    font-size: 0.72rem;
  }

  .metric-header svg {
    width: 15px;
    height: 15px;
  }

  .metric-number {
    font-size: 1.55rem;
  }

  .metric-unit {
    font-size: 0.75rem;
  }

  .compass-wrapper {
    width: 40px;
    height: 40px;
  }

  .compass-needle {
    height: 30px;
  }

  .uv-arc-svg {
    width: 58px;
    height: 32px;
  }

  .sun-arc-container {
    height: 36px;
  }

  /* 7-Day Forecast ultra-clean layout */
  .daily-row {
    grid-template-columns: 50px auto 110px;
    gap: 0.35rem;
    padding: 0.55rem 0.2rem;
  }

  .daily-day {
    font-size: 0.88rem;
  }

  .daily-icon-wrapper svg {
    width: 26px;
    height: 26px;
  }

  .daily-cond-text {
    font-size: 0.78rem;
  }

  .daily-min, .daily-max {
    font-size: 0.85rem;
    width: 26px;
  }

  /* Mobile Bottom Sheet Modal */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
    padding: 1.5rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
    transform: translateY(100%);
  }

  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }

  #toast-container {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
  }
}

/* Ultra-Narrow Devices (<= 340px) */
@media (max-width: 340px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .hero-body {
    flex-direction: column;
    align-items: flex-start;
  }

  .condition-visual {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }
}

/* Landscape Phone Support */
@media (max-height: 500px) and (orientation: landscape) {
  .app-container {
    padding-top: 0.75rem;
    padding-bottom: 1.5rem;
  }

  .modal-overlay {
    align-items: center;
    padding: 1rem;
  }

  .modal-content {
    max-height: 92vh;
    border-radius: var(--radius-lg);
    overflow-y: auto;
  }
}

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