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

body {
    font-family: Inter, system-ui, Arial, sans-serif;
    background: radial-gradient(circle at top left, #f8fafc 0%, #e2e8f0 45%, #cbd5e1 100%);
    color: #0f172a;
    min-height: 100vh;
}

#home {
    background: linear-gradient(135deg, #ffffff 0%, #dbeafe 45%, #bfdbfe 100%);
    border-radius: 28px;
    padding: 28px;
    color: #0f172a;
    box-shadow: 0 28px 80px rgba(148, 163, 184, 0.18);
}

#home .page-header p {
    color: rgba(255, 255, 255, 0.86);
}

.home-hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.hero-card,
.hero-summary {
    background: rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(99, 102, 241, 0.32);
    border-radius: 28px;
    padding: 24px;
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.hero-label {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
}

.hero-location,
.hero-condition,
.hero-range,
.hero-chip,
.hero-info-item span,
.summary-status span,
.summary-list li {
    color: rgba(255, 255, 255, 0.82);
}

.hero-chip {
    background: rgba(255, 255, 255, 0.18);
    color: white;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
}

.hero-main {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 22px;
}

.hero-icon {
    font-size: 3.6rem;
}

.hero-condition {
    font-size: 1rem;
    margin-bottom: 8px;
}

.hero-temp {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.hero-range {
    font-size: 0.95rem;
}

.hero-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.hero-info-item {
    background: rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(99, 102, 241, 0.24);
    border-radius: 18px;
    padding: 16px;
}

.hero-info-item strong,
.summary-status strong {
    display: block;
    margin-top: 8px;
    font-size: 1.15rem;
    color: white;
}

.summary-list {
    list-style: none;
    padding-left: 0;
    margin: 0 0 20px 0;
    display: grid;
    gap: 12px;
}

.summary-list li {
    line-height: 1.6;
}

.summary-status {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(15, 23, 42, 0.26);
    border: 1px solid rgba(99, 102, 241, 0.24);
    padding: 20px;
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.stat-card span {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.stat-card strong {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.stat-card p {
    color: rgba(255, 255, 255, 0.75);
}

.home-weather-cities {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.city-card {
    background: rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(99, 102, 241, 0.26);
    color: white;
}

.city-card h4 {
    margin-bottom: 12px;
}

.city-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.city-small {
    color: rgba(255, 255, 255, 0.78);
    margin-top: 10px;
}

#home .card h3,
#home .card .text {
    color: white;
}

#home .card .icon {
    color: #fef3c7;
}

.navbar {
    background: #2563eb;
    color: #ffffff;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(148, 163, 184, 0.25);
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
}

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

.brand-icon {
    font-size: 1.8rem;
}

.brand h1 {
    font-size: 1.3rem;
}

.brand p {
    font-size: 0.9rem;
    opacity: 0.92;
}

.nav-menu {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-link {
    color: #f8fafc;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.95rem;
    transition: background 150ms ease, color 150ms ease;
}

.nav-link.active,
.nav-link:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #0f172a;
}


.page-container {
    max-width: 1200px;
    margin: 30px auto 0;
    padding: 0 20px 40px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.page-header p {
    color: #475569;
}

.grid {
    display: grid;
    gap: 18px;
}

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

.card,
.alert-card,
.map-box,
.history-item {
    background: #ffffff;
    padding: 18px;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.summary-card,
.news-card {
    background: #f8fafc;
    padding: 18px;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(203, 213, 225, 0.38);
}

#home .card,
#home .city-card,
#home .stat-card,
#home .hero-card,
#home .hero-summary,
#home .hero-info-item {
    background: rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(99, 102, 241, 0.32);
}

#home .city-card {
    border: 1px solid rgba(99, 102, 241, 0.26);
}

#home .stat-card {
    border: 1px solid rgba(99, 102, 241, 0.24);
}

#home .hero-info-item {
    background: rgba(15, 23, 42, 0.22);
}

.card h3,
.news-card h3,
.alert-card h3,
.summary-card h3 {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.icon {
    font-size: 2rem;
    margin: 10px 0;
}

.text,
.news-card p,
.summary-card p,
.alert-card p,
.history-item p,
.map-box p {
    color: #334155;
    line-height: 1.6;
}

.news-card h3,
.summary-card h3 {
    color: #0f172a;
}

.news-date {
    margin-bottom: 12px;
    color: #6b7280;
    font-size: 0.9rem;
}

.news-date {
    margin-bottom: 12px;
    color: #6b7280;
    font-size: 0.9rem;
}

.news-summary {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.forecast-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.forecast-panel {
    display: grid;
    gap: 28px;
}

.forecast-group {
    display: grid;
    gap: 16px;
    background: rgba(255, 255, 255, 0.98);
    padding: 18px;
    border-radius: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.16);
}

.forecast-group h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #1d4ed8;
}

.forecast-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}

.forecast-scroll::-webkit-scrollbar {
    height: 8px;
}

.forecast-scroll::-webkit-scrollbar-thumb {
    background: rgba(67, 56, 202, 0.4);
    border-radius: 999px;
}

.forecast-day {
    min-width: 180px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.3);
    padding: 18px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    scroll-snap-align: start;
}

.forecast-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    color: #475569;
    font-size: 0.95rem;
}

.forecast-icon {
    font-size: 2.4rem;
    margin-bottom: 10px;
}

.forecast-day h4 {
    margin-bottom: 10px;
    font-size: 1.05rem;
    color: #1f2937;
}

.forecast-temp {
    font-weight: 700;
    margin-bottom: 8px;
    color: #1d4ed8;
}

.forecast-note {
    color: #475569;
    line-height: 1.6;
}

.warning-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.alert-card.high {
    border-left: 5px solid #dc2626;
}

.alert-card.medium {
    border-left: 5px solid #f59e0b;
}

.alert-card.low {
    border-left: 5px solid #16a34a;
}

.map-box {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    text-align: center;
}

.map-display {
    position: relative;
    width: 100%;
    max-width: 860px;
    min-height: 280px;
    margin: 0 auto;
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 24px 60px rgba(148, 163, 184, 0.24);
    border: 1px solid rgba(203, 213, 225, 0.72);
}

.map-region {
    position: absolute;
    border-radius: 24px;
    padding: 20px 18px;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: 0 10px 30px rgba(148, 163, 184, 0.16);
}

.map-region.rain {
    top: 14%;
    left: 12%;
    width: 30%;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.map-region.cloud {
    top: 22%;
    right: 12%;
    width: 32%;
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.map-region.sun {
    bottom: 18%;
    left: 20%;
    width: 40%;
    background: rgba(250, 204, 21, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #0f172a;
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.55);
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.map-legend .legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
}

.map-legend .rain-dot { background: #3b82f6; }
.map-legend .sun-dot { background: #facc15; }
.map-legend .cloud-dot { background: #64748b; }

.map-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.raindrop {
    position: absolute;
    width: 2px;
    height: 18px;
    background: rgba(255,255,255,0.85);
    opacity: 0.9;
    filter: blur(0.4px);
    animation: rain-fall linear infinite;
}

.raindrop::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
}

@keyframes rain-fall {
    0% { transform: translateY(-30px) scaleY(0.6); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(320px) scaleY(1.1); opacity: 0; }
}

.history-list {
    grid-template-columns: 1fr;
}

.history-item {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.history-item span {
    font-weight: 700;
    color: #4338ca;
}

footer {
    text-align: center;
    padding: 24px 20px 40px;
    color: #dbeafe;
    background-color: #2563eb;
}

@media (max-width: 800px) {
    .nav-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

.page-static {
    display: block;
    opacity: 1;
}

/* --- PHẦN CSS MỚI CHO BẢN ĐỒ API LEAFLET --- */
#weather-map {
    width: 100%;
    height: 500px; /* Tăng độ cao để dễ quan sát biển đảo rộng lớn */
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
    z-index: 1; /* Đảm bảo không bị đè lên thanh navbar */
}

/* Định dạng các điểm ghim (Marker Emojis) thời tiết */
.custom-marker-wrapper {
    background: none;
    border: none;
}

.map-marker-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    border: 2px solid white;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.map-marker-icon:hover {
    transform: scale(1.15);
}

/* Màu sắc vòng bo ngoài của từng loại thời tiết trên map */
.marker-rain { background: #3b82f6; }
.marker-cloud { background: #64748b; }
.marker-sun { background: #eab308; }

/* Tùy chỉnh nhẹ giao diện ô popup chữ của Leaflet cho đồng bộ ứng dụng */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    font-family: inherit;
    color: var(--text-main);
    box-shadow: var(--shadow);
}
.leaflet-popup-content b {
    color: var(--primary-dark);
}
/* --- CSS cho trang đăng nhập --- */
.login-container {
    background: rgba(15, 23, 42, 0.85);
    padding: 40px 32px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    color: white;
    max-width: 400px;
    width: 100%;
    margin: 80px auto; /* căn giữa trang */
}

.login-container h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.8rem;
    color: #f8fafc;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-container label {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: rgba(255,255,255,0.85);
}

.login-container input {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.05);
    color: white;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.login-container input:focus {
    border-color: #3b82f6;
    background: rgba(255,255,255,0.1);
    outline: none;
}

.login-container button {
    padding: 14px;
    border-radius: 12px;
    border: none;
    background-color: #2563eb;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.login-container button:hover {
    background-color: #1e40af;
    transform: translateY(-2px);
}

.login-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
}

.login-footer a {
    color: #3b82f6;
    text-decoration: none;
}

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

@media (max-width: 480px) {
    .login-container {
        padding: 32px 24px;
        margin: 40px 20px;
    }
}