/* ============================================================
   WeatherPro - Complete Stylesheet
   Modern Glassmorphism UI with Dark/Light Modes
   ============================================================ */

/* ----- CSS Custom Properties ----- */
:root {
  /* Dark Mode (Default) */
  --bg-primary: #0f0c29;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(26, 26, 46, 0.7);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-hover: rgba(255, 255, 255, 0.1);
  --bg-glass-strong: rgba(255, 255, 255, 0.12);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.8);
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-inverse: #0f0c29;

  --border-color: rgba(255, 255, 255, 0.1);
  --border-glass: rgba(255, 255, 255, 0.18);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);

  --accent-primary: #667eea;
  --accent-secondary: #764ba2;
  --accent-gradient: linear-gradient(135deg, #667eea, #764ba2);
  --accent-gradient-hover: linear-gradient(135deg, #7c93f6, #8b5fbf);

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --aqi-good: #10b981;
  --aqi-moderate: #f59e0b;
  --aqi-unhealthy-sensitive: #f97316;
  --aqi-unhealthy: #ef4444;
  --aqi-very-unhealthy: #8b5cf6;
  --aqi-hazardous: #7f1d1d;

  --uv-low: #10b981;
  --uv-moderate: #f59e0b;
  --uv-high: #f97316;
  --uv-very-high: #ef4444;
  --uv-extreme: #8b5cf6;

  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

  --sidebar-width: 260px;
  --header-height: 68px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Light Mode */
[data-theme="light"] {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.4);
  --bg-glass-hover: rgba(255, 255, 255, 0.6);
  --bg-glass-strong: rgba(255, 255, 255, 0.7);

  --text-primary: #1a1a2e;
  --text-secondary: rgba(26, 26, 46, 0.75);
  --text-muted: rgba(26, 26, 46, 0.45);
  --text-inverse: #ffffff;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-glass: rgba(255, 255, 255, 0.5);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

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

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ----- Selection ----- */
::selection {
  background: var(--accent-primary);
  color: white;
}

/* ----- Focus Styles ----- */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

input:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -1px;
}

/* ============================================================
   LAYOUT
   ============================================================ */

#app {
  display: flex;
  min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.sidebar-close:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.sidebar-link:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--accent-gradient);
  color: white;
  font-weight: 600;
}

.sidebar-link svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
}

.install-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-primary);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.install-btn:hover {
  background: var(--accent-gradient);
  border-color: transparent;
}

/* ----- Main Content ----- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ----- Header ----- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: var(--header-height);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background var(--transition-fast);
}

.menu-toggle:hover {
  background: var(--bg-glass);
}

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo svg {
  flex-shrink: 0;
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
}

.search-container {
  position: relative;
  width: 100%;
  max-width: 420px;
}

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

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 38px 10px 42px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-family);
  transition: all var(--transition-fast);
}

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

.search-input:focus {
  border-color: var(--accent-primary);
  background: var(--bg-glass-hover);
}

.clear-search {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.clear-search:hover {
  color: var(--text-primary);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-glass);
  max-height: 240px;
  overflow-y: auto;
  z-index: 200;
}

.search-suggestion-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.search-suggestion-item:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.search-suggestion-item:first-child {
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
}

.search-suggestion-item:last-child {
  border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
  transform: translateY(-1px);
}

.header-btn:active {
  transform: scale(0.95);
}

#favToggle.favorited svg {
  fill: var(--danger);
  stroke: var(--danger);
}

/* Theme toggle */
.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  transition: opacity var(--transition-fast);
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

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

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

.loading-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 16px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loading-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 8px;
}

.loading-bar {
  width: 200px;
  height: 3px;
  background: var(--bg-glass);
  border-radius: 2px;
  margin: 24px auto 0;
  overflow: hidden;
}

.loading-bar-progress {
  height: 100%;
  width: 0;
  background: var(--accent-gradient);
  border-radius: 2px;
  animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
  0% { width: 0; transform: translateX(-100%); }
  50% { width: 60%; transform: translateX(20%); }
  100% { width: 100%; transform: translateX(100%); }
}

/* ============================================================
   DASHBOARD
   ============================================================ */

.dashboard {
  flex: 1;
  padding: 20px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ----- Sections ----- */
.section {
  padding: 20px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-glass);
  transition: all var(--transition-normal);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-title svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

/* ============================================================
   WEATHER BACKGROUND
   ============================================================ */

.weather-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  transition: background var(--transition-slow);
  pointer-events: none;
}

.weather-background.sunny {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.weather-background.cloudy {
  background: linear-gradient(135deg, #1a1a2e 0%, #37306B 50%, #667eea 100%);
}

.weather-background.rainy {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.weather-background.snowy {
  background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 50%, #a1c4fd 100%);
}

.weather-background.thunderstorm {
  background: linear-gradient(135deg, #0f0c29 0%, #1a1a2e 50%, #16213e 100%);
}

.weather-background.night {
  background: linear-gradient(135deg, #0a0a1a 0%, #0f0c29 50%, #1a1a2e 100%);
}

.weather-background.mist {
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 50%, #2980b9 100%);
}

[data-theme="light"] .weather-background.sunny {
  background: linear-gradient(135deg, #667eea 15%, #91eae4 100%);
}

[data-theme="light"] .weather-background.cloudy {
  background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
}

[data-theme="light"] .weather-background.rainy {
  background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

[data-theme="light"] .weather-background.night {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 100%);
}

/* ============================================================
   LOCATION INFO
   ============================================================ */

.location-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.location-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.location-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: 50%;
  color: white;
  flex-shrink: 0;
}

.location-text {
  display: flex;
  flex-direction: column;
}

.city-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.country-name {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.location-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.separator {
  opacity: 0.4;
}

/* ============================================================
   CURRENT WEATHER
   ============================================================ */

.current-weather {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.weather-primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.weather-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.weather-icon-wrapper {
  line-height: 0;
}

.weather-icon {
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
  animation: floatIcon 3s ease-in-out infinite;
}

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

.weather-temp-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 2px;
}

.temperature {
  font-size: 4rem;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -2px;
}

.temp-unit {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-top: 8px;
}

.weather-desc-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.weather-condition {
  font-size: 1.2rem;
  font-weight: 600;
}

.weather-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.weather-feels {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.feels-label {
  font-size: 0.85rem;
}

.feels-value {
  color: var(--text-secondary);
  font-weight: 500;
}

.weather-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.weather-detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  background: var(--bg-glass);
  border-radius: var(--border-radius-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.weather-detail-item:hover {
  background: var(--bg-glass-hover);
  transform: translateY(-1px);
}

.weather-detail-item svg {
  color: var(--accent-primary);
}

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

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

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

/* ============================================================
   HOURLY FORECAST
   ============================================================ */

.hourly-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

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

.hourly-scroll-controls {
  display: flex;
  gap: 6px;
}

.scroll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.scroll-btn:hover {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

.hourly-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 80px;
  padding: 14px 10px;
  background: var(--bg-glass);
  border: 1px solid transparent;
  border-radius: var(--border-radius-md);
  text-align: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.hourly-item:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass);
}

.hourly-item.active {
  border-color: var(--accent-primary);
  background: rgba(102, 126, 234, 0.1);
}

.hourly-time {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

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

.hourly-temp {
  font-size: 1rem;
  font-weight: 600;
}

.hourly-rain {
  font-size: 0.75rem;
  color: var(--info);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ============================================================
   DAILY FORECAST
   ============================================================ */

.daily-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.daily-item {
  display: grid;
  grid-template-columns: 100px 1fr 80px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-glass);
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
}

.daily-item:hover {
  background: var(--bg-glass-hover);
}

.daily-day {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.daily-date {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.daily-weather {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

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

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

.daily-temps {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.daily-temp-high {
  font-size: 0.95rem;
  font-weight: 600;
}

.daily-temp-low {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.daily-rain-prob {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  color: var(--info);
  margin-top: 2px;
}

.daily-rain-prob:empty {
  display: none;
}

/* ============================================================
   SUN INFO
   ============================================================ */

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

.sun-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-glass);
  border-radius: var(--border-radius-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.sun-item:hover {
  background: var(--bg-glass-hover);
}

.sun-item svg {
  color: var(--warning);
}

.sunset svg {
  color: var(--danger);
}

.daylength svg {
  color: var(--info);
}

.sun-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sun-value {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ============================================================
   AIR QUALITY
   ============================================================ */

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

.aqi-gauge-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

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

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

.aqi-main-value {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.aqi-main-category {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.aqi-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aqi-recommendation {
  padding: 12px 16px;
  background: var(--bg-glass);
  border-radius: var(--border-radius-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.aqi-pollutants {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.aqi-pollutant {
  padding: 8px 12px;
  background: var(--bg-glass);
  border-radius: var(--border-radius-sm);
  text-align: center;
}

.pollutant-name {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pollutant-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 2px;
}

/* ============================================================
   WEATHER ALERTS
   ============================================================ */

.alerts-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  background: var(--danger);
  color: white;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.no-alerts {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 20px;
}

.alert-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-glass);
  border-radius: var(--border-radius-md);
  border-left: 3px solid;
  transition: all var(--transition-fast);
}

.alert-item:hover {
  background: var(--bg-glass-hover);
}

.alert-item.storm {
  border-left-color: var(--danger);
}

.alert-item.rain {
  border-left-color: var(--info);
}

.alert-item.flood {
  border-left-color: var(--warning);
}

.alert-item.heat {
  border-left-color: var(--danger);
}

.alert-item.snow {
  border-left-color: var(--info);
}

.alert-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.alert-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.alert-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

/* ============================================================
   CHARTS
   ============================================================ */

.chart-tabs {
  display: flex;
  gap: 6px;
}

.chart-tab {
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid transparent;
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.chart-tab:hover {
  background: var(--bg-glass-hover);
  color: var(--text-secondary);
}

.chart-tab.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

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

.weather-chart {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius-md);
}

/* ============================================================
   WEATHER MAP
   ============================================================ */

.map-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

.weather-map {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--border-radius-md);
  background: var(--bg-glass);
}

.map-overlay-info {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 6px;
}

.map-layer-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: white;
}

.map-layer-tabs {
  display: flex;
  gap: 6px;
}

.map-tab {
  padding: 6px 12px;
  background: var(--bg-glass);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.map-tab:hover {
  background: var(--bg-glass-hover);
  color: var(--text-secondary);
}

.map-tab.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

/* ============================================================
   FARMER SUPPORT
   ============================================================ */

.farmer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.farmer-card {
  padding: 18px;
  background: var(--bg-glass);
  border-radius: var(--border-radius-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.farmer-card:hover {
  background: var(--bg-glass-hover);
  transform: translateY(-2px);
}

.farmer-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--accent-primary);
}

.farmer-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.farmer-value {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   TRAVEL SUPPORT
   ============================================================ */

.travel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.travel-card {
  padding: 18px;
  background: var(--bg-glass);
  border-radius: var(--border-radius-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.travel-card:hover {
  background: var(--bg-glass-hover);
  transform: translateY(-2px);
}

.travel-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--success);
}

.travel-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.travel-value {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   HEALTH SUPPORT
   ============================================================ */

.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.health-card {
  padding: 18px;
  background: var(--bg-glass);
  border-radius: var(--border-radius-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.health-card:hover {
  background: var(--bg-glass-hover);
  transform: translateY(-2px);
}

.health-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.health-icon.uv-warning svg { color: var(--warning); }
.health-icon.air-warning svg { color: var(--danger); }
.health-icon.heat-warning svg { color: var(--danger); }
.health-icon.allergy-warning svg { color: var(--warning); }

.health-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.health-value {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   FAVORITES
   ============================================================ */

.favorites-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.favorite-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.favorite-item:hover {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

.favorite-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 2px;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.favorite-remove:hover {
  opacity: 1;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-glass);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-normal);
  pointer-events: none;
  max-width: 360px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.warning {
  border-left: 3px solid var(--warning);
}

.toast.info {
  border-left: 3px solid var(--info);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.section {
  animation: fadeIn 0.4s ease-out;
}

.section:nth-child(2) { animation-delay: 0.05s; }
.section:nth-child(3) { animation-delay: 0.1s; }
.section:nth-child(4) { animation-delay: 0.15s; }
.section:nth-child(5) { animation-delay: 0.2s; }
.section:nth-child(6) { animation-delay: 0.25s; }

/* Refresh spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.refreshing svg {
  animation: spin 1s linear infinite;
}

/* Skeleton loading */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-glass) 25%, var(--bg-glass-hover) 50%, var(--bg-glass) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

/* Tablet & below */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .dashboard {
    padding: 16px;
  }

  .aqi-main {
    grid-template-columns: 1fr;
    justify-items: center;
  }

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

/* Mobile */
@media (max-width: 768px) {
  .header {
    padding: 0 12px;
    gap: 8px;
  }

  .header-title {
    font-size: 1rem;
  }

  .header-center {
    max-width: 200px;
  }

  .search-input {
    padding: 8px 32px 8px 36px;
    font-size: 0.85rem;
  }

  .search-icon {
    left: 10px;
    width: 16px;
    height: 16px;
  }

  .header-right {
    gap: 4px;
  }

  .header-btn {
    width: 34px;
    height: 34px;
  }

  .dashboard {
    padding: 12px;
    gap: 12px;
  }

  .section {
    padding: 16px;
    border-radius: var(--border-radius-md);
  }

  .temperature {
    font-size: 3rem;
  }

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

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

  .weather-detail-item {
    padding: 10px;
  }

  .sun-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .sun-item {
    padding: 12px 8px;
  }

  .hourly-item {
    min-width: 68px;
    padding: 10px 8px;
  }

  .daily-item {
    grid-template-columns: 70px 1fr 60px;
    padding: 10px 12px;
    gap: 8px;
  }

  .daily-icon {
    width: 28px;
    height: 28px;
  }

  .daily-desc {
    font-size: 0.78rem;
  }

  .daily-temp-high {
    font-size: 0.85rem;
  }

  .daily-temp-low {
    font-size: 0.75rem;
  }

  .farmer-grid,
  .travel-grid,
  .health-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .farmer-card,
  .travel-card,
  .health-card {
    padding: 14px;
  }

  .chart-tabs {
    flex-wrap: wrap;
  }

  .map-layer-tabs {
    flex-wrap: wrap;
  }

  .chart-container {
    min-height: 200px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .header-title {
    display: none;
  }

  .header-center {
    max-width: 160px;
  }

  .weather-details-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .farmer-grid,
  .travel-grid,
  .health-grid {
    grid-template-columns: 1fr;
  }

  .aqi-main-value {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 0.95rem;
  }

  .daily-item {
    grid-template-columns: 60px 1fr 50px;
    padding: 8px 10px;
  }

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

  .daily-date {
    font-size: 0.65rem;
  };
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
  .sidebar,
  .header,
  .toast,
  .loading-screen,
  .weather-background {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .section {
    break-inside: avoid;
    background: white !important;
    color: black !important;
    border: 1px solid #ddd;
    box-shadow: none;
  }

  .section * {
    color: black !important;
  }
}

/* ============================================================
   HIGH CONTRAST & ACCESSIBILITY
   ============================================================ */

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

@media (prefers-contrast: high) {
  :root {
    --text-muted: var(--text-secondary);
  }

  .sidebar-link {
    border: 1px solid transparent;
  }

  .sidebar-link.active {
    border-color: white;
  }

  .section {
    border-width: 2px;
  }
}

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