/* =============================================
   ACHIPVN - Main Stylesheet
   Công ty TNHH Nông Nghiệp UDCNC A-Chíp
   ============================================= */

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

:root {
  --sky-top: #0b3d8c;
  --sky-mid: #1a6fc4;
  --sky-light: #5aaee0;
  --sky-horizon: #aad4f0;
  --accent: #e8b000;
  --accent2: #00c8a0;
  --dark: #0d1b2a;
  --card-bg: rgba(255,255,255,0.96);
  --text: #1a2535;
  --muted: #607080;
  --nav-h: 64px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  color: var(--text);
  background: #f0f4f8;
  overflow-x: hidden;
}

/* ============ NAVIGATION ============ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 24px;
  background: transparent;
  transition: background 0.4s, box-shadow 0.4s;
}
#navbar.scrolled {
  background: rgba(11,61,140,0.97);
  box-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #fff;
}
.nav-logo .logo-badge {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #e8b000, #ff6b35);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px; color: #fff;
  box-shadow: 0 2px 8px rgba(232,176,0,0.5);
  flex-shrink: 0;
}
.nav-logo .logo-text { line-height: 1.1; }
.nav-logo .logo-text strong { font-size: 20px; letter-spacing: 1px; display: block; }
.nav-logo .logo-text span { font-size: 11px; opacity: 0.85; }
.nav-menu {
  margin-left: auto;
  display: flex; gap: 4px; list-style: none;
}
.nav-menu a {
  color: rgba(255,255,255,0.9); text-decoration: none;
  padding: 6px 14px; border-radius: 20px;
  font-size: 14px; font-weight: 500;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-menu a:hover, .nav-menu a.active {
  background: rgba(255,255,255,0.2); color: #fff;
}
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; transition: 0.3s; }

/* ============ SKY HERO ============ */
#sky-hero {
  position: relative;
  width: 100%; height: 100vh; min-height: 600px;
  background: linear-gradient(to bottom,
    var(--sky-top) 0%,
    var(--sky-mid) 30%,
    var(--sky-light) 65%,
    var(--sky-horizon) 100%);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}

/* Sun */
.sun {
  position: absolute; top: 80px; right: 15%;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, #ffe066 30%, #ffb300 70%, rgba(255,200,0,0) 100%);
  box-shadow: 0 0 60px 20px rgba(255,220,50,0.35);
  animation: sun-pulse 4s ease-in-out infinite;
}
@keyframes sun-pulse {
  0%,100% { box-shadow: 0 0 60px 20px rgba(255,220,50,0.35); }
  50% { box-shadow: 0 0 80px 35px rgba(255,220,50,0.5); }
}

/* Clouds */
.cloud-wrap { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.cloud {
  position: absolute;
  background: rgba(255,255,255,0.88);
  border-radius: 50px;
}
.cloud::before, .cloud::after {
  content: ''; position: absolute;
  background: rgba(255,255,255,0.88);
  border-radius: 50%;
}
/* Cloud 1 */
.c1 { width: 180px; height: 50px; top: 18%; animation: cloud-move1 38s linear infinite; }
.c1::before { width: 80px; height: 80px; top: -40px; left: 25px; }
.c1::after { width: 60px; height: 60px; top: -30px; left: 80px; }
/* Cloud 2 */
.c2 { width: 240px; height: 60px; top: 28%; animation: cloud-move2 52s linear infinite; opacity: 0.82; }
.c2::before { width: 110px; height: 110px; top: -55px; left: 30px; }
.c2::after { width: 80px; height: 80px; top: -40px; left: 110px; }
/* Cloud 3 */
.c3 { width: 140px; height: 40px; top: 14%; animation: cloud-move3 44s linear infinite; opacity: 0.75; }
.c3::before { width: 60px; height: 60px; top: -30px; left: 20px; }
.c3::after { width: 50px; height: 50px; top: -25px; left: 65px; }
/* Cloud 4 */
.c4 { width: 200px; height: 55px; top: 38%; animation: cloud-move4 60s linear infinite; opacity: 0.70; }
.c4::before { width: 90px; height: 90px; top: -45px; left: 35px; }
.c4::after { width: 70px; height: 70px; top: -35px; left: 105px; }
/* Cloud 5 (dark/rain cloud) */
.c5 { width: 260px; height: 65px; top: 22%; animation: cloud-move5 70s linear infinite; opacity: 0.65;
  background: rgba(150,170,200,0.75); }
.c5::before { width: 120px; height: 120px; top: -60px; left: 40px; background: rgba(150,170,200,0.75); border-radius: 50%; }
.c5::after { width: 90px; height: 90px; top: -45px; left: 130px; background: rgba(150,170,200,0.75); border-radius: 50%; }
/* Cloud 6 */
.c6 { width: 160px; height: 45px; top: 45%; animation: cloud-move6 48s linear infinite; opacity: 0.60; }
.c6::before { width: 70px; height: 70px; top: -35px; left: 20px; }
.c6::after { width: 55px; height: 55px; top: -28px; left: 75px; }

@keyframes cloud-move1 { 0%{left:-220px} 100%{left:calc(100% + 220px)} }
@keyframes cloud-move2 { 0%{left:calc(100% + 270px)} 100%{left:-270px} }
@keyframes cloud-move3 { 0%{left:-180px} 100%{left:calc(100% + 180px)} }
@keyframes cloud-move4 { 0%{left:calc(100% + 240px)} 100%{left:-240px} }
@keyframes cloud-move5 { 0%{left:-300px} 100%{left:calc(100% + 300px)} }
@keyframes cloud-move6 { 0%{left:calc(100% + 200px)} 100%{left:-200px} }

/* Rain effect on dark cloud */
.rain-drop {
  position: absolute; bottom: -30px;
  width: 2px; height: 15px;
  background: linear-gradient(to bottom, transparent, rgba(130,180,230,0.8));
  border-radius: 2px;
  animation: rain-fall 0.8s linear infinite;
}
.rain-drop:nth-child(1){left:20%; animation-delay:0s;}
.rain-drop:nth-child(2){left:35%; animation-delay:0.15s;}
.rain-drop:nth-child(3){left:50%; animation-delay:0.05s;}
.rain-drop:nth-child(4){left:65%; animation-delay:0.25s;}
.rain-drop:nth-child(5){left:80%; animation-delay:0.1s;}
@keyframes rain-fall { 0%{opacity:0;transform:translateY(0)} 50%{opacity:1} 100%{opacity:0;transform:translateY(20px)} }

/* Hero content */
.hero-content {
  position: relative; z-index: 10;
  text-align: center; color: #fff;
  padding: 20px;
}
.hero-badge {
  display: inline-block;
  background: rgba(232,176,0,0.9);
  color: #fff; font-size: 12px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 4px 16px; border-radius: 20px;
  margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(32px, 6vw, 68px);
  font-weight: 900; letter-spacing: -1px;
  text-shadow: 0 3px 20px rgba(0,0,0,0.4);
  line-height: 1.1; margin-bottom: 8px;
}
.hero-title span { color: var(--accent); }
.hero-sub {
  font-size: clamp(14px, 2vw, 20px);
  opacity: 0.92; max-width: 600px; margin: 0 auto 24px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-hero {
  padding: 12px 28px; border-radius: 30px; font-size: 15px; font-weight: 600;
  text-decoration: none; transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: rgba(255,255,255,0.2); color: #fff; border: 2px solid rgba(255,255,255,0.5); }

/* Scroll indicator */
.scroll-down {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.7); font-size: 12px; text-align: center; cursor: pointer;
  animation: bounce 2s infinite;
}
.scroll-down svg { display: block; margin: 4px auto 0; }
@keyframes bounce { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(8px)} }

/* ============ STATS BAR ============ */
#stats-bar {
  background: var(--dark);
  padding: 14px 24px;
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: center;
}
.stat-item {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.85);
}
.stat-item .stat-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.stat-item .stat-num { font-size: 22px; font-weight: 700; color: #fff; line-height: 1; }
.stat-item .stat-label { font-size: 11px; opacity: 0.7; }
.stat-sep { width: 1px; height: 36px; background: rgba(255,255,255,0.1); }
#last-update-time { color: var(--accent); font-weight: 600; }

/* ============ SECTIONS ============ */
.section { padding: 56px 24px; max-width: 1300px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 36px; }
.section-header h2 {
  font-size: clamp(22px, 4vw, 34px); font-weight: 800;
  color: var(--dark); margin-bottom: 8px;
}
.section-header h2 .hi { color: var(--sky-mid); }
.section-header p { color: var(--muted); font-size: 15px; max-width: 600px; margin: 0 auto; }
.section-header .badge {
  display: inline-block; background: rgba(26,111,196,0.1); color: var(--sky-mid);
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 3px 12px; border-radius: 20px; margin-bottom: 8px;
}

/* ============ MAP SECTION ============ */
#weather-section { background: #fff; padding: 40px 0 0; }
#weather-section .section { max-width: 100%; padding: 40px 24px 0; }
#station-map {
  width: 100%; height: 480px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  z-index: 1;
}

/* Map legend */
.map-legend {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 0; font-size: 13px;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.6); }

/* ============ WEATHER TABLE ============ */
#station-table-wrap {
  overflow-x: auto; overflow-y: auto;
  max-height: 420px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  margin-top: 24px;
}
#station-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; background: #fff;
}
#station-table thead th {
  background: var(--dark); color: #fff;
  padding: 10px 12px; text-align: left;
  position: sticky; top: 0; z-index: 2;
  white-space: nowrap; font-weight: 600;
}
#station-table tbody tr { border-bottom: 1px solid #e8edf2; transition: background 0.15s; cursor: pointer; }
#station-table tbody tr:hover { background: #f0f6ff; }
#station-table tbody td { padding: 8px 12px; white-space: nowrap; }
.temp-badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-weight: 700; font-size: 13px; color: #fff;
}
.temp-cold { background: #3b82f6; }
.temp-cool { background: #06b6d4; }
.temp-warm { background: #f59e0b; }
.temp-hot  { background: #ef4444; }
.temp-very-hot { background: #7c3aed; }
.rain-badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.rain-none { background: #e5e7eb; color: #6b7280; }
.rain-light { background: #dbeafe; color: #1d4ed8; }
.rain-mod { background: #bfdbfe; color: #1e3a8a; }
.rain-heavy { background: #7c3aed; color: #fff; }
.status-online { color: #10b981; font-weight: 600; }
.status-offline { color: #ef4444; font-weight: 600; }

/* ============ AI FORECAST SECTION ============ */
#ai-section { background: linear-gradient(135deg, #0d1b2a 0%, #1a3a5c 100%); padding: 56px 0; }
#ai-section .section { max-width: 1300px; padding: 0 24px; }
#ai-section .section-header h2 { color: #fff; }
#ai-section .section-header p { color: rgba(255,255,255,0.65); }
#ai-section .section-header .badge { background: rgba(0,200,160,0.15); color: var(--accent2); }

.ai-controls {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 28px; padding: 16px 20px;
  background: rgba(255,255,255,0.06); border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}
.ai-controls label { color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 500; }
.ai-controls select {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 14px;
  cursor: pointer; min-width: 220px;
}
.ai-controls select option { background: #1a3a5c; color: #fff; }
.btn-forecast {
  background: linear-gradient(135deg, #00c8a0, #0088cc);
  color: #fff; border: none; padding: 9px 22px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-forecast:hover { opacity: 0.9; transform: translateY(-1px); }

.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ai-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px; padding: 24px;
}
.ai-card-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.ai-card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.icon-temp { background: linear-gradient(135deg, #ff6b35, #f59e0b); }
.icon-rain { background: linear-gradient(135deg, #1d4ed8, #06b6d4); }
.ai-card-title { color: #fff; font-size: 17px; font-weight: 700; }
.ai-card-sub { color: rgba(255,255,255,0.55); font-size: 12px; }
.chart-wrap { position: relative; height: 280px; }
.ai-loading {
  text-align: center; padding: 60px 20px;
  color: rgba(255,255,255,0.5); font-size: 14px;
}
.spinner {
  width: 36px; height: 36px; border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent2); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Forecast summary */
.forecast-summary {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 16px;
}
.fc-sum-item {
  background: rgba(255,255,255,0.05); border-radius: 8px; padding: 10px;
  text-align: center;
}
.fc-sum-item .fc-time { color: rgba(255,255,255,0.5); font-size: 11px; }
.fc-sum-item .fc-val { color: #fff; font-size: 18px; font-weight: 700; margin: 2px 0; }
.fc-sum-item .fc-sub { font-size: 11px; }
.fc-temp .fc-val { color: #fbbf24; }
.fc-rain .fc-val { color: #60a5fa; }

/* ============ COMPANY SECTION ============ */
#company-section { background: #fff; }
.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.service-card {
  background: #f8fafc; border-radius: 16px; padding: 28px 24px;
  border: 1px solid #e2eaf0;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(26,111,196,0.12);
  border-color: var(--sky-mid);
}
.service-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 16px;
}
.ic1 { background: linear-gradient(135deg, #dbeafe, #93c5fd); }
.ic2 { background: linear-gradient(135deg, #dcfce7, #86efac); }
.ic3 { background: linear-gradient(135deg, #fef3c7, #fbbf24); }
.ic4 { background: linear-gradient(135deg, #f3e8ff, #c084fc); }
.service-card h3 { font-size: 16px; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.service-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ============ PAGE SECTIONS ============ */
.page-hero {
  background: linear-gradient(135deg, var(--sky-top), var(--sky-mid));
  color: #fff; text-align: center; padding: 100px 24px 56px;
}
.page-hero h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 900; margin-bottom: 8px; }
.page-hero p { opacity: 0.85; font-size: 16px; max-width: 500px; margin: 0 auto; }

.content-section { background: #fff; padding: 56px 24px; max-width: 1100px; margin: 0 auto; }

/* Info card */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-top: 32px; }
.info-card {
  background: #f8fafc; border: 1px solid #e2eaf0;
  border-radius: 16px; padding: 24px; display: flex; gap: 16px;
}
.info-card .info-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #dbeafe, #93c5fd);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.info-card h4 { font-size: 14px; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.info-card p { font-size: 14px; color: var(--muted); line-height: 1.5; }

/* Projects table */
.proj-table-wrap { overflow-x: auto; margin-top: 24px; }
.proj-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.proj-table th { background: var(--dark); color: #fff; padding: 12px 16px; text-align: left; }
.proj-table td { padding: 10px 16px; border-bottom: 1px solid #e8edf2; }
.proj-table tr:hover { background: #f0f6ff; }
.proj-num { color: var(--accent); font-weight: 700; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; margin-top: 32px; }
.contact-info { display: flex; flex-direction: column; gap: 20px; }
.contact-item { display: flex; align-items: flex-start; gap: 16px; }
.contact-item .ci-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--sky-mid), var(--sky-top));
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px;
}
.contact-item h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
.contact-item p { font-size: 15px; color: var(--dark); font-weight: 500; }
.contact-form { background: #f8fafc; border: 1px solid #e2eaf0; border-radius: 16px; padding: 28px; }
.contact-form h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 14px; border: 1px solid #d1d9e0; border-radius: 8px;
  font-size: 14px; background: #fff; color: var(--text);
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--sky-mid); }
.form-group textarea { resize: vertical; min-height: 100px; }
.btn-submit {
  width: 100%; padding: 12px; background: linear-gradient(135deg, var(--sky-mid), var(--sky-top));
  color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s;
}
.btn-submit:hover { opacity: 0.9; }

/* ============ FOOTER ============ */
#footer {
  background: var(--dark); color: rgba(255,255,255,0.7);
  padding: 48px 24px 24px;
}
.footer-grid {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
  padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand h3 { color: #fff; font-size: 20px; font-weight: 900; margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.7; margin-bottom: 16px; }
.footer-brand .contact-links a {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.7); text-decoration: none;
  font-size: 13px; margin-bottom: 8px;
}
.footer-brand .contact-links a:hover { color: var(--accent); }
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { color: rgba(255,255,255,0.65); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1200px; margin: 20px auto 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; flex-wrap: wrap; gap: 8px;
}
.footer-bottom a { color: rgba(255,255,255,0.5); text-decoration: none; }

/* ============ UTILITIES ============ */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.tag {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-orange { background: #ffedd5; color: #c2410c; }

/* Tooltip */
.tip { position: relative; cursor: help; }
.tip:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1a2535; color: #fff; font-size: 12px; padding: 4px 10px;
  border-radius: 6px; white-space: nowrap; z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .ai-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .forecast-summary { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .nav-menu { display: none; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--wx-nav-scrolled); padding: 12px 0; }
  .nav-menu.open { display: flex; }
  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 28px; }
  #station-map { height: 320px; }
}

/* ============================================================
   WEATHER THEME SYSTEM
   Màu sắc toàn trang thay đổi theo trạng thái thời tiết
   ============================================================ */

/* Biến theme bổ sung */
:root {
  --wx-body-bg: #f0f4f8;
  --wx-nav-scrolled: rgba(11,61,140,0.97);
}

/* Body background animate theo weather */
body {
  background: var(--wx-body-bg);
  transition: background 2s ease;
}

/* Navbar scrolled dùng biến theme */
#navbar.scrolled { background: var(--wx-nav-scrolled); }

/* Page hero tự đổi màu vì đã dùng var(--sky-top/mid) */

/* ---- Trạng thái: Nắng đẹp ---- */
body.wx-sunny {
  --sky-top: #0b3d8c; --sky-mid: #1a6fc4; --accent: #f59e0b;
  --wx-nav-scrolled: rgba(11,61,140,0.97); --wx-body-bg: #f0f4f8;
}

/* ---- Trạng thái: Nắng nóng (buổi trưa / bức xạ cao) ---- */
body.wx-hot {
  --sky-top: #7c2d12; --sky-mid: #c2410c; --accent: #ff6b35;
  --wx-nav-scrolled: rgba(124,45,18,0.97); --wx-body-bg: #fff7ed;
}

/* ---- Trạng thái: Nhiều mây ---- */
body.wx-cloudy {
  --sky-top: #334155; --sky-mid: #64748b; --accent: #94a3b8;
  --wx-nav-scrolled: rgba(51,65,85,0.97); --wx-body-bg: #f1f5f9;
}

/* ---- Trạng thái: Mưa ---- */
body.wx-rainy {
  --sky-top: #1e3a8a; --sky-mid: #1d4ed8; --accent: #60a5fa;
  --wx-nav-scrolled: rgba(30,58,138,0.97); --wx-body-bg: #eff6ff;
}

/* ---- Trạng thái: Giông bão ---- */
body.wx-storm {
  --sky-top: #111827; --sky-mid: #374151; --accent: #a78bfa;
  --wx-nav-scrolled: rgba(17,24,39,0.97); --wx-body-bg: #f1f5f9;
}

/* ---- Trạng thái: Ban đêm ---- */
body.wx-night {
  --sky-top: #020617; --sky-mid: #0f172a; --accent: #818cf8;
  --wx-nav-scrolled: rgba(2,6,23,0.97); --wx-body-bg: #111827;
}

/* ============================================================
   OVERLAY PARTICLE ANIMATIONS
   ============================================================ */

#wx-global-overlay {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 8999;
  overflow: hidden;
}

/* Hạt mưa */
.wx-rain-p {
  position: absolute; width: 1.5px; top: -20px;
  background: linear-gradient(to bottom, transparent, rgba(147,210,255,0.55));
  border-radius: 1px;
  animation: wx-rain-fall linear infinite;
}
@keyframes wx-rain-fall {
  0%   { opacity: 0;   transform: translateY(0)     rotate(8deg); }
  12%  { opacity: 0.85; }
  100% { opacity: 0;   transform: translateY(105vh)  rotate(8deg); }
}

/* Sao đêm */
.wx-star-p {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.95);
  animation: wx-star-twinkle ease-in-out infinite;
}
@keyframes wx-star-twinkle {
  0%,100% { opacity: 0.06; transform: scale(1); }
  50%     { opacity: 0.85;  transform: scale(1.4); }
}

/* Vệt gió */
.wx-wind-p {
  position: absolute; height: 1px; top: 0; left: -200px;
  background: linear-gradient(90deg, transparent, rgba(200,235,255,0.55), transparent);
  border-radius: 1px;
  animation: wx-wind-blow linear infinite;
}
@keyframes wx-wind-blow {
  0%   { opacity: 0; left: -200px; }
  18%  { opacity: 0.7; }
  80%  { opacity: 0.4; }
  100% { opacity: 0; left: calc(100vw + 200px); }
}

/* Chớp sét (storm) */
.wx-lightning-p {
  position: fixed; inset: 0;
  background: rgba(230,240,255,0.12);
  pointer-events: none;
  animation: wx-lightning steps(1) infinite;
}
@keyframes wx-lightning {
  0%,91%,93%,100% { opacity: 0; }
  92%             { opacity: 1; }
}

/* ============================================================
   WEATHER BADGE (góc dưới phải)
   ============================================================ */

#wx-badge {
  position: fixed; bottom: 18px; right: 18px;
  background: rgba(0,0,0,0.38);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff; font-size: 11px; font-weight: 600;
  padding: 5px 13px; border-radius: 20px;
  z-index: 9002; pointer-events: none;
  letter-spacing: 0.4px;
  opacity: 0;
  transition: opacity 1s ease, background 1.5s ease;
}
#wx-badge.visible { opacity: 1; }
