/* ============================================================
   SYRIA DASHBOARD — Exact mofaex.gov.sy Design System
   Colors, spacing, shadows extracted from actual CSS
   ============================================================ */

:root {
    /* mofaex exact colors */
    --teal: #054239;
    --teal-80: #05423980;
    --teal-hover: #0b6456;
    --teal-light: #daf2e6;
    --teal-extra-light: #b6d9c7;
    --teal-bg: #daf2e6e6;
    --gold: #D2B64F;
    --gold-light: #988561;
    --red: #f05100;
    --orange: #dd7400;
    --green: #00c758;
    --blue: #104e64;
    --bg: #F2F2F2;
    --bg-light: #F8F8F8;
    --white: #FFFFFF;
    --gray-25: #F9FAFB;
    --gray-50: #F3F4F6;
    --gray-75: #E2E2E2;
    --gray-100: #d1d5dc;
    --text: #1d1f1f;
    --text-80: #1d1f1f80;
    --text2: #4a5565;
    --text3: #6a7282;
    --text4: #99a1af;
    --border: #E2E2E2;
    --shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-hover: 0 2px 8px 0 rgba(0,0,0,0.08);
    --radius: 10px; /* rounded-primary */
    --container: 1281px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; direction: rtl; scroll-behavior: smooth; }

body {
    font-family: 'Qomra', 'Poppins', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

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

/* ============ HEADER ============ */
.header {
    background: var(--white);
    background-repeat: repeat-x;
    background-size: auto;
    background-position: center;
    position: sticky;
    top: 0;
    z-index: 60;
    width: 100%;
    transition: all 0.2s linear;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 87px;
}

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

.header-logo {
    max-width: 275px;
    height: 70px;
    width: auto;
    transition: all 0.2s linear;
}

.header-title {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
}

.header-subtitle {
    font-size: 0.75rem;
    color: var(--text3);
    font-weight: 400;
}

.header-actions { display: flex; align-items: center; gap: 12px; }

.header-wiki-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--teal);
    color: white;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid transparent;
    box-shadow: var(--shadow);
    transition: all 0.3s linear;
    white-space: nowrap;
}

.header-wiki-btn:hover { background: var(--teal-hover); }

.header-social {
    display: flex;
    gap: 6px;
}

.social-icon {
    width: 32px;
    height: 32px;
    border: 1px solid var(--teal);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s linear;
    color: var(--teal);
    text-decoration: none;
}

.social-icon:hover { background: var(--teal); color: white; }
.social-icon svg { width: 16px; height: 16px; fill: currentColor; }

/* ============ NAVBAR ============ */
.navbar {
    background: var(--teal);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 0;
    gap: 0;
    color: white;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-inline-end: 14px;
    padding-inline-start: 14px;
    border-inline-end: 1px solid rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.2s;
    position: relative;
}

.nav-link:last-of-type { border-inline-end: none; }

.nav-link svg { width: 18px; height: 18px; fill: white; opacity: 0.7; }

.nav-link:hover { opacity: 0.85; }

.nav-link.active {
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    right: 0;
    left: 0;
    height: 2px;
    background: white;
}

/* ============ TOPBAR ============ */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text3);
    height: auto;
    padding: 6px 0;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-links { display: flex; align-items: center; gap: 8px; }
.topbar-links a { color: var(--teal); text-decoration: none; font-weight: 500; transition: opacity 0.2s; }
.topbar-links a:hover { opacity: 0.7; }
.topbar-sep { color: var(--gray-75); font-size: 0.6rem; }

.topbar-live { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; }

.live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.live-dot.error { background: var(--red); box-shadow: 0 0 6px var(--red); animation: none; }

/* ============ MAIN ============ */
.main { padding: 28px 0 0; min-height: 60vh; }
.page { display: none; }
.page.active { display: block; animation: fadeUp 0.3s ease; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ HERO BANNER ============ */
.hero-banner {
    background: var(--teal-light);
    border-radius: var(--radius);
    padding: 40px 36px;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    color: var(--text);
}

.hero-content { position: relative; z-index: 1; max-width: 560px; }

.hero-badge {
    display: inline-block;
    background: var(--teal);
    color: white;
    padding: 4px 14px;
    border-radius: var(--radius);
    font-size: 0.72rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 1.65rem;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--teal);
}

.hero-desc { font-size: 0.88rem; color: var(--text2); line-height: 1.7; font-weight: 400; }

.hero-decoration { position: absolute; left: 40px; top: 50%; transform: translateY(-50%); }
.hero-star { width: 200px; height: 200px; color: var(--teal); opacity: 0.05; }

/* ============ SECTION TITLE ============ */
.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    margin-top: 8px;
}

.section-title.first { margin-top: 0; }

.section-line {
    width: 3px;
    height: 22px;
    background: var(--teal);
    border-radius: 2px;
    flex-shrink: 0;
}

.section-title h2 {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text);
}

/* ============ KPI CARDS ============ */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s linear;
}

.kpi-card:hover { box-shadow: var(--shadow-hover); }

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--teal-light);
    color: var(--teal);
}

.kpi-icon svg { width: 20px; height: 20px; }

.kpi-icon.red { background: #fef2f0; color: var(--red); }
.kpi-icon.orange { background: #fef6ee; color: var(--orange); }
.kpi-icon.green { background: var(--teal-light); color: var(--teal); }
.kpi-icon.teal { background: var(--teal-light); color: var(--teal); }
.kpi-icon.blue { background: #edf5fc; color: var(--blue); }
.kpi-icon.purple { background: #f5eef8; color: #7D3C98; }

.kpi-body { display: flex; flex-direction: column; min-width: 0; }
.kpi-label { font-size: 0.72rem; color: var(--text3); font-weight: 400; }
.kpi-value { font-size: 1.35rem; font-weight: 500; color: var(--text); line-height: 1.2; margin-top: 2px; }
.kpi-sub { font-size: 0.68rem; color: var(--text4); margin-top: 2px; }

/* ============ INFO CHIPS ============ */
.info-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.78rem;
    color: var(--text2);
    font-weight: 400;
    box-shadow: var(--shadow);
}

.chip-icon { font-size: 0.9rem; }

/* ============ CARDS ============ */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s linear;
}

.card:hover { box-shadow: var(--shadow-hover); }

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-50);
}

.card-head h3 { font-size: 0.88rem; font-weight: 500; color: var(--text); }

.badge {
    padding: 2px 10px;
    border-radius: var(--radius);
    font-size: 0.68rem;
    font-weight: 500;
    background: var(--teal-light);
    color: var(--teal);
}

.chart-wide { height: 240px; }
.chart-wide canvas { width: 100% !important; height: 100% !important; }
.mb { margin-bottom: 12px; }

/* ============ GRIDS ============ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

/* ============ WEATHER SUMMARY BANNER ============ */
.weather-summary-banner {
    background: linear-gradient(135deg, var(--teal), #0b6456 60%, #104e64);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    color: white;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.weather-summary-banner::after {
    content: '';
    position: absolute;
    top: -50%; left: -20%;
    width: 60%; height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.04) 0%, transparent 70%);
    pointer-events: none;
}

.wsb-loading { font-size: 0.82rem; opacity: 0.6; }

.wsb-icon { flex-shrink: 0; }
.wsb-icon svg { display: block; filter: brightness(1.5) drop-shadow(0 1px 4px rgba(0,0,0,0.15)); }

.wsb-content { flex: 1; position: relative; z-index: 1; }
.wsb-title { font-size: 0.95rem; font-weight: 500; line-height: 1.5; }
.wsb-details { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; font-size: 0.75rem; opacity: 0.8; }
.wsb-detail { display: flex; align-items: center; gap: 4px; }

.wsb-temps { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; text-align: center; }
.wsb-temp-now { font-size: 2.6rem; font-weight: 300; line-height: 1; }
.wsb-temp-hilo { font-size: 0.72rem; opacity: 0.7; margin-top: 4px; }

/* ============ WEATHER MAP ============ */
.map-card { padding: 0; overflow: hidden; position: relative; }
.weather-map { height: 380px; width: 100%; border-radius: var(--radius); z-index: 1; }

/* Map tabs */
.map-tabs { display: flex; gap: 4px; margin-right: auto; }
.map-tab {
    padding: 4px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text3);
    font-family: 'Qomra', sans-serif;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s;
}
.map-tab.active { background: var(--teal); color: white; border-color: var(--teal); }
.map-tab:hover:not(.active) { background: var(--gray-50); }

/* 3D Map */
.map-3d-card { background: #0a1628; }
.weather-map-3d { height: 500px; width: 100%; border-radius: var(--radius); cursor: grab; }
.weather-map-3d canvas { border-radius: var(--radius); }

.map3d-tooltip {
    display: none;
    position: absolute;
    z-index: 20;
    background: rgba(10, 22, 40, 0.95);
    border: 1px solid rgba(0, 255, 170, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    font-size: 13px;
    pointer-events: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    direction: rtl;
}

.tt3d-city { font-weight: 600; font-size: 14px; color: #00ffaa; margin-bottom: 2px; }
.tt3d-temp { font-size: 22px; font-weight: 300; }
.tt3d-desc { font-size: 11px; color: rgba(255,255,255,0.7); }
.tt3d-details { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 4px; }

.map3d-controls-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 22, 40, 0.8);
    color: rgba(255,255,255,0.5);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.65rem;
    pointer-events: none;
    z-index: 10;
}

.map-temp-marker {
    background: none;
    border: none;
}

.map-marker-inner {
    background: var(--teal);
    color: white;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Qomra', sans-serif;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid rgba(255,255,255,0.8);
}

.map-marker-inner:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(0,0,0,0.4);
}

.map-marker-inner.night {
    background: #1E293B;
}

.map-marker-inner.hot { background: #DC2626; }
.map-marker-inner.warm { background: #F59E0B; }
.map-marker-inner.cool { background: var(--teal); }
.map-marker-inner.cold { background: #3B82F6; }

.leaflet-popup-content-wrapper {
    border-radius: var(--radius) !important;
    font-family: 'Qomra', sans-serif !important;
    direction: rtl;
}

.leaflet-popup-content { margin: 10px 14px !important; font-size: 13px; }

.map-popup { text-align: center; }
.map-popup-city { font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--teal); }
.map-popup-temp { font-size: 22px; font-weight: 500; color: var(--text); }
.map-popup-desc { font-size: 11px; color: var(--text3); }
.map-popup-details { display: flex; justify-content: center; gap: 10px; margin-top: 6px; font-size: 11px; color: var(--text3); }

/* ============ LOADING SKELETONS ============ */
.hero-skeleton {
    display: flex; align-items: center; gap: 20px; padding: 10px;
}

.hero-skeleton::before {
    content: '';
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    animation: shimmer 1.5s infinite;
}

.hero-skeleton::after {
    content: '';
    flex: 1; height: 40px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    animation: shimmer 1.5s infinite 0.2s;
}

@keyframes shimmer {
    0% { opacity: 0.3; }
    50% { opacity: 0.6; }
    100% { opacity: 0.3; }
}

/* ============ CITY WEATHER CARDS ============ */
.cities-weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.city-weather-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.25s ease;
    cursor: pointer;
    position: relative;
}

.city-weather-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }

.city-weather-card.selected {
    border-color: var(--teal);
    background: linear-gradient(135deg, var(--teal-light), var(--white));
    box-shadow: 0 0 0 1px var(--teal), var(--shadow-hover);
}

.cwc-top-bar { height: 3px; border-radius: 2px 2px 0 0; margin: -12px -10px 8px; }
.cwc-name { font-size: 0.82rem; font-weight: 500; color: var(--text); }
.cwc-desc { font-size: 0.65rem; color: var(--text3); line-height: 1.2; margin: 2px 0; }

.cwc-middle { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0; }
.cwc-icon svg { display: block; }
.cwc-temp { font-size: 1.6rem; font-weight: 500; color: var(--teal); line-height: 1; }

.cwc-bottom { font-size: 0.68rem; color: var(--text3); display: flex; justify-content: center; gap: 10px; }

/* ============ WEATHER HERO ============ */
.weather-hero-card {
    background: linear-gradient(135deg, var(--teal), #0b6456);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 16px;
    color: white;
    min-height: 100px;
}

.hero-weather-main { display: flex; align-items: center; gap: 24px; }
.hero-weather-icon svg { display: block; filter: brightness(1.3) drop-shadow(0 2px 8px rgba(0,0,0,0.2)); }
.hero-weather-info { flex: 1; }
.hero-city-name { font-size: 0.85rem; font-weight: 400; opacity: 0.7; letter-spacing: 0.5px; }
.hero-temp-big { font-size: 3.5rem; font-weight: 300; line-height: 1; }
.hero-desc { font-size: 1.1rem; font-weight: 400; opacity: 0.9; margin-top: 2px; }
.hero-feels { font-size: 0.78rem; opacity: 0.7; margin-top: 4px; }
.hero-hilo { font-size: 0.82rem; opacity: 0.8; margin-top: 2px; }

.hero-extra-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    flex-shrink: 0;
    padding: 10px 16px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius);
    backdrop-filter: blur(4px);
}

.hero-extra-item { display: flex; flex-direction: column; }
.hei-label { font-size: 0.62rem; opacity: 0.5; }
.hei-val { font-size: 0.82rem; font-weight: 500; }

/* ============ HOURLY STRIP ============ */
.hourly-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.hourly-scroll::-webkit-scrollbar { height: 4px; }
.hourly-scroll::-webkit-scrollbar-thumb { background: var(--gray-100); border-radius: 2px; }

.hourly-strip {
    display: flex;
    gap: 0;
    min-width: max-content;
    padding: 4px 0;
}

.hourly-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 56px;
    padding: 8px 6px;
    border-left: 1px solid var(--gray-50);
}

.hourly-item:last-child { border-left: none; }

.hourly-item.hourly-now {
    background: var(--teal-light);
    border-radius: 8px;
    border-left-color: transparent;
}

.hourly-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 8px 4px;
    font-size: 0.62rem;
    color: var(--teal);
    font-weight: 600;
    border-left: 2px solid var(--teal);
    background: linear-gradient(to bottom, var(--teal-light), transparent);
}

.hourly-time { font-size: 0.68rem; color: var(--text3); }
.hourly-icon svg { display: block; }
.hourly-temp { font-size: 0.82rem; font-weight: 500; color: var(--text); }
.hourly-precip { font-size: 0.62rem; color: #3B82F6; font-weight: 500; }

/* ============ 7-DAY FORECAST ============ */
.forecast-7day { display: flex; flex-direction: column; }

.forecast-row {
    display: grid;
    grid-template-columns: 70px 36px 40px 36px 1fr 36px 60px 50px;
    align-items: center;
    gap: 8px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--gray-50);
    transition: background 0.15s;
}

.forecast-row:hover { background: var(--gray-25); }

.forecast-row:last-child { border-bottom: none; }

.fc-day { font-size: 0.82rem; font-weight: 500; color: var(--text); }
.fc-icon { display: flex; justify-content: center; }
.fc-icon svg { display: block; }
.fc-precip { font-size: 0.68rem; text-align: center; min-width: 32px; }
.fc-precip-val { color: #3B82F6; font-weight: 500; }
.fc-low { font-size: 0.78rem; color: var(--text3); text-align: left; }
.fc-high { font-size: 0.78rem; font-weight: 500; color: var(--text); text-align: right; }

.fc-bar { padding: 0 4px; }
.fc-bar-bg {
    height: 5px;
    background: var(--gray-75);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.fc-bar-fill {
    position: absolute;
    top: 0; bottom: 0;
    background: linear-gradient(to left, var(--red), var(--gold), var(--blue));
    border-radius: 3px;
}

/* ============ DETAIL CARDS ============ */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.detail-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    box-shadow: var(--shadow);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: box-shadow 0.3s;
}

.detail-card:hover { box-shadow: var(--shadow-hover); }

.detail-card-title { font-size: 0.72rem; color: var(--text3); font-weight: 400; margin-bottom: 4px; width: 100%; text-align: right; }
.detail-value { font-size: 1.1rem; font-weight: 500; color: var(--text); }
.detail-value small { font-size: 0.7rem; font-weight: 400; color: var(--text3); }
.detail-value-large { font-size: 1.8rem; font-weight: 500; color: var(--teal); line-height: 1; }
.detail-unit { font-size: 0.68rem; color: var(--text3); }
.detail-sub { font-size: 0.7rem; color: var(--text3); }
.detail-extra { font-size: 0.65rem; color: var(--text4); margin-top: 2px; }

.detail-gauge { margin: 4px 0; }

/* Wind compass */
.wind-compass { margin: 4px 0; }

/* UV Bar */
.uv-bar-container { width: 100%; padding: 0 4px; margin: 6px 0; }
.uv-bar { height: 6px; background: linear-gradient(to left, #7c3aed, #dc2626, #f97316, #eab308, #22c55e); border-radius: 3px; position: relative; }
.uv-bar-marker { position: absolute; top: -3px; width: 4px; height: 12px; background: var(--text); border-radius: 2px; transform: translateX(50%); }
.uv-labels { display: flex; justify-content: space-between; font-size: 0.58rem; color: var(--text4); margin-top: 2px; }

.detail-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius);
    font-size: 0.68rem;
    font-weight: 500;
    margin-top: 2px;
}

.uv-low { background: #dcfce7; color: #166534; }
.uv-moderate { background: #fef9c3; color: #854d0e; }
.uv-high { background: #ffedd5; color: #9a3412; }
.uv-very-high { background: #fef2f2; color: #991b1b; }
.uv-extreme { background: #f5f3ff; color: #5b21b6; }

/* AQI */
.aqi-circle {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 4px 0;
}

.aqi-num { font-size: 1.2rem; font-weight: 600; line-height: 1; }
.aqi-label { font-size: 0.55rem; opacity: 0.7; }

.aqi-good { background: #dcfce7; color: #166534; }
.aqi-fair { background: #d1fae5; color: #065f46; }
.aqi-moderate { background: #fef9c3; color: #854d0e; }
.aqi-poor { background: #ffedd5; color: #9a3412; }
.aqi-very-poor { background: #fef2f2; color: #991b1b; }
.aqi-hazardous { background: #fce7f3; color: #9d174d; }

.aqi-details { display: flex; gap: 8px; font-size: 0.62rem; color: var(--text3); flex-wrap: wrap; justify-content: center; }

.aqi-bars { width: 100%; margin-top: 6px; }
.aqi-bar-row { display: flex; align-items: center; gap: 4px; margin-bottom: 3px; }
.aqi-bar-label { font-size: 0.58rem; color: var(--text3); min-width: 32px; text-align: right; }
.aqi-bar-track { flex: 1; height: 4px; background: var(--gray-75); border-radius: 2px; overflow: hidden; }
.aqi-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.aqi-bar-val { font-size: 0.58rem; color: var(--text3); min-width: 24px; }

.fc-wind { font-size: 0.68rem; color: var(--text3); text-align: center; }
.fc-wind small { font-size: 0.58rem; }
.fc-uv { font-size: 0.62rem; color: var(--text4); text-align: center; }

/* Sun arc */
.sun-arc { margin: 4px 0; display: flex; justify-content: center; }
.sun-times { display: flex; justify-content: space-between; width: 100%; padding: 0 8px; }
.sun-time { font-size: 0.75rem; color: var(--text2); display: flex; align-items: center; gap: 3px; }
.sun-icon { font-size: 0.85rem; color: #F59E0B; }

/* ============ ASTRONOMY ============ */
.astro-grid {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 12px 20px;
    align-items: center;
}

.astro-moon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
}

.moon-icon { font-size: 3rem; line-height: 1; }
.moon-phase { font-size: 0.78rem; font-weight: 500; color: var(--text); }
.moon-illum { font-size: 0.68rem; color: var(--text3); }

.astro-col h4 { font-size: 0.78rem; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.astro-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 0.75rem; color: var(--text2); border-bottom: 1px solid var(--gray-50); }
.astro-row:last-child { border: none; }
.astro-val { font-weight: 500; color: var(--text); }

.chances-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chance-chip {
    display: flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    background: var(--gray-25);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--text2);
}
.chance-chip .cv { font-weight: 600; color: var(--teal); }
.chance-chip.high .cv { color: var(--red); }

/* ============ MARINE ============ */
.marine-card-body { text-align: center; padding: 10px 0; }
.wave-big { font-size: 2.2rem; font-weight: 300; color: var(--blue); line-height: 1; }
.wave-unit { font-size: 0.78rem; color: var(--text3); }
.marine-details { display: flex; justify-content: center; gap: 16px; margin-top: 10px; font-size: 0.75rem; color: var(--text2); }
.marine-detail { display: flex; flex-direction: column; align-items: center; }
.marine-detail .md-val { font-weight: 500; font-size: 0.88rem; color: var(--text); }
.marine-detail .md-label { font-size: 0.65rem; color: var(--text3); }
.wave-forecast { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.wf-day { text-align: center; font-size: 0.65rem; color: var(--text3); }
.wf-day .wf-val { font-size: 0.82rem; font-weight: 500; color: var(--blue); display: block; }

.astro-loading { text-align: center; padding: 20px; color: var(--text3); font-size: 0.82rem; }

/* ============ SELECT ============ */
.select-gov {
    font-family: 'Qomra', sans-serif;
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text);
    font-size: 0.8rem;
    cursor: pointer;
    direction: rtl;
    outline: none;
    transition: border-color 0.3s linear;
}

.select-gov:focus { border-color: var(--teal); }

/* ============ ECONOMY KPIs ============ */
.econ-kpi { border-right: 2px solid var(--teal); }
.econ-kpi .kpi-value { font-size: 1.2rem; }

.trend-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: var(--radius);
    font-size: 0.62rem;
    font-weight: 500;
    margin-top: 3px;
}

.trend-rising { background: var(--teal-light); color: var(--teal); }
.trend-falling { background: #fef2f0; color: var(--red); }
.trend-stable, .trend-fluctuating { background: #fef6ee; color: var(--orange); }

/* ============ FOOTER ============ */
.footer {
    background: var(--teal);
    color: rgba(255,255,255,0.7);
    padding: 36px 0 0;
    margin-top: 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-logo { width: 40px; height: 40px; margin-bottom: 10px; filter: brightness(0) invert(1); opacity: 0.8; }
.footer-desc { font-size: 0.76rem; line-height: 1.7; opacity: 0.6; font-weight: 300; }

.footer-col h4 {
    font-size: 0.82rem;
    font-weight: 500;
    color: white;
    margin-bottom: 10px;
}

.footer-col a, .footer-col span {
    display: block;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.76rem;
    padding: 2px 0;
    font-weight: 400;
    transition: opacity 0.2s;
}

.footer-col a:hover { color: white; opacity: 0.9; }

.footer-bottom {
    text-align: center;
    padding: 14px 0;
    font-size: 0.68rem;
    opacity: 0.4;
    font-weight: 300;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .header-inner { height: 70px; }
    .header-logo { height: 50px; }
}

@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .hero-banner { padding: 28px 24px; }
    .hero-title { font-size: 1.3rem; }
    .hero-star { display: none; }
    .footer-grid { grid-template-columns: 1fr; gap: 16px; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
    .cities-weather-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .forecast-row { grid-template-columns: 60px 32px 36px 32px 1fr 32px 50px 40px; gap: 6px; }
    .hero-extra-info { display: none; }
    .weather-map { height: 300px; }
    .weather-map-3d { height: 380px; }
    .wsb-temps { display: none; }
}

@media (max-width: 600px) {
    .container { padding-inline: 14px; }
    .kpi-row { grid-template-columns: 1fr; }
    .nav-link { padding-inline: 10px; font-size: 0.8rem; }
    .nav-link svg { display: none; }
    .hero-banner { padding: 20px 16px; }
    .hero-title { font-size: 1.1rem; }
    .header-logo { height: 40px; }
    .header-title { font-size: 1rem; }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
    .cities-weather-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
    .hero-weather-main { gap: 14px; }
    .hero-temp-big { font-size: 2.5rem; }
    .hero-weather-icon svg { width: 64px; height: 64px; }
    .forecast-row { grid-template-columns: 55px 28px 32px 28px 1fr 28px; gap: 4px; padding: 8px 2px; }
    .fc-day { font-size: 0.72rem; }
    .fc-wind, .fc-uv { display: none; }
    .weather-map { height: 260px; }
    .weather-map-3d { height: 320px; }
    .map3d-controls-hint { display: none; }
    .hero-extra-info { display: none; }
    .wsb-icon { display: none; }
    .wsb-temps { display: none; }
    .wsb-title { font-size: 0.82rem; }
}
