:root {
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --primary-light: #e0f2fe;
    --accent: #f59e0b;
    --emerald: #10b981;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
}

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

html,
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%;
}

img, svg {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.18s ease;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header & Top Bar */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.top-bar {
    background: linear-gradient(90deg, #0f172a, #1e293b);
    color: #cbd5e1;
    font-size: 0.82rem;
    padding: 7px 0;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px #10b981;
}

.top-bar-right {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.top-bar-right a {
    color: #93c5fd;
    font-weight: 500;
}

.top-bar-right a:hover {
    color: #fff;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 12px;
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    display: block;
    line-height: 1.15;
}

.brand-name span {
    color: var(--primary);
}

.brand-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.header-search-wrap {
    flex: 1;
    min-width: 280px;
    max-width: 520px;
    position: relative;
}

.search-input-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: #64748b;
    pointer-events: none;
}

.search-input-box input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1.5px solid #cbd5e1;
    border-radius: 99px;
    font-size: 0.92rem;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    transition: all 0.2s;
}

.search-input-box input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.16);
    max-height: 420px;
    overflow-y: auto;
    z-index: 1000;
}

.search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.search-item:hover {
    background: #f8fafc;
}

.search-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background: #e0f2fe;
    color: #0369a1;
    margin-right: 6px;
    text-transform: uppercase;
}

.search-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.92rem;
}

.search-sub {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

.search-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.s-btn {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.s-btn-old {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.s-btn-new {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.search-empty {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.main-nav a {
    padding: 8px 13px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Layout & Cards */
.page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    margin-top: 22px;
    margin-bottom: 40px;
}

.main-col,
.sidebar-col {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 992px) {
    .page-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* Breadcrumbs */
.breadcrumb-bar {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    font-size: 0.86rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    color: #64748b;
}

.breadcrumb-list a {
    color: #0284c7;
    font-weight: 600;
}

/* Dual Admin Switcher Banner */
.dual-admin-banner {
    background: linear-gradient(135deg, #f0f9ff 0%, #ecfdf5 100%);
    border: 1.5px solid #bae6fd;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.dual-admin-info {
    font-size: 0.9rem;
    color: #1e293b;
}

.dual-admin-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 700;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    color: #334155;
}

.mode-pill.active-old {
    background: #0284c7;
    color: #fff;
    border-color: #0284c7;
}

.mode-pill.active-new {
    background: #059669;
    color: #fff;
    border-color: #059669;
}

/* Weather Hero Card */
.weather-hero {
    border-radius: var(--radius-lg);
    padding: 28px;
    color: #fff;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.weather-hero.bg-sunny {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 55%, #38bdf8 100%);
}

.weather-hero.bg-cloudy {
    background: linear-gradient(135deg, #1e3a8a 0%, #0369a1 60%, #0284c7 100%);
}

.weather-hero.bg-rainy,
.weather-hero.bg-stormy,
.weather-hero.bg-foggy {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #334155 100%);
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.hero-title-group h1 {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 6px;
}

.hero-subtitle {
    font-size: 0.92rem;
    opacity: 0.92;
}

.hero-main-temp {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 22px 0;
    flex-wrap: wrap;
}

.temp-giant {
    font-size: 4.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
}

.temp-condition-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.condition-label {
    font-size: 1.3rem;
    font-weight: 700;
}

.feels-like-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

.hero-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-metric-item {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    padding: 12px 14px;
    border-radius: 12px;
}

.hm-label {
    font-size: 0.78rem;
    opacity: 0.85;
    display: block;
}

.hm-val {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 2px;
    display: block;
}

/* Horizon Tabs */
.horizon-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 22px;
}

.horizon-tab {
    padding: 9px 16px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 99px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

.horizon-tab.active,
.horizon-tab:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Hourly Strip */
.hourly-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.hourly-card {
    min-width: 86px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    flex-shrink: 0;
}

.hourly-card.now {
    background: #f0f9ff;
    border-color: #38bdf8;
}

.hc-time {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.hc-temp {
    font-size: 1.08rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 6px;
}

.hc-rain {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0284c7;
    margin-top: 4px;
}

/* Daily Forecast Table / List */
.daily-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.daily-row {
    display: grid;
    grid-template-columns: 140px 1fr 110px 130px;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

@media (max-width: 640px) {
    .daily-row {
        grid-template-columns: 1fr 1fr;
    }
}

.dr-day {
    font-weight: 700;
    color: #0f172a;
}

.dr-date {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
}

.dr-cond {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #334155;
    font-size: 0.92rem;
}

.dr-rain {
    font-size: 0.85rem;
    color: #0284c7;
    font-weight: 600;
}

.dr-temps {
    text-align: right;
    font-weight: 800;
    font-size: 1.02rem;
}

.dr-temps .t-max {
    color: #ea580c;
}

.dr-temps .t-min {
    color: #0284c7;
    margin-left: 8px;
}

/* Sub-location Grid (Districts & Wards) */
.loc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.loc-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.18s;
}

.loc-card:hover {
    background: #fff;
    border-color: #38bdf8;
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.loc-card-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.95rem;
}

.loc-card-meta {
    font-size: 0.78rem;
    color: #64748b;
}

.loc-card-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.loc-mini-link {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: #e0f2fe;
    color: #0369a1;
}

.loc-mini-link.new-2cap {
    background: #ecfdf5;
    color: #047857;
}

/* Life Indices Grid */
.indices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.index-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.index-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.index-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
}

.index-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 99px;
    color: #fff;
}

/* FAQ Accordion */
.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 14px 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-q {
    font-weight: 700;
    color: #0f172a;
    font-size: 1rem;
    margin-bottom: 6px;
}

.faq-a {
    color: #475569;
    font-size: 0.93rem;
}

/* Footer */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 48px 0 28px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr 1.1fr;
    gap: 28px;
    margin-bottom: 32px;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
}

.footer-brand span {
    color: #38bdf8;
}

.footer-desc {
    font-size: 0.88rem;
    color: #94a3b8;
    margin-bottom: 14px;
}

.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.f-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.14);
    color: #7dd3fc;
}

.footer-col h4 {
    color: #fff;
    font-size: 0.98rem;
    margin-bottom: 12px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
}

.footer-links a {
    color: #94a3b8;
}

.footer-links a:hover {
    color: #38bdf8;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
}

.seo-content-box h2,
.seo-content-box h3 {
    color: #0f172a;
    margin: 18px 0 10px;
}

.seo-content-box p {
    margin-bottom: 12px;
    color: #334155;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE OPTIMIZATION
   ========================================================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }

    /* Disable tall sticky header on mobile so it doesn't cover the viewport */
    .site-header {
        position: relative;
    }

    .top-bar {
        padding: 5px 0;
        font-size: 0.75rem;
    }

    .top-bar-left {
        display: none;
    }

    .top-bar-right {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        gap: 12px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .top-bar-right::-webkit-scrollbar {
        display: none;
    }

    .header-main {
        padding-top: 10px;
        padding-bottom: 10px;
        gap: 10px;
    }

    .brand-logo {
        width: 100%;
    }

    .brand-name {
        font-size: 1.22rem;
    }

    .brand-tag {
        font-size: 0.72rem;
    }

    .header-search-wrap {
        order: 2;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .search-input-box input {
        padding: 9px 14px 9px 38px;
        font-size: 0.88rem;
    }

    .search-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 12px;
    }

    .search-item-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .main-nav {
        order: 3;
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        gap: 6px;
        padding-bottom: 2px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        padding: 6px 12px;
        font-size: 0.82rem;
        background: #f1f5f9;
        border-radius: 99px;
        flex-shrink: 0;
    }

    .breadcrumb-bar {
        padding: 8px 0;
        font-size: 0.78rem;
    }

    .page-layout {
        margin-top: 14px;
        margin-bottom: 28px;
        gap: 16px;
    }

    .card {
        padding: 16px 14px;
        border-radius: 14px;
        margin-bottom: 16px;
    }

    .section-title {
        font-size: 1.08rem;
        margin-bottom: 12px;
        gap: 6px;
    }

    .section-title h2 {
        font-size: 1.08rem !important;
        line-height: 1.35;
    }

    .dual-admin-banner {
        padding: 12px 14px;
        border-radius: 12px;
        margin-bottom: 14px;
        gap: 10px;
    }

    .dual-admin-info {
        font-size: 0.84rem;
        line-height: 1.5;
        width: 100%;
    }

    .dual-admin-pills {
        width: 100%;
    }

    .mode-pill {
        width: 100%;
        justify-content: center;
        text-align: center;
        font-size: 0.82rem;
        padding: 8px 12px;
    }

    .horizon-tabs {
        gap: 6px;
        margin-bottom: 14px;
        padding-bottom: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .horizon-tabs::-webkit-scrollbar {
        display: none;
    }

    .horizon-tab {
        padding: 7px 13px;
        font-size: 0.82rem;
    }

    /* Weather Hero Mobile */
    .weather-hero {
        padding: 18px 15px;
        border-radius: 14px;
        margin-bottom: 16px;
    }

    .hero-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .hero-title-group h1 {
        font-size: 1.26rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 0.8rem;
        line-height: 1.45;
    }

    .hero-main-temp {
        gap: 12px;
        margin: 14px 0;
        align-items: center;
    }

    .hero-main-temp svg {
        width: 54px !important;
        height: 54px !important;
        flex-shrink: 0;
    }

    .temp-giant {
        font-size: 2.65rem;
        letter-spacing: -1px;
    }

    .temp-condition-box {
        width: 100%;
        gap: 2px;
    }

    .condition-label {
        font-size: 1.05rem;
    }

    .feels-like-label {
        font-size: 0.83rem;
    }

    .hero-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 14px;
        padding-top: 14px;
    }

    .hero-metric-item {
        padding: 10px 11px;
        border-radius: 10px;
    }

    .hm-label {
        font-size: 0.72rem;
    }

    .hm-val {
        font-size: 0.86rem;
        word-break: break-word;
    }

    .hourly-card {
        min-width: 78px;
        padding: 10px 6px;
    }

    .indices-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .index-box {
        padding: 13px;
    }

    .site-footer {
        padding: 32px 0 22px;
        margin-top: 30px;
    }
}

@media (max-width: 640px) {
    .daily-row {
        grid-template-columns: 1fr auto;
        gap: 8px 10px;
        padding: 12px;
    }

    .daily-row > div:nth-child(1) {
        order: 1;
    }

    .dr-temps {
        order: 2;
        text-align: right;
        font-size: 0.94rem;
    }

    .dr-cond {
        order: 3;
        font-size: 0.84rem;
        gap: 8px;
    }

    .dr-cond svg {
        width: 28px !important;
        height: 28px !important;
        flex-shrink: 0;
    }

    .dr-rain {
        order: 4;
        text-align: right;
        font-size: 0.78rem;
        align-self: center;
    }

    .loc-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .loc-card {
        padding: 12px 13px;
    }
}
