/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #0066cc;
    --primary-dark: #004999;
    --accent: #ff6b35;
    --bg: #f0f4f8;
    --white: #ffffff;
    --text: #1a1a2e;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --max-w: 1200px;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== COOKIE BANNER ===== */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--text); color: #fff;
    z-index: 9999; padding: 16px 20px;
    display: none;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
.cookie-banner.show { display: block; }
.cookie-content { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cookie-content p { font-size: 14px; flex: 1; min-width: 200px; }
.cookie-content a { color: #7cb3ff; }
.cookie-buttons { display: flex; gap: 8px; }
.btn-accept { background: var(--primary); color: #fff; border: none; padding: 8px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn-accept:hover { background: var(--primary-dark); }
.btn-decline { background: transparent; color: #fff; border: 1px solid #666; padding: 8px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.btn-decline:hover { border-color: #999; }

/* ===== HEADER ===== */
.main-header {
    background: var(--white);
    border-bottom: 3px solid var(--primary);
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex; align-items: center; gap: 24px;
    padding: 12px 20px; min-height: 64px;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 22px; flex-shrink: 0; }
.logo-icon { font-size: 28px; }
.logo-dot { color: var(--primary); }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a {
    padding: 8px 14px; border-radius: 6px; font-size: 14px; font-weight: 500;
    color: var(--text); transition: background 0.2s;
}
.main-nav a:hover, .main-nav a.active { background: #e8f0fe; color: var(--primary); text-decoration: none; }
.header-search { display: flex; gap: 4px; flex-shrink: 0; }
.header-search input { border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; font-size: 14px; width: 180px; outline: none; }
.header-search input:focus { border-color: var(--primary); }
.search-btn { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 8px 12px; cursor: pointer; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 24px; cursor: pointer; padding: 8px; }

/* ===== AD SPACES ===== */
.ad-container { text-align: center; padding: 12px 0; }
.ad-placeholder {
    background: #e8ecf1; color: #94a3b8; font-size: 12px;
    max-width: 728px; height: 90px; margin: 0 auto;
    display: flex; align-items: center; justify-content: center; border-radius: 4px;
}
.ad-top .ad-placeholder { height: 90px; max-width: 728px; }
.ad-mid .ad-placeholder, .ad-mid2 .ad-placeholder { height: 250px; max-width: 300px; }
.ad-bottom .ad-placeholder { height: 90px; max-width: 728px; }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #0066cc 0%, #0099ff 50%, #00b4d8 100%);
    color: #fff; padding: 48px 0; text-align: center;
}
.hero h1 { font-size: 32px; margin-bottom: 8px; }
.hero p { font-size: 18px; opacity: 0.9; margin-bottom: 24px; }
.hero-search { display: flex; max-width: 500px; margin: 0 auto; gap: 8px; }
.hero-search input {
    flex: 1; padding: 14px 20px; border: none; border-radius: 8px;
    font-size: 16px; outline: none;
}
.btn-primary {
    background: var(--accent); color: #fff; border: none;
    padding: 14px 28px; border-radius: 8px; font-size: 16px;
    font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: background 0.2s;
}
.btn-primary:hover { background: #e55a25; }

/* ===== CURRENT WEATHER ===== */
.current-weather { padding: 32px 0; }
.weather-main-card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 32px; overflow: hidden;
}
.weather-main-top { display: flex; align-items: center; gap: 32px; margin-bottom: 28px; flex-wrap: wrap; }
.weather-location h2 { font-size: 28px; }
.weather-date { color: var(--text-light); font-size: 14px; margin-top: 4px; }
.weather-temp-main { display: flex; align-items: flex-start; }
.temp-value { font-size: 72px; font-weight: 700; line-height: 1; }
.temp-unit { font-size: 28px; color: var(--text-light); margin-top: 8px; }
.weather-icon-main { text-align: center; }
.weather-emoji { font-size: 64px; display: block; }
#currentCondition { color: var(--text-light); margin-top: 4px; font-size: 16px; }

.weather-details-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px; padding-top: 24px; border-top: 1px solid var(--border);
}
.detail-item { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: #f8fafc; border-radius: var(--radius-sm); }
.detail-icon { font-size: 20px; }
.detail-label { font-size: 12px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-value { font-size: 18px; font-weight: 600; }

/* ===== HOURLY ===== */
.hourly-forecast { padding: 32px 0; }
.section-title { font-size: 22px; margin-bottom: 20px; }
.hourly-scroll {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
    -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory;
}
.hourly-item {
    flex: 0 0 80px; text-align: center; padding: 16px 8px;
    background: var(--white); border-radius: var(--radius-sm);
    box-shadow: var(--shadow); scroll-snap-align: start;
}
.hourly-time { font-size: 13px; color: var(--text-light); font-weight: 500; }
.hourly-icon { font-size: 28px; margin: 8px 0; }
.hourly-temp { font-size: 16px; font-weight: 600; }

/* ===== WEEKLY ===== */
.weekly-forecast { padding: 32px 0; }
.weekly-grid { display: flex; flex-direction: column; gap: 8px; }
.weekly-item {
    display: grid; grid-template-columns: 120px 40px 1fr 80px 80px;
    align-items: center; gap: 16px; padding: 14px 20px;
    background: var(--white); border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}
.weekly-day { font-weight: 600; }
.weekly-icon { font-size: 24px; text-align: center; }
.weekly-bar { height: 8px; background: #e2e8f0; border-radius: 4px; position: relative; overflow: hidden; }
.weekly-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #0066cc, #ff6b35); }
.weekly-low { font-size: 14px; color: var(--text-light); text-align: right; }
.weekly-high { font-size: 16px; font-weight: 600; text-align: right; }

/* ===== POPULAR CITIES ===== */
.popular-cities { padding: 32px 0; }
.cities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.city-card {
    background: var(--white); padding: 20px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow); text-align: center; cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.city-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.city-card h3 { font-size: 15px; margin-bottom: 8px; }
.city-temp { font-size: 28px; font-weight: 700; display: block; }
.city-icon { font-size: 28px; margin-top: 4px; display: block; }

/* ===== WEATHER TIPS ===== */
.weather-tips { padding: 32px 0; }
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.tip-card {
    background: var(--white); padding: 24px; border-radius: var(--radius);
    box-shadow: var(--shadow); transition: transform 0.2s;
    display: block; color: var(--text);
}
.tip-card:hover { transform: translateY(-2px); text-decoration: none; }
.tip-image { font-size: 48px; margin-bottom: 12px; }
.tip-card h3 { font-size: 16px; margin-bottom: 8px; }
.tip-card p { font-size: 14px; color: var(--text-light); }

/* ===== FOOTER ===== */
.main-footer {
    background: #1a1a2e; color: #cbd5e1; margin-top: 48px; padding: 48px 0 24px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-col h4 { color: #fff; margin-bottom: 16px; font-size: 16px; }
.footer-col p { font-size: 14px; line-height: 1.6; }
.footer-col a { display: block; color: #94a3b8; font-size: 14px; padding: 4px 0; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid #2d3748; padding-top: 20px; text-align: center; font-size: 13px; }

/* ===== CONTENT PAGES ===== */
.page-header {
    background: linear-gradient(135deg, #0066cc, #0099ff);
    color: #fff; padding: 40px 0; text-align: center;
}
.page-header h1 { font-size: 28px; margin-bottom: 8px; }
.page-header p { opacity: 0.9; }

.content-section { padding: 32px 0; }
.content-card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 32px; margin-bottom: 24px;
}
.content-card h2 { margin-bottom: 16px; font-size: 20px; }
.content-card p { color: var(--text-light); margin-bottom: 12px; }
.content-card ul { padding-left: 20px; color: var(--text-light); }
.content-card ul li { margin-bottom: 8px; }

/* Radar placeholder */
.radar-placeholder {
    background: #1a1a2e; border-radius: var(--radius);
    height: 400px; display: flex; align-items: center; justify-content: center;
    color: #64748b; font-size: 18px; margin-bottom: 24px;
    position: relative; overflow: hidden;
}
.radar-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(100,116,139,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100,116,139,0.1) 1px, transparent 1px);
    background-size: 40px 40px;
}
.radar-center { position: relative; z-index: 1; text-align: center; }

/* Warning cards */
.warning-card {
    border-left: 4px solid #ef4444; padding: 20px 24px;
    background: #fef2f2; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 16px;
}
.warning-card.warn-orange { border-color: #f97316; background: #fff7ed; }
.warning-card.warn-yellow { border-color: #eab308; background: #fefce8; }
.warning-card h3 { font-size: 16px; margin-bottom: 6px; }
.warning-card p { font-size: 14px; color: var(--text-light); }

/* News cards */
.news-card {
    display: grid; grid-template-columns: 200px 1fr; gap: 20px;
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px;
    transition: transform 0.2s;
}
.news-card:hover { transform: translateY(-2px); }
.news-image {
    background: linear-gradient(135deg, #0066cc, #00b4d8);
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; min-height: 160px;
}
.news-content { padding: 20px; }
.news-content h3 { margin-bottom: 8px; font-size: 17px; }
.news-content p { color: var(--text-light); font-size: 14px; margin-bottom: 8px; }
.news-date { font-size: 12px; color: #94a3b8; }

/* Legal pages */
.legal-content h2 { margin-top: 24px; margin-bottom: 12px; }
.legal-content p, .legal-content ul { margin-bottom: 12px; color: var(--text-light); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; gap: 12px; }
    .mobile-menu-btn { display: block; order: 2; margin-left: auto; }
    .main-nav {
        display: none; order: 3; width: 100%; flex-direction: column; gap: 0;
        background: var(--white); border-top: 1px solid var(--border);
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 12px 16px; border-radius: 0; border-bottom: 1px solid var(--border); }
    .header-search { order: 4; width: 100%; }
    .header-search input { width: 100%; }

    .hero { padding: 32px 0; }
    .hero h1 { font-size: 24px; }
    .hero p { font-size: 15px; }
    .hero-search { flex-direction: column; }

    .weather-main-top { gap: 16px; }
    .temp-value { font-size: 56px; }
    .weather-emoji { font-size: 48px; }
    .weather-details-grid { grid-template-columns: repeat(2, 1fr); }

    .weekly-item { grid-template-columns: 80px 30px 1fr 60px 60px; gap: 8px; padding: 12px; font-size: 14px; }

    .cities-grid { grid-template-columns: repeat(2, 1fr); }

    .news-card { grid-template-columns: 1fr; }
    .news-image { min-height: 120px; }

    .ad-mid .ad-placeholder, .ad-mid2 .ad-placeholder { height: 100px; max-width: 100%; }

    .cookie-content { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .weather-details-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .cities-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr; }
}
