/* ========================================
   Weather Dashboard - Premium Styles
   ======================================== */

:root {
  /* Color Palette - Dark Theme */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-card-hover: rgba(30, 41, 59, 0.9);

  /* Gradient Colors */
  --gradient-blue: linear-gradient(135deg, #3b82f6, #1d4ed8);
  --gradient-purple: linear-gradient(135deg, #8b5cf6, #6366f1);
  --gradient-cyan: linear-gradient(135deg, #06b6d4, #0891b2);
  --gradient-orange: linear-gradient(135deg, #f97316, #ea580c);
  --gradient-pink: linear-gradient(135deg, #ec4899, #db2777);

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;

  /* Accent Colors */
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-orange: #f97316;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #fbbf24;

  /* Border & Shadow */
  --border-color: rgba(148, 163, 184, 0.1);
  --border-glow: rgba(59, 130, 246, 0.5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.3);

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
  --radius-full: 9999px;
}

/* ========================================
   LIGHT THEME
   ======================================== */
:root[data-theme="light"] {
  /* Color Palette - Light Theme */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(248, 250, 252, 1);

  /* Gradient Colors (adjusted for light theme) */
  --gradient-blue: linear-gradient(135deg, #3b82f6, #2563eb);
  --gradient-purple: linear-gradient(135deg, #8b5cf6, #7c3aed);
  --gradient-cyan: linear-gradient(135deg, #06b6d4, #0891b2);
  --gradient-orange: linear-gradient(135deg, #f97316, #ea580c);
  --gradient-pink: linear-gradient(135deg, #ec4899, #db2777);

  /* Text Colors */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  /* Accent Colors (same across themes) */
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-orange: #f97316;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #fbbf24;

  /* Border & Shadow (inverted for light) */
  --border-color: rgba(15, 23, 42, 0.1);
  --border-glow: rgba(59, 130, 246, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.2);
}

/* Smooth theme transitions */
html {
  transition: background-color 0.3s ease;
}

body,
.header,
.sidebar,
.dash-quick-card,
.current-card,
.quick-card,
.forecast-card,
.aqi-card,
.settings-modal {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}


/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* App Container */
.app-container {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated Background */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.bg-gradient {
  position: absolute;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
  animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.bg-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 50px 100px, rgba(255, 255, 255, 0.1), transparent),
    radial-gradient(2px 2px at 200px 300px, rgba(255, 255, 255, 0.08), transparent),
    radial-gradient(1px 1px at 400px 200px, rgba(255, 255, 255, 0.1), transparent);
  animation: particleFloat 30s linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-100px);
  }
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.btn-refresh {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-full);
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-refresh:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--accent-blue);
}

.btn-refresh:hover .refresh-icon {
  animation: spin 0.6s ease;
}

.btn-refresh.refreshing .refresh-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.refresh-icon {
  font-size: 1.1rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--accent-purple);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.theme-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover .theme-icon {
  transform: rotate(180deg);
}

.theme-text {
  font-weight: 500;
}


.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-center {
  flex: 1;
  max-width: 500px;
}

/* Search */
.search-container {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.5;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
}

.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.search-result-item {
  padding: 0.875rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.search-result-item:hover {
  background: rgba(59, 130, 246, 0.15);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.search-result-region {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Buttons */
.btn-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-location:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.last-updated {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.update-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 80px;
  width: 220px;
  height: calc(100vh - 80px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: var(--spacing-md) 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: 35px var(--spacing-sm);
  flex: 1;
}

.sidebar-footer {
  padding: 0 var(--spacing-sm);
  border-top: 1px solid var(--border-color);
  padding-top: var(--spacing-md);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-blue);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.nav-item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--text-primary);
}

.nav-item:hover::before {
  transform: scaleY(1);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.nav-item.active::before {
  transform: scaleY(1);
}

.nav-icon {
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
}

.nav-text {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Content Wrapper - Adjust for fixed header and sidebar */
.content-wrapper {
  margin-left: 230px;
  padding: var(--spacing-lg);
  padding-top: calc(80px + var(--spacing-lg));
  min-height: 100vh;
  max-width: 1640px;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: var(--spacing-lg);
}

.loading-spinner {
  position: relative;
  width: 80px;
  height: 80px;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-radius: 50%;
}

.spinner-ring:nth-child(1) {
  border-top-color: var(--accent-blue);
  animation: spinRing 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
  border-right-color: var(--accent-purple);
  animation: spinRing 1.2s linear infinite reverse;
}

.spinner-ring:nth-child(3) {
  width: 30%;
  height: 30%;
  top: 35%;
  left: 35%;
  border-bottom-color: var(--accent-cyan);
  animation: spinRing 0.9s linear infinite;
}

@keyframes spinRing {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Error State */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  padding: var(--spacing-xl);
}

.error-icon {
  font-size: 4rem;
  margin-bottom: var(--spacing-md);
}

.error-title {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-sm);
}

.error-message {
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
}

.btn-retry {
  padding: 0.875rem 2rem;
  background: var(--gradient-blue);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-retry:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* Main Content */
.main-content {
  position: relative;
  z-index: 1;
  padding: var(--spacing-lg);
  max-width: 1400px;
  margin: 0 auto;
}

/* Current Section */
.current-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

/* Current Weather Card */
.current-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.current-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent);
  border-radius: 50%;
  filter: blur(60px);
}

.current-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  position: relative;
  z-index: 1;
}

.location-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.location-icon {
  font-size: 1.2rem;
}

.location-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.current-time {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.current-main {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  position: relative;
  z-index: 1;
  margin-bottom: var(--spacing-lg);
}

.current-icon-wrapper {
  position: relative;
}

.current-icon {
  font-size: 6rem;
  filter: drop-shadow(0 0 30px rgba(255, 200, 100, 0.5));
  animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.3), transparent);
  filter: blur(30px);
  z-index: -1;
}

.current-details {
  flex: 1;
}

.temp-display {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.temp-value {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.temp-unit {
  font-size: 2rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.weather-desc {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.day-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(251, 191, 36, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--accent-yellow);
}

.current-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 160px));
  gap: var(--spacing-sm);
  position: relative;
  z-index: 1;
  justify-content: center;
  margin: 0 auto;
}

.metric-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-md);
}

.metric-item:has(.metric-icon) {
  justify-content: flex-start;
}

.metric-icon {
  font-size: 1.5rem;
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-item:not(:has(.metric-icon)) .metric-info {
  align-items: center;
  text-align: center;
}

.metric-value {
  font-size: 1.1rem;
  font-weight: 600;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Quick Metrics */
.quick-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

.quick-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  transition: all 0.3s ease;
}

.quick-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
}

.quick-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--spacing-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quick-icon {
  font-size: 1.2rem;
}

.quick-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.quick-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.uv-bar {
  width: 100%;
  height: 6px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-full);
  margin-top: var(--spacing-sm);
  overflow: hidden;
}

.uv-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-yellow), var(--accent-orange), var(--accent-red));
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.section-icon {
  font-size: 1.5rem;
}

.section-badge {
  padding: 0.4rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Hourly Section */
.hourly-section {
  margin-bottom: var(--spacing-xl);
}

.hourly-scroll-container {
  position: relative;
}

.hourly-scroll {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  padding: var(--spacing-sm) 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-blue) rgba(15, 23, 42, 0.5);
}

.hourly-scroll::-webkit-scrollbar {
  height: 8px;
}

.hourly-scroll::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-full);
}

.hourly-scroll::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: var(--radius-full);
}

.hourly-card {
  flex: 0 0 auto;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.hourly-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
}

.hourly-card.current-hour {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border-color: var(--accent-blue);
}

.hourly-time {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.hourly-icon {
  font-size: 2rem;
}

.hourly-temp {
  font-size: 1.25rem;
  font-weight: 600;
}

.hourly-rain {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Forecast Section */
.forecast-section {
  margin-bottom: var(--spacing-xl);
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--spacing-md);
}

.forecast-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  text-align: center;
  transition: all 0.3s ease;
}

.forecast-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-purple);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
}

.forecast-card.today {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
  border-color: var(--accent-purple);
}

.forecast-day {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.forecast-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}

.forecast-icon {
  font-size: 2.5rem;
  margin-bottom: var(--spacing-sm);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.forecast-temps {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: var(--spacing-xs);
}

.forecast-high {
  font-size: 1.1rem;
  font-weight: 600;
}

.forecast-low {
  font-size: 1rem;
  color: var(--text-muted);
}

.forecast-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: var(--spacing-xs);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.forecast-rain,
.forecast-uv {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.forecast-rain {
  color: var(--accent-cyan);
}

.forecast-uv {
  color: var(--accent-orange);
}

/* Sun Section */
.sun-section {
  margin-bottom: var(--spacing-xl);
}

.sun-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
}

.sun-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.sun-icon-wrapper {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.1);
}

.sunrise-card .sun-icon-wrapper {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(249, 115, 22, 0.2));
}

.sunset-card .sun-icon-wrapper {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(239, 68, 68, 0.2));
}

.sun-emoji {
  font-size: 2rem;
}

.sun-info {
  display: flex;
  flex-direction: column;
}

.sun-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sun-time {
  font-size: 1.5rem;
  font-weight: 600;
}

.sun-arc {
  flex: 1;
  max-width: 300px;
  height: 80px;
  position: relative;
}

.arc-line {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  border: 2px dashed var(--border-color);
  border-bottom: none;
  border-radius: 150px 150px 0 0;
}

.sun-position {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--accent-yellow);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--accent-yellow);
  transform: translate(-50%, 50%);
  transition: all 0.5s ease;
}

/* Footer */
.footer {
  text-align: center;
  padding: var(--spacing-lg);
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

.footer a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: var(--accent-blue);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .forecast-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .current-section {
    grid-template-columns: 1fr;
  }

  .current-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .quick-metrics {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }

  .header-center {
    order: 3;
    flex: 0 0 100%;
    max-width: 100%;
  }

  .btn-text {
    display: none;
  }

  .current-main {
    flex-direction: column;
    text-align: center;
  }

  .current-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .forecast-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .sun-cards {
    flex-direction: column;
  }

  .sun-arc {
    order: -1;
    width: 200px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: var(--spacing-md);
  }

  .temp-value {
    font-size: 4rem;
  }

  .current-icon {
    font-size: 4rem;
  }

  .forecast-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hourly-card {
    min-width: 80px;
  }
}

/* ================================================
   TRAFFIC SECTION STYLES
   ================================================ */

/* Section visibility */
.section-content.hidden {
  display: none !important;
}

/* Traffic Metrics Panel */
#traffic-metrics-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.traffic-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.traffic-metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.traffic-metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.2);
}

.traffic-metric-card:hover::before {
  opacity: 1;
}

.traffic-metric-card.level-green {
  border-color: var(--accent-green);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
}

.traffic-metric-card.level-yellow {
  border-color: var(--accent-orange);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.05));
}

.traffic-metric-card.level-orange {
  border-color: #f97316;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(249, 115, 22, 0.05));
}

.traffic-metric-card.level-red {
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
}

.traffic-metric-icon {
  font-size: 1rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.traffic-metric-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.traffic-metric-label {
  font-size: 10pt;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.traffic-metric-value {
  font-size: 12pt;
  font-weight: 700;
  line-height: 1;
  display: inline-block;
  color: var(--text-primary);
  text-align: center;
}

.traffic-metric-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: inline-block;
}

/* Traffic Map */
#traffic-map {
  width: 100%;
  height: 500px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: var(--bg-card);
}

/* Traffic Controls Panel */
#traffic-controls-panel {
  margin-top: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.traffic-control-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.traffic-control-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.traffic-control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.traffic-control-btn.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.traffic-analyze-btn {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border: none;
  color: white;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  font-family: inherit;
}

.traffic-analyze-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.traffic-analyze-btn.analyzing {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.traffic-status-badge {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.traffic-status-badge.locked {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
  border-color: #ef4444;
  color: #ef4444;
}

/* Traffic Toggle Switch */
.traffic-auto-refresh {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.traffic-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.traffic-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.traffic-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid var(--border-color);
}

.traffic-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.traffic-switch input:checked+.traffic-slider {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-color: transparent;
}

.traffic-switch input:checked+.traffic-slider:before {
  transform: translateX(22px);
}

.traffic-switch-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

#traffic-last-update {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Placeholder Sections */
.placeholder-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  gap: 1rem;
}

.placeholder-icon {
  font-size: 4rem;
  opacity: 0.5;
}

.placeholder-section h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.placeholder-section p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Traffic animations */
.traffic-metric-card {
  animation: fadeIn 0.5s ease-out backwards;
}

.traffic-metric-card:nth-child(1) {
  animation-delay: 0.1s;
}

.traffic-metric-card:nth-child(2) {
  animation-delay: 0.2s;
}

.traffic-metric-card:nth-child(3) {
  animation-delay: 0.3s;
}

.traffic-metric-card:nth-child(4) {
  animation-delay: 0.4s;
}

.traffic-metric-card:nth-child(5) {
  animation-delay: 0.5s;
}

.traffic-metric-card:nth-child(6) {
  animation-delay: 0.6s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================
   AQI DEVICE DASHBOARD STYLES
   ================================================ */

/* Header */
.aqi-device-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.device-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.device-label {
  color: var(--text-muted);
}

.device-id {
  font-weight: 600;
  color: var(--text-primary);
  font-family: monospace;
}

.device-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.status-dot.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.status-dot.offline {
  background-color: var(--accent-red);
}

.aqi-auto-refresh {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.aqi-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.aqi-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.aqi-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: 0.3s;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.aqi-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.aqi-switch input:checked+.aqi-slider {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-color: transparent;
}

.aqi-switch input:checked+.aqi-slider:before {
  transform: translateX(20px);
}

.aqi-switch-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.aqi-last-update {
  font-size: 0.85rem;
  color: var(--text-muted);
  border-left: 1px solid var(--border-color);
  padding-left: 1.5rem;
}

/* Sections */
.aqi-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.aqi-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.aqi-grid-2col {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.aqi-grid-3col {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.aqi-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.aqi-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 255, 255, 0.2);
}

.aqi-metric-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.aqi-metric-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.aqi-metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.aqi-metric-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Special styling for Env and Power cards */
.aqi-env-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(147, 51, 234, 0.05));
}

.aqi-power-card {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.05), rgba(249, 115, 22, 0.05));
  border-color: rgba(234, 179, 8, 0.2);
}

/* Value colors based on levels */
.aqi-val-good {
  color: var(--accent-green);
}

.aqi-val-moderate {
  color: var(--accent-yellow);
}

.aqi-val-unhealthy {
  color: var(--accent-orange);
}

.aqi-val-hazardous {
  color: var(--accent-red);
}

/* AQI Summary Section */
.aqi-summary-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.aqi-score-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.aqi-score-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.aqi-score-value {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.aqi-score-value.good {
  background: linear-gradient(135deg, #10b981, #34d399);
  -webkit-background-clip: text;
  background-clip: text;
}

.aqi-score-value.moderate {
  background: linear-gradient(135deg, #fbbf24, #fcd34d);
  -webkit-background-clip: text;
  background-clip: text;
}

.aqi-score-value.unhealthy {
  background: linear-gradient(135deg, #f97316, #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
}

.aqi-score-value.very-unhealthy {
  background: linear-gradient(135deg, #ef4444, #f87171);
  -webkit-background-clip: text;
  background-clip: text;
}

.aqi-score-value.hazardous {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  -webkit-background-clip: text;
  background-clip: text;
}

.aqi-category-badge {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.aqi-category-badge.good {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.aqi-category-badge.moderate {
  background: rgba(251, 191, 36, 0.2);
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
}

.aqi-category-badge.unhealthy {
  background: rgba(249, 115, 22, 0.2);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.aqi-category-badge.very-unhealthy {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

.aqi-category-badge.hazardous {
  background: rgba(185, 28, 28, 0.2);
  border-color: #b91c1c;
  color: #dc2626;
}

.aqi-dominant-pollutant {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 2rem;
  border-left: 1px solid var(--border-color);
}

.dominant-label {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dominant-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: monospace;
}

/* ================================================
   SETTINGS MODAL STYLES
   ================================================ */

.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.settings-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.settings-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1080px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
  height: 800px;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.settings-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary);
}

.settings-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.settings-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.settings-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.settings-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.settings-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.settings-tab.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: white;
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  min-height: 400px;
  max-height: 500px;
}

.settings-tab-content {
  display: none;
}

.settings-tab-content.active {
  display: block;
}

.settings-section {
  margin-bottom: 2rem;
}

.settings-section h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.settings-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.08);
}

.form-group select option {
  background: #1e293b;
  color: #f1f5f9;
  padding: 0.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group input[type="range"] {
  width: calc(100% - 60px);
  margin-right: 1rem;
}

.form-group input[type="range"]+span {
  display: inline-block;
  min-width: 40px;
  text-align: center;
  color: var(--text-primary);
  font-weight: 600;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

.color-option {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-option:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.color-option.selected {
  border-color: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.settings-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.btn-primary,
.btn-secondary {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
  .settings-modal-content {
    max-width: 100%;
  }

  .settings-tabs {
    overflow-x: scroll;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .color-picker-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ================================================
   HEADER DEVICE STATUS BAR STYLES
   ================================================ */

.device-status-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.5rem 1rem;
}

.device-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.device-stat:hover {
  background: rgba(255, 255, 255, 0.05);
}

.device-stat .stat-icon {
  font-size: 1rem;
}

.device-stat .stat-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.device-stat .stat-value {
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'Inter', monospace;
}

.device-stat .stat-unit {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.device-status-indicator {
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-color);
}

.header-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
  transition: all 0.3s ease;
}

.header-status-dot.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: statusPulse 2s ease-in-out infinite;
}

.header-status-dot.offline {
  background-color: var(--accent-red);
}

@keyframes statusPulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 8px var(--accent-green);
  }

  50% {
    opacity: 0.6;
    box-shadow: 0 0 4px var(--accent-green);
  }
}

/* Device Last Update in Status Bar */
.device-last-update {
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-color);
}

/* Device Refresh Button in Status Bar */
.device-refresh-btn {
  margin-left: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
}

.device-refresh-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--accent-blue);
  transform: scale(1.05);
}

.device-refresh-btn:hover .refresh-icon {
  animation: spin 0.6s ease;
}

.device-refresh-btn.refreshing .refresh-icon {
  animation: spin 1s linear infinite;
}

/* Hide device status bar on smaller screens */
@media (max-width: 1200px) {
  .device-status-bar {
    display: none;
  }
}

/* ================================================
   DASHBOARD SECTION STYLES
   ================================================ */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.dashboard-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-lg);
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.dashboard-card-header .card-icon {
  font-size: 1.5rem;
}

.dashboard-card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* AQI Card Styles */
.dashboard-aqi-card {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.05), rgba(59, 130, 246, 0.05));
}

.dashboard-aqi-main {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.dashboard-aqi-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.aqi-gauge-ring {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  border: 8px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    0 0 40px rgba(0, 0, 0, 0.3),
    inset 0 0 30px rgba(0, 0, 0, 0.2);
  transition: border-color 0.3s ease;
}

/* Ring border color based on AQI */
.aqi-gauge-ring.good {
  border-color: var(--accent-green);
}

.aqi-gauge-ring.moderate {
  border-color: var(--accent-yellow);
}

.aqi-gauge-ring.unhealthy {
  border-color: var(--accent-orange);
}

.aqi-gauge-ring.very-unhealthy {
  border-color: var(--accent-red);
}

.aqi-gauge-ring.hazardous {
  border-color: #dc2626;
}

.aqi-gauge-ring::before {
  display: none;
}

.aqi-gauge-value {
  position: relative;
  z-index: 1;
  font-size: 5rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  letter-spacing: -2px;
}

/* AQI value color coding for clarity */
.aqi-gauge-value.good {
  color: var(--accent-green);
  text-shadow: 0 0 30px var(--accent-green);
}

.aqi-gauge-value.moderate {
  color: var(--accent-yellow);
  text-shadow: 0 0 30px var(--accent-yellow);
}

.aqi-gauge-value.unhealthy {
  color: var(--accent-orange);
  text-shadow: 0 0 30px var(--accent-orange);
}

.aqi-gauge-value.very-unhealthy {
  color: var(--accent-red);
  text-shadow: 0 0 30px var(--accent-red);
}

.aqi-gauge-value.hazardous {
  color: #dc2626;
  text-shadow: 0 0 30px #dc2626;
}

.aqi-gauge-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.aqi-gauge-label.good {
  color: var(--accent-green);
}

.aqi-gauge-label.moderate {
  color: var(--accent-yellow);
}

.aqi-gauge-label.unhealthy {
  color: var(--accent-orange);
}

.aqi-gauge-label.very-unhealthy {
  color: var(--accent-red);
}

.aqi-gauge-label.hazardous {
  color: #dc2626;
}

.dashboard-aqi-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.aqi-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.aqi-info-item .info-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.aqi-info-item .info-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dashboard-aqi-forecast {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.dashboard-aqi-forecast h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 1rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.aqi-forecast-bars {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.5rem;
  height: 80px;
}

.aqi-bar-placeholder {
  width: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1.5rem 0;
}

.aqi-day-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.aqi-day-bar .bar-container {
  width: 100%;
  height: 60px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.aqi-day-bar .bar-fill {
  width: 100%;
  border-radius: var(--radius-sm);
  transition: height 0.5s ease;
}

.aqi-day-bar .bar-fill.good {
  background: var(--accent-green);
}

.aqi-day-bar .bar-fill.moderate {
  background: var(--accent-yellow);
}

.aqi-day-bar .bar-fill.unhealthy {
  background: var(--accent-orange);
}

.aqi-day-bar .bar-fill.very-unhealthy {
  background: var(--accent-red);
}

.aqi-day-bar .bar-fill.hazardous {
  background: #dc2626;
}

.aqi-day-bar .bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.aqi-day-bar .bar-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Weather Card Styles */
.dashboard-weather-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(14, 165, 233, 0.05));
}

.dashboard-weather-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem 0;
}

.dashboard-weather-icon {
  font-size: 4rem;
  filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.3));
}

.dashboard-weather-temp {
  display: flex;
  align-items: flex-start;
}

.dashboard-weather-temp .temp-value {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.dashboard-weather-temp .temp-unit {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.dashboard-weather-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.dashboard-weather-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.weather-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.weather-metric:hover {
  background: rgba(255, 255, 255, 0.06);
}

.weather-metric .metric-icon {
  font-size: 1.25rem;
}

.weather-metric .metric-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.weather-metric .metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dashboard-sun-times {
  display: flex;
  justify-content: space-around;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.sun-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.sun-time .sun-icon {
  font-size: 1.5rem;
}

.sun-time .sun-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sun-time .sun-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Dashboard responsive */
@media (max-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .dashboard-weather-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-aqi-main {
    flex-direction: column;
    gap: 1rem;
  }

  .aqi-forecast-bars {
    height: 60px;
  }
}

/* ================================================
   NEW DASHBOARD LAYOUT STYLES (Matching Screenshot)
   ================================================ */

/* Row 1: Weather Section */
.dashboard-weather-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Main Weather Card (Left) */
.dashboard-main-weather-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.main-weather-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.main-weather-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.location-pin {
  font-size: 1rem;
}

.main-weather-time {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.main-weather-display {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.main-weather-icon {
  font-size: 5rem;
  filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.3));
}

.main-weather-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.main-temp-display {
  display: flex;
  align-items: flex-start;
}

.main-temp-value {
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1;
}

.main-temp-unit {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.main-weather-desc {
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 500;
}

.main-day-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(251, 191, 36, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--accent-yellow);
  width: fit-content;
}

.main-day-badge.night {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.badge-icon {
  font-size: 0.9rem;
}

/* Main Weather Metrics Grid (2 rows x 3 columns) */
.main-weather-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.main-metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.main-metric-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.main-metric-icon {
  font-size: 1.25rem;
}

.main-metric-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.main-metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Quick Metrics Cards (Right - 2x3 Grid for 6 cards) */
.dashboard-quick-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.dash-quick-card {
  /* Glassmorphism Effect */
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);

  /* Premium borders and shadows */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.25rem;

  /* Animated gradient background */
  position: relative;
  overflow: hidden;

  /* Smooth transitions */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Animated gradient overlay */
.dash-quick-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
      rgba(59, 130, 246, 0.1) 0%,
      transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  animation: gradientRotate 15s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes gradientRotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Micro-animations on hover */
.dash-quick-card:hover {
  /* Lift effect */
  transform: translateY(-8px) scale(1.02);

  /* Enhanced glow */
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(59, 130, 246, 0.1),
    0 0 30px rgba(59, 130, 246, 0.2);

  /* Show gradient */
}

.dash-quick-card:hover::before {
  opacity: 1;
}

/* Ensure content is above gradient */
.dash-quick-card>* {
  position: relative;
  z-index: 1;
}

.dash-quick-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.dash-quick-icon {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

/* Icon bounce on card hover */
.dash-quick-card:hover .dash-quick-icon {
  transform: scale(1.2) rotate(5deg);
  animation: iconPulse 0.6s ease;
}

@keyframes iconPulse {

  0%,
  100% {
    transform: scale(1.2) rotate(5deg);
  }

  50% {
    transform: scale(1.4) rotate(-5deg);
  }
}

.dash-quick-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dash-quick-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;

  /* Value update animation */
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animate when value changes */
.dash-quick-value.value-updated {
  animation: valueCountUp 0.6s ease-out;
}

@keyframes valueCountUp {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }

  50% {
    transform: translateY(-5px) scale(1.05);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dash-quick-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========================================
   COLOR-CODED DATA VISUALIZATION
   ======================================== */

/* AQI Level Colors with Glow Effects */
.aqi-good,
.traffic-free {
  color: #10b981 !important;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.aqi-moderate,
.traffic-light {
  color: #fbbf24 !important;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.aqi-unhealthy,
.traffic-moderate {
  color: #f97316 !important;
  text-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

.aqi-very-unhealthy,
.traffic-heavy {
  color: #ef4444 !important;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.aqi-hazardous,
.traffic-severe {
  color: #9333ea !important;
  text-shadow: 0 0 10px rgba(147, 51, 234, 0.3);
}

/* Card border colors based on status */
.dash-quick-card.status-good {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(17, 24, 39, 0.6));
}

.dash-quick-card.status-moderate {
  border-color: rgba(251, 191, 36, 0.4);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), rgba(17, 24, 39, 0.6));
}

.dash-quick-card.status-unhealthy {
  border-color: rgba(249, 115, 22, 0.4);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05), rgba(17, 24, 39, 0.6));
}

.dash-quick-card.status-hazardous {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(17, 24, 39, 0.6));
}

/* Pulsing animation for critical values */
.dash-quick-card.status-hazardous .dash-quick-value,
.dash-quick-card.traffic-severe .dash-quick-value {
  animation: criticalPulse 2s ease-in-out infinite;
}

@keyframes criticalPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}


/* ======================================== 
   CHARTS SECTION STYLES
   ======================================== */

/* Charts Controls Area */
.charts-controls {
  margin-bottom: 2.5rem;
}

.charts-header {
  margin-bottom: 1.5rem;
}

.charts-header h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.charts-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Time Range Selector */
.charts-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
}

.time-range-group,
.chart-options-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.time-range-selector {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.time-range-btn {
  padding: 0.6rem 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Interval Selector */
.chart-select {
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 140px;
}

.chart-select:hover,
.chart-select:focus {
  border-color: var(--accent-blue);
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Export Button */
.action-btn.export-btn {
  padding: 0.6rem 1.25rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.action-btn.export-btn:hover {
  background: var(--accent-blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-icon {
  font-size: 1.1em;
}

.time-range-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.5s ease;
}

.time-range-btn:hover::before {
  left: 100%;
}

.time-range-btn:hover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2);
}

.time-range-btn.active {
  background: var(--gradient-blue);
  color: white;
  border-color: var(--accent-blue);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

/* Chart Cards */
.chart-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.chart-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
}

/* Chart Header */
.chart-header {
  margin-bottom: 2rem;
}

.chart-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.chart-header h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.chart-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  display: block;
}

/* Chart Badge */
.chart-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Chart Container */
.chart-container {
  min-height: 350px;
  position: relative;
}

/* No Data Message */
.charts-no-data {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-xl);
  margin-top: 2rem;
}

.no-data-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.charts-no-data h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.charts-no-data p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

/* ApexCharts Menu & Toolbar Fixes */
.apexcharts-menu {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
}

.apexcharts-menu-item {
  color: var(--text-primary) !important;
}

.apexcharts-menu-item:hover {
  background: rgba(59, 130, 246, 0.1) !important;
}

.apexcharts-toolbar {
  z-index: 10 !important;
}

.apexcharts-tooltip {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

.apexcharts-tooltip-title {
  background: rgba(59, 130, 246, 0.1) !important;
  border-bottom: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}




/* Row 2: AQI Section */
.dashboard-aqi-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
}

.dashboard-aqi-main-card,
.dashboard-aqi-forecast-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.aqi-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.aqi-header-icon {
  font-size: 1.25rem;
}

.aqi-card-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.aqi-main-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.aqi-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.aqi-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.aqi-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.aqi-detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.aqi-detail-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Dashboard responsive for new layout */
@media (max-width: 1400px) {
  .dashboard-weather-row {
    grid-template-columns: 1fr;
  }

  /* 6 cards in 3x2 layout on large tablets */
  .dashboard-quick-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-aqi-row {
    grid-template-columns: 1fr;
  }

  .dashboard-aqi-pollutants-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {

  /* 6 cards in 2x3 layout on tablets */
  .dashboard-quick-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .main-weather-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-weather-display {
    flex-direction: column;
    text-align: center;
  }

  .aqi-main-content,
  .aqi-gauge-section {
    flex-direction: column;
    text-align: center;
  }

  .pollutants-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ================================================
   AQI + POLLUTANTS ROW STYLES
   ================================================ */

.dashboard-aqi-pollutants-row {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 1.5fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-aqi-gauge-card,
.dashboard-pollutants-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.aqi-gauge-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.aqi-gauge-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Pollutants Grid Styles */
.pollutants-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

.pollutant-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  text-align: center;
}

.pollutant-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.pollutant-icon {
  font-size: 1rem;
}

.pollutant-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.pollutant-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pollutant-unit {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Pollutant color coding */
.pollutant-value.good {
  color: var(--accent-green);
}

.pollutant-value.moderate {
  color: var(--accent-yellow);
}

.pollutant-value.unhealthy {
  color: var(--accent-orange);
}

.pollutant-value.hazardous {
  color: var(--accent-red);
}

/* ================================================
   7-DAY FORECAST ROW STYLES
   ================================================ */

.dashboard-forecast-row {
  margin-bottom: 1.5rem;
}

.dashboard-aqi-forecast-card.full-width {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.aqi-forecast-bars {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  height: 100px;
  padding-top: 0.5rem;
}

/* ================================================
   ML DATA TAB STYLES
   ================================================ */

.ml-data-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.ml-stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ml-stat-icon {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
}

.ml-stat-label {
  color: var(--text-secondary);
  flex: 1;
}

.ml-stat-value {
  font-weight: 600;
  color: var(--accent-cyan);
  font-size: 1.1rem;
}

.ml-export-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.btn-export {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
}

.btn-export:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.btn-export.btn-csv {
  border-color: rgba(16, 185, 129, 0.3);
}

.btn-export.btn-csv:hover {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
}

.btn-export.btn-json {
  border-color: rgba(59, 130, 246, 0.3);
}

.btn-export.btn-json:hover {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
}

.export-icon {
  font-size: 2rem;
}

.export-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.export-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ml-refresh-data {
  text-align: center;
}

.ml-refresh-data .btn-secondary {
  padding: 0.75rem 1.5rem;
}

/* ================================================
   SIMPLE ROUTE SELECTION PANEL
   ================================================ */

.traffic-route-panel {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.route-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.route-icon {
  font-size: 1.1rem;
}

.route-title {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.route-points {
  margin-bottom: 0.75rem;
}

.route-point {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(10, 14, 23, 0.5);
  border-radius: var(--radius-sm);
}

.route-point.origin {
  border-left: 3px solid #10b981;
}

.route-point.destination {
  border-left: 3px solid #ef4444;
}

.point-marker {
  font-size: 0.9rem;
}

.point-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  min-width: 40px;
}

.point-value {
  color: var(--text-primary);
  font-size: 0.85rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-connector {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.25rem 0;
}

.route-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-set-route {
  flex: 1;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-set-route:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3));
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.btn-set-route.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(245, 158, 11, 0.3));
  border-color: var(--accent-yellow);
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
  }

  50% {
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
  }
}

.btn-clear-route {
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-clear-route:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--accent-red);
}

.btn-clear-route.hidden {
  display: none;
}

.route-instructions {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-sm);
  text-align: center;
}

.route-instructions.hidden {
  display: none;
}

.instruction-step {
  color: var(--accent-yellow);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ========================================
   RESPONSIVE DESIGN - MEDIA QUERIES
   ======================================== */

/* Mobile Menu Toggle (Hidden on Desktop) */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 300;
  background: var(--gradient-blue);
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  transform: scale(1.1);
}

/* Tablet Styles (768px - 1024px) */
@media screen and (max-width: 1024px) {
  :root {
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
  }

  /* Header adjustments */
  .header {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .logo h1 {
    font-size: 1.25rem;
  }

  .header-center {
    max-width: 350px;
  }

  /* Sidebar */
  .sidebar {
    width: 200px;
  }

  .content-wrapper {
    margin-left: 200px;
  }

  /* Current Section - Stack on tablet */
  .current-section {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  /* Metrics grid - 2 columns instead of 3 */
  .current-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Hourly forecast - Reduce visible cards */
  .hourly-forecast {
    gap: var(--spacing-sm);
  }

  .hourly-card {
    min-width: 80px;
  }

  /* Daily forecast - 2 columns */
  .forecast-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* AQI Dashboard Grid */
  .aqi-overview-grid {
    grid-template-columns: 1fr;
  }

  .aqi-pollutants-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .aqi-env-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Traffic Map */
  #traffic-map {
    height: 400px;
  }
}

/* Mobile Styles (max-width: 768px) */
@media screen and (max-width: 768px) {
  :root {
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.25rem;
    --spacing-xl: 1.5rem;
  }

  /* Header - Compact Mobile Layout */
  .header {
    padding: var(--spacing-sm);
    flex-wrap: wrap;
  }

  .logo h1 {
    font-size: 1.1rem;
  }

  .logo-icon {
    font-size: 1.5rem;
  }

  .header-center {
    order: 3;
    width: 100%;
    margin-top: var(--spacing-sm);
    max-width: 100%;
  }

  .header-right {
    gap: var(--spacing-xs);
  }

  .last-updated {
    font-size: 0.75rem;
  }

  /* Sidebar - Slide-in Mobile Menu */
  .sidebar {
    position: fixed;
    left: -250px;
    width: 250px;
    top: 0;
    height: 100vh;
    transition: left 0.3s ease;
    background: rgba(10, 14, 23, 0.98);
    z-index: 250;
    padding-top: var(--spacing-lg);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  /* Sidebar overlay */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 240;
  }

  .sidebar-overlay.active {
    display: block;
  }

  /* Show mobile menu button */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Content - Full Width on Mobile */
  .content-wrapper {
    margin-left: 0;
    padding: var(--spacing-md);
    padding-top: calc(120px + var(--spacing-sm));
  }

  /* Main Content */
  .main-content {
    padding: var(--spacing-sm);
  }

  /* Current Weather Card */
  .current-main {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-sm);
  }

  .current-icon {
    font-size: 4.5rem;
  }

  .temp-value {
    font-size: 3.5rem;
  }

  .temp-unit {
    font-size: 1.5rem;
  }

  .weather-desc {
    font-size: 1.1rem;
  }

  /* Metrics - Single Column */
  .current-metrics {
    grid-template-columns: 1fr;
    gap: var(--spacing-xs);
  }

  .metric-item {
    padding: 0.75rem;
  }

  /* Quick Metrics - Stack on Mobile */
  .quick-metrics {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  /* Dashboard Quick Metrics - Single Column on Mobile */
  .dashboard-quick-metrics {
    grid-template-columns: 1fr;
    gap: var(--spacing-xs);
  }

  .dash-quick-card {
    padding: 1rem;
  }

  /* Hourly Forecast - Smaller Cards */
  .hourly-card {
    min-width: 70px;
    padding: var(--spacing-xs);
  }

  .hourly-icon {
    font-size: 1.75rem;
  }

  .hourly-temp {
    font-size: 1rem;
  }

  /* Daily Forecast - Single Column */
  .forecast-grid {
    grid-template-columns: 1fr;
  }

  .forecast-card {
    padding: var(--spacing-md);
  }

  /* Sun Times */
  .sun-times {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  /* AQI Dashboard */
  .aqi-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .aqi-header-info {
    width: 100%;
  }

  .aqi-overview-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  /* AQI Gauge - Smaller on Mobile */
  .aqi-gauge canvas {
    max-width: 200px;
    max-height: 200px;
  }

  .aqi-gauge-value {
    font-size: 3rem;
  }

  /* Pollutant Cards - 2 Columns on Mobile */
  .aqi-pollutants-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xs);
  }

  .aqi-card {
    padding: var(--spacing-sm);
  }

  .aqi-card-icon {
    font-size: 1.75rem;
  }

  .aqi-card-value {
    font-size: 1.5rem;
  }

  /* Environmental Cards */
  .aqi-env-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-xs);
  }

  /* Traffic Section */
  #traffic-map {
    height: 300px;
  }

  .traffic-controls {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .traffic-btn {
    width: 100%;
    justify-content: center;
  }

  .traffic-stats {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  /* Settings Modal */
  .settings-modal {
    width: 95%;
    max-width: none;
    margin: var(--spacing-sm);
  }

  .settings-tabs {
    flex-direction: column;
  }

  .settings-tab {
    width: 100%;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer {
    padding: var(--spacing-md);
    font-size: 0.85rem;
  }
}

/* Small Mobile Devices (max-width: 480px) */
@media screen and (max-width: 480px) {

  /* Extra compact spacing */
  :root {
    --spacing-xs: 0.4rem;
    --spacing-sm: 0.6rem;
    --spacing-md: 0.8rem;
    --spacing-lg: 1rem;
  }

  /* Header */
  .logo h1 {
    font-size: 1rem;
  }

  .btn-refresh {
    padding: 0.4rem;
  }

  .refresh-icon {
    font-size: 1rem;
  }

  /* Content */
  .content-wrapper {
    padding: var(--spacing-sm);
    padding-top: calc(130px + var(--spacing-sm));
  }

  /* Current Weather */
  .current-card {
    padding: var(--spacing-md);
  }

  .temp-value {
    font-size: 3rem;
  }

  .current-icon {
    font-size: 3.5rem;
  }

  /* Hourly Forecast */
  .hourly-card {
    min-width: 60px;
    padding: 0.4rem;
  }

  .hourly-icon {
    font-size: 1.5rem;
  }

  .hourly-temp {
    font-size: 0.9rem;
  }

  .hourly-time {
    font-size: 0.75rem;
  }

  /* AQI Cards - Force 1 Column */
  .aqi-pollutants-grid {
    grid-template-columns: 1fr;
  }

  /* Buttons */
  button,
  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  /* Modals */
  .settings-modal {
    padding: var(--spacing-md);
  }

  .modal-header h2 {
    font-size: 1.25rem;
  }
}

/* Landscape Orientation Fixes */
@media screen and (max-height: 600px) and (orientation: landscape) {
  .sidebar {
    height: 100vh;
    overflow-y: auto;
  }

  .content-wrapper {
    padding-top: calc(70px + var(--spacing-sm));
  }

  .current-icon {
    font-size: 3rem;
  }

  .temp-value {
    font-size: 2.5rem;
  }

  #traffic-map {
    height: 250px;
  }
}

/* Print Styles */
@media print {

  .header,
  .sidebar,
  .mobile-menu-toggle,
  .btn-refresh,
  .settings-btn,
  .footer {
    display: none !important;
  }

  .content-wrapper {
    margin-left: 0;
    padding: 0;
  }

  .current-card,
  .quick-card,
  .forecast-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* ========================================
   SETTINGS MODAL TABS FIX
   ======================================== */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-tab:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.settings-tab.active {
  background: var(--accent-blue, #3b82f6);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
  border-color: transparent;
}