/* ==========================================================================
   PakWeather Live - Design System & Stylesheet
   Theme: Modern Weather Dashboard, Dynamic Sky Gradients & Glassmorphism
   ========================================================================== */

:root {
  /* Dynamic Sky Colors */
  --bg-sky-day: linear-gradient(135deg, #0F2027, #203A43, #2C5364);
  --bg-sky-sunny: linear-gradient(135deg, #1A365D, #2B6CB0, #4299E1);
  --bg-sky-rainy: linear-gradient(135deg, #1E293B, #334155, #475569);
  --bg-sky-smog: linear-gradient(135deg, #2D1B00, #4A2E00, #78350F);

  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: #0F172A;
  
  --primary-emerald: #10B981;
  --primary-blue: #3B82F6;
  --accent-gold: #F59E0B;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(59, 130, 246, 0.4);
  
  /* AQI Severity Color Palette */
  --aqi-good: #10B981;
  --aqi-moderate: #F59E0B;
  --aqi-unhealthy-sensitive: #F97316;
  --aqi-unhealthy: #EF4444;
  --aqi-very-unhealthy: #8B5CF6;
  --aqi-hazardous: #7C3AED;
  
  /* Fonts */
  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;

  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.25);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-sky-day);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s ease;
}

/* Container & Grids */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.grid-2-col-wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.text-center { text-align: center; }
.text-warning { color: var(--accent-gold); }
.text-info { color: #38BDF8; }
.text-success { color: var(--primary-emerald); }
.text-muted { color: var(--text-muted); }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
}

/* Alert Ticker Bar */
.alert-ticker {
  background: linear-gradient(90deg, #991B1B, #7F1D1D);
  color: #fff;
  font-size: 0.88rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.ticker-container {
  display: flex;
  align-items: center;
  gap: 14px;
}

.alert-badge {
  background: #DC2626;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.ticker-text {
  flex: 1;
  font-weight: 500;
}

.ticker-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}

/* Navbar */
.navbar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #3B82F6, #10B981);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.brand-name .highlight { color: #38BDF8; }

/* Search Box Autocomplete */
.search-box {
  position: relative;
  width: 380px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

#city-search-input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: 30px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s;
}

#city-search-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.search-dropdown {
  position: absolute;
  top: 110%;
  left: 0;
  width: 100%;
  background: #0F172A;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: none;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1100;
}

.search-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.search-item:hover { background: rgba(59, 130, 246, 0.2); }

/* Navigation Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.unit-toggle {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2px;
}

.unit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.unit-btn.active {
  background: var(--primary-blue);
  color: #fff;
}

/* Quick Cities Bar */
.quick-cities-bar {
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-glass);
  padding: 10px 0;
}

.quick-cities-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quick-label {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.quick-pills-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.city-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.city-pill:hover, .city-pill.active {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: #fff;
}

/* AdSense Slot Containers */
.ad-banner-container {
  margin: 20px auto;
}

.adsense-slot {
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  position: relative;
}

.ad-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.ad-placeholder {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Hero Weather Section */
.hero-weather-section {
  padding: 20px 0 40px 0;
}

.weather-dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 28px;
}

.main-weather-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}

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

.city-name {
  font-size: 2.3rem;
  margin-bottom: 4px;
}

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

.weather-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  color: #38BDF8;
  font-size: 0.9rem;
  font-weight: 600;
}

.weather-main-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.temp-big-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.weather-icon-giant {
  font-size: 4.5rem;
}

.temp-big {
  font-family: var(--font-heading);
  font-size: 4.8rem;
  font-weight: 800;
  line-height: 1;
}
.degree-symbol {
  font-size: 2.5rem;
  color: var(--primary-blue);
}

.weather-meta-primary {
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

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

.metric-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  padding: 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-icon {
  font-size: 1.4rem;
  color: var(--primary-blue);
}

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

.metric-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
}

/* AQI Side Card */
.aqi-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.aqi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.aqi-score-display {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.aqi-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--aqi-moderate);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.aqi-num {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.aqi-unit {
  font-size: 0.65rem;
  text-transform: uppercase;
}

.aqi-advice-text {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.pollutants-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(15, 23, 42, 0.5);
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.pollutant-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.smog-warning-box {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #C084FC;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

/* Hourly Slider Section */
.forecast-section {
  padding: 40px 0;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}

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

.hourly-slider-wrapper {
  overflow-x: auto;
  scrollbar-width: none;
}

.hourly-flex {
  display: flex;
  gap: 16px;
  padding-bottom: 10px;
}

.hourly-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  min-width: 110px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s;
}
.hourly-card:hover { transform: translateY(-4px); }

.hourly-time { font-size: 0.85rem; color: var(--text-muted); }
.hourly-icon { font-size: 1.5rem; margin: 4px 0; }
.hourly-temp { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; }
.hourly-pop { font-size: 0.75rem; color: #38BDF8; }

/* 10-Day Extended & Map Grid */
.forecast-map-section {
  padding: 40px 0;
}

.ten-day-card, .radar-map-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.ten-day-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ten-day-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.5fr 1fr;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.day-name { font-weight: 600; }
.day-condition { display: flex; align-items: center; gap: 8px; }
.day-temp-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.temp-line {
  flex: 1;
  height: 4px;
  background: linear-gradient(90deg, #38BDF8, #F59E0B);
  border-radius: 2px;
}

/* Radar Map */
.map-wrapper {
  position: relative;
  height: 380px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

#radar-map {
  width: 100%;
  height: 100%;
}

.map-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  padding: 6px;
  border-radius: 25px;
  border: 1px solid var(--border-glass);
}

.map-layer-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.map-layer-btn.active {
  background: var(--primary-blue);
  color: #fff;
}

/* Special Topics Grid */
.special-topics-section {
  padding: 60px 0;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 30px;
}

.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.topic-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-emerald);
  margin-bottom: 10px;
}

.topic-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.topic-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Blog Section */
.blog-section {
  padding: 60px 0;
  background: rgba(0, 0, 0, 0.2);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
}

.blog-badge {
  font-size: 0.75rem;
  color: #38BDF8;
  font-weight: 700;
  margin-bottom: 8px;
}

.blog-card h3 {
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.blog-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.blog-date {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary-blue);
  color: #fff;
}
.btn-primary:hover { background: #2563EB; }

.btn-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: #fff;
}
.btn-outline:hover { border-color: var(--primary-blue); color: var(--primary-blue); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-large { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; }

/* FAQ Accordion */
.faq-section { padding: 60px 0; }

.faq-accordion-wrapper {
  max-width: 800px;
  margin: 30px auto 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 18px 22px;
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 22px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.faq-item.active .faq-answer {
  max-height: 180px;
  padding: 0 22px 18px 22px;
}

/* Footer */
.footer {
  background: #090D16;
  border-top: 1px solid var(--border-glass);
  padding: 60px 0 30px 0;
}

.footer-container {
  display: grid;
  grid-template-columns: 1.5fr 2.5fr;
  gap: 60px;
}

.footer-brand p { color: var(--text-muted); font-size: 0.88rem; margin: 14px 0 20px 0; max-width: 320px; }
.copyright { font-size: 0.78rem; color: var(--text-dim); }

.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-col h4 { font-size: 0.9rem; margin-bottom: 14px; }
.footer-col a { display: block; color: var(--text-muted); text-decoration: none; font-size: 0.85rem; margin-bottom: 8px; }
.footer-col a:hover { color: var(--primary-blue); }

/* Mobile Sticky Ad Anchor */
.mobile-sticky-ad {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-glass);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
}

.sticky-ad-content { text-align: center; }
.ad-placeholder-sm { font-size: 0.75rem; color: var(--text-muted); }
.btn-close-ad { position: absolute; right: 12px; background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}

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

.modal-card {
  background: #0F172A;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 480px;
  padding: 28px; position: relative;
}

.modal-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px;
  background: #1E293B; border: 1px solid var(--border-glass);
  border-radius: 6px; color: #fff; outline: none;
}

/* Toast */
.toast-container { position: fixed; bottom: 60px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1E293B; border: 1px solid var(--primary-blue); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 0.88rem; }

/* Responsive */
@media (max-width: 992px) {
  .weather-dashboard-grid, .grid-2-col-wide, .topics-grid, .blog-grid, .footer-container {
    grid-template-columns: 1fr;
  }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .search-box { width: 220px; }
}
