/* =============================================================
   Qatar Live Weather Map Stylesheet
   Accent: emerald green (#059669) to match wttr.in branding
   by mohammedlglg
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;600;700;800&display=swap');

:root {
    --accent:       #059669;
    --accent-light: #d1fae5;
    --accent-dark:  #065f46;
    --accent-mid:   #10b981;
}

body.ar { font-family: 'Noto Sans Arabic', sans-serif; }

/* ── Map ──────────────────────────────────────────────────── */
#map { height: 620px; width: 100%; border-radius: 0.5rem; }

/* ── Temp label on markers ───────────────────────────────── */
.temp-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-weight: 800;
    font-size: 11px;
    color: white !important;
    text-shadow: 0 0 3px rgba(0,0,0,0.85);
    pointer-events: none;
    display: flex; align-items: center; justify-content: center;
}

/* ── Loading overlay ─────────────────────────────────────── */
.loading-overlay {
    position: absolute; top:0; left:0; right:0; bottom:0;
    background: rgba(255,255,255,0.75);
    z-index: 1000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    font-weight: bold; color: var(--accent);
    gap: 10px;
}
.loading-progress {
    font-size: 12px;
    color: #64748b;
    font-weight: normal;
}
.loading-bar-track {
    width: 180px; height: 4px;
    background: #e2e8f0; border-radius: 2px; overflow: hidden;
}
.loading-bar-fill {
    height: 100%; background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ── Legend ──────────────────────────────────────────────── */
.legend {
    padding: 10px;
    font: 13px/16px Arial, sans-serif;
    background: rgba(255,255,255,0.93);
    box-shadow: 0 0 12px rgba(0,0,0,0.18);
    border-radius: 6px;
    color: #333;
}
.legend i {
    width: 16px; height: 16px;
    float: left; margin-right: 7px;
    opacity: 0.9; border-radius: 50%; border: 1px solid #fff;
}
html[dir="rtl"] .legend i { float: right; margin-right: 0; margin-left: 7px; }

/* ── Pulse animation ─────────────────────────────────────── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }
.loading-pulse { animation: pulse 1.4s ease-in-out infinite; }

/* ── Basemap switcher ────────────────────────────────────── */
.leaflet-basemap-wrap { position: relative; }
.basemap-btn {
    width: 34px; height: 34px;
    background: white; border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.15s;
    border: 2px solid rgba(0,0,0,0.07);
}
.basemap-btn:hover { background: #f0fdf4; }
.basemap-btn svg { width: 18px; height: 18px; color: #475569; }
.basemap-dropdown {
    display: none; position: absolute;
    top: 40px; right: 0;
    background: white; border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    overflow: hidden; min-width: 170px;
    z-index: 9999; border: 1px solid #e2e8f0;
}
.basemap-dropdown.open { display: block; }
.basemap-dropdown-header {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white; font-size: 10px; font-weight: 700;
    text-transform: uppercase; padding: 7px 12px; letter-spacing: .07em;
}
.basemap-dropdown-list { list-style: none; margin: 0; padding: 4px 0; }
.basemap-dropdown-list li {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 12px; cursor: pointer; font-size: 12px;
    color: #334155; transition: background 0.12s;
}
.basemap-dropdown-list li:hover  { background: #f0fdf4; }
.basemap-dropdown-list li.active { background: var(--accent-light); color: var(--accent-dark); font-weight: 700; }
.basemap-swatch {
    width: 14px; height: 14px; border-radius: 3px;
    flex-shrink: 0; border: 1px solid rgba(0,0,0,0.12);
}

/* ── Language pill ───────────────────────────────────────── */
.lang-btn {
    cursor: pointer; border: none; background: transparent;
    color: var(--accent); font-weight: 700; letter-spacing: .03em;
    transition: all 0.18s;
}
.lang-btn.active             { background: var(--accent); color: white; }
.lang-btn:not(.active):hover { background: var(--accent-light); }

/* ── RTL ─────────────────────────────────────────────────── */
html[dir="rtl"] .weather-popup {
    font-family: 'Noto Sans Arabic', sans-serif;
    direction: rtl;
}

/* ── Popup overrides ─────────────────────────────────────── */
.weather-popup b { color: var(--accent-dark); font-size: 1.05rem; }

/* ── Forecast strip inside popup ────────────────────────── */
.forecast-strip {
    display: flex; gap: 4px; margin-top: 8px;
}
.forecast-day {
    flex: 1; background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px; padding: 5px 4px;
    text-align: center; font-size: 10px;
}
.forecast-day .fc-label { color: #64748b; font-weight: 700; text-transform: uppercase; }
.forecast-day .fc-icon  { font-size: 16px; line-height: 1.4; }
.forecast-day .fc-max   { color: #b91c1c; font-weight: 700; }
.forecast-day .fc-min   { color: #1d4ed8; }

/* ── Hourly mini-chart ───────────────────────────────────── */
.hourly-row {
    display: flex; gap: 3px; overflow-x: auto;
    padding: 6px 0 4px; scrollbar-width: thin;
}
.hour-cell {
    flex-shrink: 0; width: 36px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 5px; padding: 3px 2px;
    text-align: center; font-size: 9px;
}
.hour-cell .hc-time { color: #94a3b8; font-weight: 700; }
.hour-cell .hc-icon { font-size: 13px; line-height: 1.5; }
.hour-cell .hc-temp { color: #334155; font-weight: 700; }

/* ── Astronomy row ───────────────────────────────────────── */
.astro-row {
    display: flex; gap: 8px; margin-top: 6px;
    font-size: 11px; color: #475569;
}
.astro-item {
    display: flex; align-items: center; gap: 4px;
    background: #fefce8; border: 1px solid #fde68a;
    border-radius: 5px; padding: 3px 7px;
    white-space: nowrap;
}

── wttr badge ──────────────────────────────────────────── */
/* .wttr-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--accent-light);
    border: 1px solid #6ee7b7;
    border-radius: 4px; padding: 2px 7px;
    font-size: 10px; font-weight: 700; color: var(--accent-dark);
}

/* ── Signature ───────────────────────────────────────────── */
.sig-badge {
    font-size: 11px; color: #94a3b8;
    letter-spacing: .04em;
    display: flex; align-items: center; gap: 4px;
}
.sig-badge span { color: var(--accent); font-weight: 700; }
