/* ==========================================
   CSS RESET & VARIABLES SYSTEM
   ========================================== */
:root {
  /* Light Theme Color Palette */
  --bg-main: #f4f7fc;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-header: rgba(255, 255, 255, 0.8);
  --bg-input: #ffffff;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --border-color: rgba(226, 232, 240, 0.8);
  --border-highlight: rgba(99, 102, 241, 0.3);
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.1);
  
  --accent-cyan: #0284c7;
  --accent-blue: #2563eb;
  --accent-purple: #7c3aed;
  --accent-amber: #d97706;
  --accent-red: #dc2626;
  
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --card-shadow-hover: 0 20px 30px -10px rgba(79, 70, 229, 0.15), 0 10px 15px -5px rgba(0, 0, 0, 0.05);
  --modal-backdrop: rgba(15, 23, 42, 0.5);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* Dark Theme Color Palette */
  --bg-main: #0b0f19;
  --bg-card: rgba(21, 29, 46, 0.75);
  --bg-card-hover: rgba(30, 41, 64, 0.85);
  --bg-header: rgba(11, 15, 25, 0.8);
  --bg-input: rgba(30, 41, 64, 0.6);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(129, 140, 248, 0.35);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.18);
  
  --accent-cyan: #38bdf8;
  --accent-blue: #60a5fa;
  --accent-purple: #a78bfa;
  --accent-amber: #fbbf24;
  --accent-red: #f87171;
  
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 20px 35px -8px rgba(99, 102, 241, 0.25), 0 10px 15px -5px rgba(0, 0, 0, 0.3);
  --modal-backdrop: rgba(0, 0, 0, 0.75);
}

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

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Ambient Background FX */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.25;
  transition: opacity 0.5s ease;
}

[data-theme="dark"] .glow-orb {
  opacity: 0.18;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #6366f1, #3b82f6);
  top: -100px;
  right: -50px;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #06b6d4, #3b82f6);
  bottom: -150px;
  left: -100px;
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #8b5cf6, #ec4899);
  top: 45%;
  left: 30%;
  animation: floatOrb 25s ease-in-out infinite alternate;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -60px) scale(1.1); }
  100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Layout */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem 1.5rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  margin: 0 -1.5rem 1.5rem -1.5rem;
  padding: 1.25rem 1.5rem;
  transition: var(--transition);
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.brand-icon i {
  width: 26px;
  height: 26px;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-main), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  background: var(--bg-card);
  padding: 0.35rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
}

.nav-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.nav-tab i {
  width: 18px;
  height: 18px;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.btn:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-secondary {
  background: var(--bg-card);
}

.unit-badge {
  font-weight: 800;
  color: var(--primary);
}

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.spinning {
  animation: spin 0.8s linear infinite;
}

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

/* Status Banner */
.status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.status-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.status-icon {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

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

.hidden {
  display: none !important;
}

/* Summary Metrics Section */
.summary-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.summary-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
  box-shadow: var(--card-shadow-hover);
}

.summary-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.summary-icon-box i {
  width: 24px;
  height: 24px;
}

.bg-blue { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.bg-red { background: linear-gradient(135deg, #ef4444, #f87171); }
.bg-cyan { background: linear-gradient(135deg, #06b6d4, #38bdf8); }
.bg-purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }

.summary-info {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.summary-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* Controls Section (Search & Filters) */
.controls-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 2.4rem 0.65rem 2.6rem;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.clear-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.pill {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.pill:hover {
  color: var(--text-main);
}

.pill.active {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.sort-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.sort-icon {
  position: absolute;
  left: 0.8rem;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.custom-select {
  padding: 0.55rem 2rem 0.55rem 2.3rem;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: var(--transition);
}

.custom-select:focus {
  border-color: var(--primary);
}

/* Update Indicator */
.update-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-left: 0.25rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Weather Grid */
.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Skeleton Loading Cards */
.skeleton-card {
  height: 230px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* City Weather Card */
.city-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(14px);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.city-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  opacity: 0;
  transition: var(--transition);
}

.city-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-highlight);
  box-shadow: var(--card-shadow-hover);
}

.city-card:hover::before {
  opacity: 1;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.city-names {
  display: flex;
  flex-direction: column;
}

.rank-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: inline-block;
}

.pop-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.city-name-kr {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.city-name-en {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.1rem;
}

.weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.card-temp-group {
  display: flex;
  flex-direction: column;
}

.card-temp-main {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.card-feels-like {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.card-weather-icon {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.card-weather-icon i {
  width: 44px;
  height: 44px;
}

.card-footer-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.78rem;
}

.metric-sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
}

.metric-sub strong {
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

/* ==========================================
   SEOUL CLIMATE HISTORY STYLING (1974~CURRENT)
   ========================================== */
.history-hero {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(6, 182, 212, 0.12));
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(14px);
}

.history-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.history-badge i {
  width: 14px;
  height: 14px;
}

.history-hero h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.history-hero p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.history-records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.record-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.record-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--border-highlight);
}

.record-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.record-icon i {
  width: 26px;
  height: 26px;
}

.record-info {
  display: flex;
  flex-direction: column;
}

.record-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.record-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.record-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.color-red { color: var(--accent-red); }
.color-cyan { color: var(--accent-cyan); }
.color-purple { color: var(--accent-purple); }
.color-blue { color: var(--accent-blue); }

/* SVG Trend Chart Card */
.history-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(14px);
  box-shadow: var(--card-shadow);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-card-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-trend { background: var(--primary); }
.dot-avg { background: var(--accent-amber); }

.svg-chart-wrapper {
  width: 100%;
  overflow-x: auto;
  padding: 0.5rem 0;
}

/* Year Slider Control */
.year-slider-control {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.year-slider-control label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.year-highlight {
  color: var(--primary);
  font-size: 1.1rem;
}

.year-slider-control input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  height: 6px;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Year Detail Card */
.year-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(14px);
  box-shadow: var(--card-shadow);
}

.year-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.year-detail-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
}

.year-summary-tag {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  display: inline-block;
  margin-top: 0.2rem;
}

.year-stat-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.year-stat-badge span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.year-stat-badge strong {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.year-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.year-metric {
  background: var(--bg-input);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.year-metric i {
  width: 24px;
  height: 24px;
}

.year-metric span {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.year-metric strong {
  font-size: 1rem;
  font-weight: 700;
}

/* Monthly Chart Bars */
.monthly-chart-section h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.monthly-chart-section h4 i {
  color: var(--primary);
  width: 18px;
  height: 18px;
}

.monthly-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 180px;
  padding: 1rem 0.5rem 0.5rem 0.5rem;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.monthly-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 0.3rem;
}

.bar-fill {
  width: 100%;
  max-width: 32px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-height: 4px;
}

.bar-val {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-main);
}

.bar-month {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* No Results State */
.no-results {
  text-align: center;
  padding: 4rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-top: 1.5rem;
}

.no-results-icon {
  width: 60px;
  height: 60px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.no-results h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.no-results p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Footer */
.footer {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Modal System */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--modal-backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 1.75rem;
}

.modal-backdrop.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-city-info {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.modal-city-info h2 {
  font-size: 1.6rem;
  font-weight: 800;
}

.modal-city-info span {
  font-size: 0.95rem;
  color: var(--text-muted);
}

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

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-hero-weather {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem 0;
}

.modal-temp-box {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modal-weather-icon {
  width: 64px;
  height: 64px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-weather-icon i {
  width: 56px;
  height: 56px;
}

.modal-temp-main {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.modal-feels {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.modal-condition-box {
  text-align: right;
}

.modal-condition {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.modal-temp-range {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.modal-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem 0;
  padding: 1rem;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.metric-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.forecast-section {
  margin-top: 1.5rem;
}

.forecast-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.forecast-title i {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.forecast-list {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-behavior: smooth;
}

.forecast-list::-webkit-scrollbar {
  height: 6px;
}
.forecast-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}

.forecast-item {
  min-width: 100px;
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.forecast-day {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.forecast-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.forecast-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  margin: 0.2rem 0;
}

.forecast-temp {
  font-size: 0.95rem;
  font-weight: 800;
}

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

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .app-container {
    padding: 0 1rem 2rem 1rem;
  }
  .header {
    margin: 0 -1rem 1.5rem -1rem;
    padding: 1rem;
  }
  .brand-title {
    font-size: 1.15rem;
  }
  .controls-section {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-pills {
    justify-content: space-between;
  }
  .pill {
    flex: 1;
    text-align: center;
  }
  .custom-select {
    width: 100%;
  }
  .modal-hero-weather {
    flex-direction: column;
    align-items: flex-start;
  }
  .modal-condition-box {
    text-align: left;
  }
  .monthly-bars {
    height: 140px;
  }
}
