/* CSS Variables for Theme Management */
:root {
  --primary-bg: #101a28;
  --secondary-bg: #19283a;
  --glass-bg: #172639;
  --surface-input: #121f30;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd6e2;
  --text-muted: #9cabbc;
  --accent-color: #67b2e8;
  --chart-line-color: #67b2e8;
  --chart-fill-color: rgba(103, 178, 232, 0.11);
  --chart-grid-color: rgba(203, 214, 226, 0.12);
  --chart-text-color: #cbd6e2;
  --chart-point-border: #172639;
  --error-color: #ff6b6b;
  --success-color: #4ecdc4;
  --warning-color: #ffe66d;
  --border-color: rgba(203, 214, 226, 0.11);
  --shadow-light: rgba(255, 255, 255, 0.02);
  --shadow-dark: rgba(0, 0, 0, 0.16);
  --backdrop-filter: none;
  --border-radius: 16px;
  --transition-smooth: all 0.18s ease;
  --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --primary-bg: #101a28;
  --secondary-bg: #19283a;
  --glass-bg: #172639;
  --surface-input: #121f30;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd6e2;
  --text-muted: #9cabbc;
  --accent-color: #67b2e8;
  --chart-line-color: #67b2e8;
  --chart-fill-color: rgba(103, 178, 232, 0.11);
  --chart-grid-color: rgba(203, 214, 226, 0.12);
  --chart-text-color: #cbd6e2;
  --chart-point-border: #172639;
  --border-color: rgba(203, 214, 226, 0.11);
  --shadow-light: rgba(255, 255, 255, 0.02);
  --shadow-dark: rgba(0, 0, 0, 0.16);
}

/* Light Theme Variables */
[data-theme="light"] {
  --primary-bg: #f4f7fa;
  --secondary-bg: #ffffff;
  --glass-bg: #ffffff;
  --surface-input: #ffffff;
  --text-primary: #172638;
  --text-secondary: #46576c;
  --text-muted: #65768a;
  --accent-color: #347ea5;
  --chart-line-color: #347ea5;
  --chart-fill-color: rgba(52, 126, 165, 0.09);
  --chart-grid-color: rgba(23, 38, 56, 0.12);
  --chart-text-color: #65768a;
  --chart-point-border: #ffffff;
  --border-color: rgba(23, 38, 56, 0.12);
  --shadow-light: rgba(255, 255, 255, 0.8);
  --shadow-dark: rgba(23, 38, 56, 0.07);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--primary-bg);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  transition: var(--transition-smooth);
}

/* Background Animation Container */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  overflow: hidden;
}

.background-animation {
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--primary-bg);
  transition: var(--transition-smooth);
}

/* Weather-based backgrounds */
.background-animation.clear-day {
  background: linear-gradient(135deg, #1a2a37 0%, #253f50 55%, #315565 100%);
}

.background-animation.clear-night {
  background: linear-gradient(135deg, #0b1220 0%, #111e30 55%, #172940 100%);
}

.background-animation.cloudy {
  background: linear-gradient(135deg, #283544 0%, #394a5c 100%);
}

.background-animation.rainy {
  background: linear-gradient(135deg, #112a40 0%, #1c405b 55%, #25394d 100%);
}

.background-animation.snowy {
  background: linear-gradient(135deg, #27394c 0%, #354e64 55%, #435d73 100%);
}

/* Weather Particles */
.weather-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* Rain Particles */
.weather-particles.rain::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='%23ffffff'%3E%3Cpath d='M20 20L25 80M40 20L45 80M60 20L65 80M80 20L85 80' stroke='%23ffffff' stroke-width='1' opacity='0.3'/%3E%3C/g%3E%3C/svg%3E") repeat;
  animation: rain 0.5s linear infinite;
}

/* Snow Particles */
.weather-particles.snow::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='20' cy='20' r='2' opacity='0.8'/%3E%3Ccircle cx='80' cy='20' r='2' opacity='0.6'/%3E%3Ccircle cx='60' cy='60' r='2' opacity='0.7'/%3E%3Ccircle cx='30' cy='80' r='2' opacity='0.5'/%3E%3C/g%3E%3C/svg%3E") repeat;
  animation: snow 3s linear infinite;
}

@keyframes rain {
  0% { transform: translateY(-100px); }
  100% { transform: translateY(100vh); }
}

@keyframes snow {
  0% { transform: translateY(-100px) rotate(0deg); }
  100% { transform: translateY(100vh) rotate(360deg); }
}

/* App Container */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  margin-bottom: 30px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.app-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text-primary);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.app-title i {
  font-size: 1.2em;
  color: var(--accent-color);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
  backdrop-filter: var(--backdrop-filter);
  font-size: 1.2rem;
}

.theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 30px var(--shadow-dark);
}

/* Search Section */
.search-section {
  margin-bottom: 30px;
}

.search-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

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

.search-icon {
  position: absolute;
  left: 20px;
  color: var(--text-muted);
  z-index: 2;
}

.search-input {
  width: 100%;
  padding: 18px 20px 18px 50px;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  backdrop-filter: var(--backdrop-filter);
  transition: var(--transition-smooth);
}

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

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
  transform: translateY(-2px);
}

.search-btn {
  position: absolute;
  right: 8px;
  background: var(--accent-color);
  border: none;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: var(--transition-bounce);
  z-index: 2;
}

.search-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 20px rgba(79, 172, 254, 0.3);
}

.location-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 25px;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-bounce);
  backdrop-filter: var(--backdrop-filter);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  min-height: 56px;
}

.location-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--shadow-dark);
  border-color: var(--accent-color);
}

.location-btn i {
  font-size: 1.1rem;
}

/* Glassmorphism Effect */
.glassmorphism {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-filter);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 
    0 8px 32px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

/* Loading Spinner */
.loader-container {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.loader-container.show {
  display: flex;
}

.weather-loader {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 20px;
}

.sun {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 30px;
  height: 30px;
  background: #ffd700;
  border-radius: 50%;
  animation: sunRotate 4s linear infinite;
}

.sun-rays {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, transparent 40%, rgba(255, 215, 0, 0.3) 41%);
  border-radius: 50%;
}

.cloud {
  position: absolute;
  background: #ffffff;
  border-radius: 50px;
}

.cloud1 {
  width: 50px;
  height: 20px;
  top: 40px;
  left: 10px;
  animation: cloudFloat 3s ease-in-out infinite;
}

.cloud2 {
  width: 40px;
  height: 15px;
  top: 30px;
  right: 10px;
  animation: cloudFloat 3s ease-in-out infinite reverse;
}

.rain-drops {
  position: absolute;
  top: 60px;
  left: 30px;
  width: 40px;
  height: 20px;
}

.drop {
  position: absolute;
  width: 2px;
  height: 10px;
  background: #74b9ff;
  border-radius: 2px;
  animation: rainDrop 1s ease-in-out infinite;
}

.drop:nth-child(1) {
  left: 10px;
  animation-delay: 0s;
}

.drop:nth-child(2) {
  left: 20px;
  animation-delay: 0.3s;
}

.drop:nth-child(3) {
  left: 30px;
  animation-delay: 0.6s;
}

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

@keyframes cloudFloat {
  0%, 100% { transform: translateX(0px); }
  50% { transform: translateX(10px); }
}

@keyframes rainDrop {
  0% { opacity: 1; transform: translateY(0px); }
  100% { opacity: 0; transform: translateY(20px); }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Error Container */
.error-container {
  display: none;
  text-align: center;
  padding: 40px 20px;
}

.error-container.show {
  display: block;
}

.error-content {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-filter);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 40px;
  max-width: 500px;
  margin: 0 auto;
}

.error-icon {
  font-size: 3rem;
  color: var(--error-color);
  margin-bottom: 20px;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.error-message {
  color: var(--text-secondary);
  margin-bottom: 25px;
  line-height: 1.6;
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--accent-color);
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(79, 172, 254, 0.3);
}

/* Weather Content */
.weather-content {
  display: none;
  grid-template-columns: 1fr;
  gap: 30px;
}

.weather-content.show {
  display: grid;
}

/* Current Weather Card */
.current-weather-card {
  padding: 30px;
  transition: var(--transition-smooth);
}

.current-weather-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px var(--shadow-dark);
}

.current-weather-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
}

.location-name {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.last-updated {
  color: var(--text-muted);
  font-size: 14px;
}

.weather-icon-container {
  flex-shrink: 0;
}

.weather-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.temperature-section {
  margin-bottom: 30px;
}

.main-temperature {
  display: flex;
  align-items: baseline;
  gap: 15px;
  margin-bottom: 10px;
}

.temperature {
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1;
}

.condition {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  font-weight: 500;
}

.feels-like {
  color: var(--text-muted);
  font-size: 16px;
}

/* Weather Details Grid */
.weather-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  transition: var(--transition-smooth);
}

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

.detail-icon {
  font-size: 1.2rem;
  color: var(--accent-color);
  width: 20px;
  text-align: center;
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.detail-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Section Titles */
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 25px;
}

.section-title i {
  color: var(--accent-color);
}

/* Chart Section */
.chart-section {
  padding: 30px;
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Forecast Section */
.forecast-section {
  padding: 30px;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
}

.forecast-item {
  text-align: center;
  padding: 20px 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.forecast-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px var(--shadow-dark);
}

.forecast-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.forecast-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 15px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
}

.forecast-temps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.temp-max {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.temp-min {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
}

.forecast-condition {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: capitalize;
  line-height: 1.3;
}

.forecast-rain {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.forecast-rain i {
  color: var(--accent-color);
}

/* Responsive Design */
@media (min-width: 768px) {
  .app-container {
    padding: 40px;
  }
  
  .search-container {
    flex-direction: row;
    align-items: center;
    gap: 20px;
  }
  
  .search-input-container {
    flex: 1;
  }
  
  .location-btn {
    flex-shrink: 0;
    min-width: 180px;
  }
  
  .weather-content {
    grid-template-columns: 1fr;
  }
  
  .weather-details-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .weather-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  
  .current-weather-card,
  .chart-section,
  .forecast-section {
    grid-column: 1 / -1;
  }
  
  .forecast-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
  }
  
  .forecast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 8px;
    gap: 0;
  }
  
  .forecast-date {
    min-width: 0;
    margin-bottom: 6px;
    font-size: 12px;
  }
  
  .forecast-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 6px;
    flex-shrink: 0;
  }
  
  .forecast-temps {
    margin: 0;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  
  .forecast-condition {
    display: none;
  }
}

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

/* Mobile Optimizations */
@media (max-width: 480px) {
  .app-container {
    padding: 15px;
  }
  
  .current-weather-card {
    padding: 20px;
  }
  
  .current-weather-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }
  
  .main-temperature {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }
  
  .weather-details-grid {
    grid-template-columns: 1fr;
  }
  
  .forecast-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .chart-section,
  .forecast-section {
    padding: 20px;
  }
  
  .section-title {
    font-size: 1.1rem;
  }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .weather-icon,
  .forecast-icon {
    image-rendering: 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;
  }
  
  .weather-particles::before {
    animation: none;
  }
}

/* Focus Styles for Accessibility */
button:focus,
input:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Loading States */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

.loading * {
  cursor: wait !important;
}

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

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(79, 172, 254, 0.8);
}

/* Print Styles */
@media print {
  .background-container,
  .weather-particles,
  .theme-toggle,
  .search-section,
  .loader-container,
  .error-container {
    display: none !important;
  }
  
  .app-container {
    max-width: none;
    padding: 0;
  }
  
  .glassmorphism {
    background: white;
    color: black;
    border: 1px solid #ccc;
  }
}

/* UI refresh: calmer hierarchy and easier forecast scanning */
.brand-lockup { display: grid; gap: 4px; }
.app-kicker { margin-left: 48px; color: var(--text-muted); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.02em; }
.search-section { margin-bottom: 24px; }
.search-container { padding: 8px; border: 1px solid var(--border-color); border-radius: calc(var(--border-radius) + 4px); background: rgba(9, 20, 53, 0.16); backdrop-filter: var(--backdrop-filter); }
.search-input { background: rgba(255, 255, 255, 0.08); border-color: transparent; }
.search-input:focus { background: rgba(255, 255, 255, 0.14); }
.location-btn { min-height: 48px; padding: 12px 18px; background: transparent; border-color: transparent; }
.location-btn:hover { background: rgba(255, 255, 255, 0.1); }
.current-weather-card { overflow: hidden; }
.current-weather-card::before { content: ''; display: block; height: 3px; margin: -30px -30px 26px; background: linear-gradient(90deg, var(--accent-color), rgba(255, 255, 255, 0)); }
.weather-icon { width: 96px; height: 96px; }
.weather-summary { max-width: 52ch; margin-top: 16px; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.55; }
.detail-item { border: 1px solid rgba(255, 255, 255, 0.06); }
.forecast-item { border: 1px solid transparent; }
.forecast-item.is-today { border-color: rgba(79, 172, 254, 0.7); background: rgba(79, 172, 254, 0.14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16); }
.forecast-item.is-today .forecast-date { color: var(--text-primary); }
.app-footer { display: flex; justify-content: center; gap: 10px; padding: 32px 0 10px; color: var(--text-muted); font-size: 0.82rem; }
@media (min-width: 768px) { .search-container { gap: 8px; } .location-btn { min-width: auto; } }
@media (max-width: 480px) { .app-kicker { margin-left: 0; } .current-weather-card::before { margin: -20px -20px 20px; } .weather-summary { text-align: center; } .app-footer { flex-wrap: wrap; padding-top: 24px; } }


/* Footer credit and linked social profiles */
.app-footer {
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 0 12px;
}
.footer-credit {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.footer-social-links {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-social-link {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 1.1rem;
  text-decoration: none;
  transition: var(--transition-smooth);
}
.footer-social-link:hover,
.footer-social-link:focus-visible {
  color: var(--text-primary);
  background: var(--accent-color);
  border-color: transparent;
  transform: translateY(-2px);
}
.footer-social-link:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
}


/* Keep the author footer out of the initial loading state; retain it after first data load. */
body.loading:not(.has-weather-data) .app-footer {
  display: none;
}


.footer-brand {
  color: var(--text-primary);
  font-weight: 700;
}


/* Subtle divider between weather content and the footer */
.app-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}


/* Match the reference's icon-and-label social links */
.footer-social-links {
  gap: 24px;
}
.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  height: auto;
  padding: 4px 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 1rem;
}
.footer-social-link:hover,
.footer-social-link:focus-visible {
  color: var(--accent-color);
  background: transparent;
  border-color: transparent;
  transform: none;
}



/* Refined surfaces, contrast, and theme-aware condition backdrops */
[data-theme="light"] .background-animation.clear-day {
  background: linear-gradient(135deg, #f4ebd5 0%, #e9dfd1 55%, #d8e1e5 100%);
}
[data-theme="light"] .background-animation.clear-night {
  background: linear-gradient(135deg, #d9e3ef 0%, #c7d4e3 55%, #b6c8da 100%);
}
[data-theme="light"] .background-animation.cloudy {
  background: linear-gradient(135deg, #e7edf3 0%, #d3dde7 100%);
}
[data-theme="light"] .background-animation.rainy {
  background: linear-gradient(135deg, #dce9f4 0%, #c8dceb 55%, #b9cbdc 100%);
}
[data-theme="light"] .background-animation.snowy {
  background: linear-gradient(135deg, #e8eef5 0%, #d9e3ed 55%, #c9d7e5 100%);
}

.search-container {
  background: var(--secondary-bg);
}
.search-input,
.search-input:focus {
  background: var(--surface-input);
  border: 1px solid var(--border-color);
}
.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(88, 183, 255, 0.14);
}

.glassmorphism {
  background: var(--glass-bg);
  border-color: var(--border-color);
  box-shadow:
    0 12px 32px var(--shadow-dark),
    inset 0 1px 0 var(--shadow-light);
}

.detail-item {
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
}
.detail-item:hover {
  background: var(--secondary-bg);
  border-color: var(--border-color);
  transform: translateY(-1px);
}
[data-theme="dark"] .detail-item:hover {
  background: #192a40;
}
[data-theme="light"] .detail-item:hover {
  background: #edf3fa;
}

.forecast-item {
  background: var(--secondary-bg);
  border-color: var(--border-color);
}
[data-theme="dark"] .forecast-item:hover {
  background: #192a40;
}
[data-theme="light"] .forecast-item:hover {
  background: #edf3fa;
}
.forecast-item.is-today {
  border-color: rgba(88, 183, 255, 0.58);
  background: rgba(88, 183, 255, 0.12);
}
[data-theme="light"] .forecast-item.is-today {
  border-color: rgba(0, 110, 175, 0.38);
  background: rgba(0, 110, 175, 0.08);
}
.current-weather-card::before {
  background: linear-gradient(90deg, var(--accent-color), transparent);
}


/* Compact Celsius/Fahrenheit segmented control with a sliding active thumb */
.unit-toggle {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-filter);
}
.unit-toggle::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 4px;
  left: 4px;
  width: 36px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  transform: translateX(0);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.unit-toggle[data-unit="F"]::before {
  transform: translateX(38px);
}
.unit-option {
  position: relative;
  z-index: 1;
  flex: 0 0 36px;
  min-width: 36px;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 180ms ease;
}
.unit-option:not(.is-active):hover {
  color: var(--text-primary);
}
.unit-option.is-active,
.unit-option.is-active:hover {
  color: #0b1220;
  background: transparent;
}
[data-theme="light"] .unit-option.is-active,
[data-theme="light"] .unit-option.is-active:hover {
  color: #ffffff;
}
.unit-option:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}


/* Saved and recent city shortcuts */
.city-shortcuts[hidden],
.city-shortcut-group[hidden] {
  display: none !important;
}
.city-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: -8px 8px 24px;
}
.city-shortcut-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.city-shortcut-label {
  min-width: 52px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.city-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.city-chip {
  max-width: min(340px, 72vw);
  overflow: hidden;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--glass-bg);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.city-chip:hover,
.city-chip:focus-visible {
  border-color: var(--accent-color);
  color: var(--text-primary);
}
.city-chip.is-current {
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.city-shortcut-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Save and refresh controls with clear data-freshness context */
.location-heading-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 5px;
}
.location-heading-row .location-name {
  margin-bottom: 0;
}

.city-local-time {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.city-local-time i {
  color: var(--accent-color);
}

.city-local-time time {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

@media (max-width: 767px) {
  .city-local-time {
    justify-content: center;
  }
}
.save-city-btn,
.refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--glass-bg);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.save-city-btn:hover:not(:disabled),
.refresh-btn:hover:not(:disabled),
.save-city-btn:focus-visible,
.refresh-btn:focus-visible {
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.save-city-btn.is-saved {
  color: var(--accent-color);
}
.save-city-btn:disabled,
.refresh-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}
.location-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.location-meta-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.location-meta-copy .last-updated {
  margin: 0;
}
.data-freshness {
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}
.data-freshness.is-stale {
  color: #f0b44d;
}
[data-theme="light"] .data-freshness.is-stale {
  color: #8b5a00;
}
.refresh-btn.is-refreshing i {
  animation: weatherRefreshSpin 900ms linear infinite;
}
@keyframes weatherRefreshSpin {
  to { transform: rotate(360deg); }
}
@media (max-width: 480px) {
  .city-shortcuts {
    margin: -8px 0 20px;
  }
  .city-shortcut-label {
    min-width: 46px;
  }
  .location-heading-row {
    justify-content: center;
  }
  .location-meta-row {
    justify-content: center;
  }
  .location-meta-copy {
    text-align: center;
  }
}


/* Fluid refinements for phones, tablets, and wide screens */
.app-container {
  width: 100%;
  min-height: 100svh;
  padding: clamp(16px, 3.2vw, 40px);
}

.weather-content > *,
.location-info,
.detail-content,
.brand-lockup {
  min-width: 0;
}

@media (min-width: 768px) {
  .app-container {
    padding: clamp(28px, 4vw, 40px);
  }
}

@media (min-width: 481px) and (max-width: 1023px) {
  .forecast-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 14px;
  }
}

@media (max-width: 600px) {
  .header-content {
    gap: 12px;
  }

  .app-title {
    gap: 10px;
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  .header-controls {
    gap: 8px;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .search-container {
    gap: 8px;
  }

  .location-btn {
    width: 100%;
    justify-content: center;
  }

  .weather-content {
    gap: 18px;
  }

  .current-weather-card,
  .chart-section,
  .forecast-section {
    padding: clamp(16px, 4vw, 20px);
  }

  .weather-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .detail-item {
    gap: 8px;
    padding: 12px 10px;
  }

  .detail-label {
    font-size: 10px;
    letter-spacing: 0.35px;
  }

  .detail-value {
    font-size: 14px;
  }

  .chart-container {
    height: clamp(220px, 64vw, 280px);
  }

  .forecast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .forecast-item {
    min-width: 0;
    padding: 14px 8px;
  }

  .forecast-date {
    font-size: 12px;
  }

  .forecast-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 8px;
  }

  .city-chip {
    min-height: 36px;
  }

  .save-city-btn,
  .refresh-btn {
    min-height: 40px;
  }

  .footer-credit {
    text-align: center;
    line-height: 1.5;
  }

  .footer-social-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 360px) {
  .app-container {
    padding: 12px;
  }

  .header-content {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .header-controls {
    margin-left: auto;
  }

  .section-title {
    gap: 8px;
    font-size: 1rem;
  }

  .current-weather-card,
  .chart-section,
  .forecast-section {
    padding: 16px;
  }

  .forecast-grid {
    gap: 10px;
  }

  .forecast-item {
    padding: 12px 6px;
  }

  .temp-max {
    font-size: 16px;
  }

  .temp-min {
    font-size: 14px;
  }
}


/* Keyboard-accessible city suggestions */
.search-section {
  position: relative;
  z-index: 10;
}

.search-input-container {
  z-index: 1;
}

.city-suggestions[hidden] {
  display: none;
}

.city-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 5;
  display: grid;
  gap: 4px;
  max-height: min(360px, 50vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--glass-bg);
  box-shadow: 0 16px 36px var(--shadow-dark);
  backdrop-filter: var(--backdrop-filter);
}

.city-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 48px;
  padding: 10px 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.city-suggestion:hover,
.city-suggestion.is-active {
  background: var(--secondary-bg);
}

.city-suggestion-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-suggestion-meta {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}

.city-suggestion-details {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-suggestion-source {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--secondary-bg);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
}


.city-suggestion-status {
  padding: 9px 14px;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  cursor: default;
}

@media (max-width: 600px) {
  .city-suggestions {
    max-height: min(360px, 50vh);
  }

  .city-suggestion {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 9px 12px;
  }

  .city-suggestion-meta {
    width: 100%;
    justify-content: space-between;
  }

  .city-suggestion-details {
    text-align: left;
  }
}

/* Skylens visual refresh: editorial weather hero, quiet surfaces, and a clear forecast strip. */
:root,
[data-theme="light"] {
  --primary-bg: #eef3f4;
  --secondary-bg: #f5f8f8;
  --glass-bg: #ffffff;
  --surface-input: #f8fbfb;
  --text-primary: #172b38;
  --text-secondary: #506574;
  --text-muted: #778894;
  --accent-color: #24788a;
  --chart-line-color: #24788a;
  --chart-fill-color: rgba(36, 120, 138, 0.12);
  --chart-grid-color: rgba(23, 43, 56, 0.1);
  --chart-text-color: #667984;
  --chart-point-border: #ffffff;
  --border-color: rgba(23, 43, 56, 0.1);
  --shadow-light: rgba(255, 255, 255, 0.85);
  --shadow-dark: rgba(25, 50, 62, 0.075);
  --backdrop-filter: none;
  --border-radius: 22px;
}

[data-theme="dark"] {
  --primary-bg: #101923;
  --secondary-bg: #182532;
  --glass-bg: #152330;
  --surface-input: #0e1924;
  --text-primary: #edf3f5;
  --text-secondary: #c0cdd3;
  --text-muted: #8fa0aa;
  --accent-color: #75c2cb;
  --chart-line-color: #75c2cb;
  --chart-fill-color: rgba(117, 194, 203, 0.13);
  --chart-grid-color: rgba(213, 228, 232, 0.12);
  --chart-text-color: #c0cdd3;
  --chart-point-border: #152330;
  --border-color: rgba(213, 228, 232, 0.1);
  --shadow-light: rgba(255, 255, 255, 0.02);
  --shadow-dark: rgba(0, 0, 0, 0.2);
  --backdrop-filter: none;
  --border-radius: 22px;
}

body {
  background: var(--primary-bg);
}

.background-animation.clear-day,
.background-animation.clear-night,
.background-animation.cloudy,
.background-animation.rainy,
.background-animation.snowy {
  background: var(--primary-bg);
}

.weather-particles {
  display: none !important;
}

.app-container {
  width: min(100%, 1320px);
  max-width: 1320px;
  padding: clamp(20px, 4vw, 48px);
}

.header {
  margin-bottom: clamp(26px, 4vw, 48px);
}

.header-content {
  padding: 10px 0 24px;
  border-bottom: 1px solid var(--border-color);
}

.app-title {
  color: var(--text-primary);
  letter-spacing: -0.045em;
  text-shadow: none;
}

.app-title i {
  color: var(--accent-color);
}

.app-kicker {
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.header-controls {
  gap: 12px;
}

.search-container {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: 0 10px 28px var(--shadow-dark);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.search-input-container {
  background: var(--surface-input);
}

.glassmorphism {
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 12px 32px var(--shadow-dark);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.weather-content {
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.current-weather-card {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  column-gap: clamp(28px, 5vw, 64px);
  row-gap: 26px;
  padding: clamp(26px, 4vw, 44px);
  overflow: hidden;
  transition: none;
}

.current-weather-card::before {
  display: none;
}

.current-weather-card:hover,
.chart-section:hover,
.forecast-section:hover {
  transform: none;
  box-shadow: 0 12px 32px var(--shadow-dark);
}

.current-weather-header {
  grid-column: 1 / -1;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.location-name,
.section-title {
  color: var(--text-primary);
  letter-spacing: -0.035em;
}

.location-name {
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 650;
}

.location-info {
  min-width: 0;
}

.weather-icon-container {
  flex: 0 0 auto;
  margin: 0 6px 0 0;
}

.weather-icon {
  display: block;
  width: clamp(72px, 8vw, 98px);
  height: clamp(72px, 8vw, 98px);
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 7px 12px var(--shadow-dark));
}

.temperature-section {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  margin: 0;
  padding: 20px 0;
}

.main-temperature {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
}

.temperature {
  color: var(--text-primary);
  font-size: clamp(4.6rem, 9vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.condition {
  color: var(--text-secondary);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 550;
}

.feels-like {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.weather-summary {
  max-width: 38ch;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.weather-details-grid {
  grid-column: 2;
  grid-row: 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
  gap: 0 22px;
  min-width: 0;
}

.detail-item {
  min-width: 0;
  gap: 12px;
  padding: 15px 8px;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.detail-item:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.detail-item:hover,
[data-theme="dark"] .detail-item:hover,
[data-theme="light"] .detail-item:hover {
  transform: none;
  border-color: var(--border-color);
  background: transparent;
}

.detail-icon {
  flex: 0 0 20px;
  color: var(--accent-color);
  font-size: 1rem;
}

.detail-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.075em;
}

.detail-value,
.temp-max,
.temp-min,
.city-local-time time,
.temperature {
  font-variant-numeric: tabular-nums;
}

.detail-value {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 650;
}

.forecast-section,
.chart-section {
  padding: clamp(22px, 3vw, 34px);
}

.section-title {
  gap: 10px;
  margin-bottom: 18px;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  font-weight: 650;
}

.section-title i {
  color: var(--accent-color);
}

.forecast-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  align-items: stretch;
}

.forecast-item {
  display: flex;
  min-width: 0;
  min-height: 174px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 18px 10px 14px;
  border: 0;
  border-right: 1px solid var(--border-color);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: background-color 180ms ease;
}

.forecast-item:last-child {
  border-right: 0;
}

.forecast-item:hover,
[data-theme="dark"] .forecast-item:hover,
[data-theme="light"] .forecast-item:hover {
  transform: none;
  border-color: var(--border-color);
  background: var(--secondary-bg);
  box-shadow: none;
}

.forecast-item.is-today {
  border: 0;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent-color) 10%, transparent);
  box-shadow: none;
}

.forecast-date {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.055em;
}

.forecast-date small {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 550;
  letter-spacing: 0;
}

.forecast-icon {
  display: block;
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
  object-fit: contain;
  filter: drop-shadow(0 3px 5px var(--shadow-dark));
}

.forecast-temps {
  gap: 9px;
  margin-bottom: 7px;
}

.temp-max {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.temp-min {
  color: var(--text-muted);
  font-size: 0.93rem;
  font-weight: 500;
}

.forecast-condition {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.forecast-rain {
  margin-top: 7px;
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 600;
}

.forecast-rain i {
  color: var(--accent-color);
}

.chart-container {
  height: clamp(250px, 34vw, 360px);
}

.app-footer {
  margin-top: 4px;
  border-top-color: var(--border-color);
}

@media (max-width: 900px) {
  .current-weather-card {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    row-gap: 10px;
  }

  .current-weather-header,
  .temperature-section,
  .weather-details-grid {
    grid-column: 1;
  }

  .current-weather-header {
    grid-row: 1;
  }

  .temperature-section {
    grid-row: 2;
    padding: 16px 0 8px;
  }

  .weather-details-grid {
    grid-row: 3;
    margin-top: 4px;
  }

  .forecast-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .forecast-item {
    min-height: 156px;
    padding: 15px 8px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--secondary-bg);
  }

  .forecast-item:last-child {
    border-right: 1px solid var(--border-color);
  }

  .forecast-item.is-today {
    border: 1px solid color-mix(in srgb, var(--accent-color) 48%, transparent);
    background: color-mix(in srgb, var(--accent-color) 10%, var(--glass-bg));
  }
}

@media (max-width: 760px) {
  .app-container {
    padding: 18px;
  }

  .header {
    margin-bottom: 26px;
  }

  .header-content {
    padding-bottom: 18px;
  }

  .forecast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .forecast-item {
    min-height: 152px;
    padding: 14px 10px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--secondary-bg);
  }

  .forecast-item:last-child {
    border-right: 1px solid var(--border-color);
  }

  .forecast-item.is-today {
    border: 1px solid color-mix(in srgb, var(--accent-color) 48%, transparent);
    background: color-mix(in srgb, var(--accent-color) 10%, var(--glass-bg));
  }
}

@media (max-width: 600px) {
  .app-container {
    padding: 14px;
  }

  .header-content {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
  }

  .brand-lockup {
    min-width: 0;
  }

  .app-title {
    font-size: clamp(2rem, 9vw, 2.7rem);
  }

  .header-controls {
    margin-left: auto;
  }

  .current-weather-card,
  .chart-section,
  .forecast-section {
    padding: 18px;
  }

  .current-weather-header {
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
  }

  .location-name {
    font-size: 1.35rem;
  }

  .weather-icon-container {
    margin: 0;
  }

  .weather-icon {
    width: 66px;
    height: 66px;
    font-size: 3.4rem;
  }

  .temperature {
    font-size: clamp(4rem, 18vw, 5.5rem);
  }

  .weather-details-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
  }

  .detail-item {
    gap: 8px;
    padding: 13px 3px;
  }

  .detail-icon {
    flex-basis: 18px;
    font-size: 0.88rem;
  }

  .detail-label {
    font-size: 0.61rem;
  }

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

  .forecast-item {
    min-height: 145px;
    padding: 13px 6px;
  }

  .temp-max {
    font-size: 0.95rem;
  }

  .temp-min {
    font-size: 0.84rem;
  }

  .forecast-condition {
    font-size: 0.68rem;
  }

  .chart-container {
    height: 240px;
  }

  .footer-credit {
    text-align: center;
  }
}

@media (max-width: 380px) {
  .header-controls {
    width: 100%;
    justify-content: flex-end;
  }

  .forecast-grid {
    gap: 6px;
  }

  .forecast-item {
    padding-inline: 4px;
  }
}



/* Swipeable forecast strip for tablet and mobile: keep all seven days in one row. */
@media (max-width: 900px) {
  .forecast-grid {
    width: 100%;
    min-width: 0;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: clamp(145px, 22vw, 190px);
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 2px;
    scroll-snap-type: x proximity;
    padding: 2px 2px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--secondary-bg);
  }

  .forecast-grid::-webkit-scrollbar {
    height: 6px;
  }

  .forecast-grid::-webkit-scrollbar-track {
    border-radius: 999px;
    background: var(--secondary-bg);
  }

  .forecast-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--accent-color);
  }

  .forecast-item {
    min-width: 0;
    scroll-snap-align: start;
  }

  .forecast-item:last-child {
    border-right: 1px solid var(--border-color);
  }
}

/* Skylens finish: consistent type, quieter surfaces, and restrained depth. */
:root,
[data-theme="light"] {
  --border-radius: 18px;
  --border-color: rgba(23, 43, 56, 0.12);
  --shadow-dark: rgba(25, 50, 62, 0.055);
}

[data-theme="dark"] {
  --border-radius: 18px;
  --border-color: rgba(213, 228, 232, 0.13);
  --shadow-dark: rgba(0, 0, 0, 0.16);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-title {
  font-weight: 700;
  letter-spacing: -0.04em;
}

.location-name {
  font-weight: 600;
  letter-spacing: -0.035em;
}

.section-title {
  font-weight: 600;
  letter-spacing: -0.025em;
}

.detail-label,
.forecast-date {
  font-weight: 600;
  letter-spacing: 0.055em;
}

.detail-value,
.temp-max {
  font-weight: 600;
}

.temperature {
  font-weight: 600;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
}

.glassmorphism {
  border-radius: var(--border-radius);
  box-shadow: 0 8px 22px var(--shadow-dark);
}

.search-container {
  box-shadow: 0 4px 14px var(--shadow-dark);
}

.current-weather-card,
.current-weather-card:hover {
  border-radius: 20px;
  box-shadow: 0 10px 26px var(--shadow-dark);
  transform: none;
}

.forecast-section,
.chart-section {
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: var(--secondary-bg);
  box-shadow: none;
}

.forecast-section:hover,
.chart-section:hover {
  box-shadow: none;
  transform: none;
}

.weather-icon,
.forecast-icon {
  filter: none;
}

@media (max-width: 900px) {
  .forecast-item,
  .forecast-item.is-today {
    border-radius: 12px;
  }
}
