﻿/* =============================================================================
   GOVERNMENT DASHBOARD THEME — Kuwait Ministry of Justice
   (Original styling, only change: skyline watermark stretched across full hero)
============================================================================= */

/* ==========================================================================
   ROOT TOKENS
========================================================================== */

:root {
    --gov-primary: #1f4e79;
    --gov-primary-dark: #163a5b;
    --gov-primary-soft: #1f4e79;
    --gov-bg: #ffffff;
    --gov-surface: #ffffff;
    --gov-card: #ffffff;
    --gov-card-hover: #f7fafd;
    --gov-border: #d6dee8;
    --gov-border-strong: #b9c6d3;
    --gov-text: #2c3e50;
    --gov-muted: #6b7a8c;
    --gov-muted-light: #7c8aa0;
    --gov-success-bg: #e8f5ef;
    --gov-success-text: #1f7a4d;
    --gov-radius-sm: 6px;
    --gov-radius-md: 8px;
    --gov-radius-lg: 14px;
}

/* ==========================================================================
   PAGE SHELL
========================================================================== */

.gov-page {
    min-height: 100vh;
    padding: 20px;
    background: #ffffff;
}

    .gov-page::before {
        display: none !important;
        content: none;
    }

.dashboard {
    direction: rtl;
    background: var(--gov-surface);
    border: 3px solid var(--gov-primary);
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
}

/* ==========================================================================
   HERO — Full-width skyline backdrop with portrait + title + logo on top
========================================================================== */

.gov-hero {
    position: relative;
    min-height: 200px;
    height: 200px; /* ✅ enforce exact height */
    padding: 0;
    margin: 0;
    overflow: hidden;
    background-size: contain;
    background-color: #ffffff;
    border: none;
    border-bottom: 4px solid var(--gov-primary);
}

    /* Skyline backdrop */
    .gov-hero::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: url('/img/pages/watermark.png');
        background-repeat: no-repeat;
        background-position: center;
        background-size: cover; /* ✅ prevents stretching distortion */
        opacity: 0.5; /* ✅ 50% as requested */
        pointer-events: none;
        z-index: 1;
    }

    .gov-hero::after {
        content: "";
        position: absolute;
        inset-inline: 0;
        bottom: 0;
        height: 1px;
        background: rgba(31, 78, 121, 0.18);
        z-index: 2;
    }

.gov-hero__inner {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    align-items: center;
    min-height: 200px;
    width: 100%;
    direction: ltr;
    padding: 10px;
    gap: 10px;
}

.gov-hero__left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.gov-hero__box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 310px;
    height: 180px;
    background: #ffffff;
    border: 2px solid var(--gov-primary);
    border-radius: 4px;
    padding: 0;
    overflow: hidden;
}

    .gov-hero__box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
        display: block;
    }

.gov-hero__center {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    direction: rtl;
}

    .gov-hero__center h1 {
        margin: 0;
        font-size: 38px;
        line-height: 1.2;
        font-weight: 800;
        color: var(--gov-primary);
        letter-spacing: -0.01em;
        text-shadow: 0 0 12px rgba(255, 255, 255, 0.85), 0 0 22px rgba(255, 255, 255, 0.6);
    }

.gov-hero__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

    .gov-hero__right > img {
        width: 310px;
        height: 180px;
        object-fit: contain;
        background: #ffffff;
        border: 2px solid var(--gov-primary);
        border-radius: 4px;
        padding: 14px 22px;
        display: block;
    }

.gov-hero__watermark {
    display: none;
}

/* ==========================================================================
   DASHBOARD HEADER (welcome + meta) — kept, hidden by default
========================================================================== */

.dashboard-header {
    margin: 20px;
    text-align: center;
    display: none;
}

.dashboard-welcome {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gov-text);
}

.dashboard-subtitle {
    margin: 0 0 8px;
    color: var(--gov-muted);
    font-size: 14px;
}

.dashboard-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 18px;
    color: var(--gov-muted-light);
    font-size: 13px;
}

/* ==========================================================================
   SECTIONS
========================================================================== */

.dashboard-section {
    margin: 20px;
}

.dashboard-section__header {
    display: none;
}

.dashboard-section__line {
    flex: 1;
    height: 1px;
    background: var(--gov-border);
}

.dashboard-section__title {
    margin: 0;
    color: var(--gov-primary);
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

/* ==========================================================================
   GRID
========================================================================== */

.dashboard-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-card-wrapper {
    min-width: 0;
}

/* ==========================================================================
   GOV CARD
========================================================================== */

.gov-card,
.access-card.dash-card {
    position: relative;
    display: block;
    height: 100%;
    min-height: 110px;
    padding: 22px 26px;
    color: var(--gov-text);
    text-decoration: none !important;
    background: #ffffff;
    border: 1px solid var(--gov-border);
    border-radius: var(--gov-radius-md);
    box-shadow: none;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

    .gov-card:hover,
    .access-card.dash-card:hover,
    .gov-card:focus-visible,
    .access-card.dash-card:focus-visible {
        color: var(--gov-text);
        background: var(--gov-card-hover);
        border-color: var(--gov-primary);
        outline: none;
        box-shadow: 0 2px 6px rgba(31, 78, 121, 0.08);
    }

    .gov-card:focus-visible,
    .access-card.dash-card:focus-visible {
        box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.18);
    }

    .gov-card::before,
    .access-card.dash-card::before {
        content: none;
        display: none;
    }

.gov-card__content,
.dash-card__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 70px;
}

.gov-card__icon,
.dash-card__icon {
    order: 2;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f4e79;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-size: 30px;
}

    .gov-card__icon i,
    .dash-card__icon i {
        color: #ffffff;
        font-size: 30px;
        line-height: 1;
    }

.gov-card__text,
.dash-card__body {
    order: 1;
    flex: 1;
    min-width: 0;
    text-align: start;
}

.gov-card__title,
.dash-card__title {
    margin: 0;
    color: var(--gov-primary);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
}

.gov-card__desc,
.dash-card__nav-label {
    margin-top: 8px;
    color: var(--gov-muted);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
}

.gov-card__value,
.dash-card__value {
    margin: 6px 0 0;
    color: var(--gov-text);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    direction: ltr;
    text-align: start;
}

.dash-card--nav,
.gov-card--nav {
    min-height: 110px;
    background: #ffffff;
}

    .dash-card--nav .dash-card__title,
    .gov-card--nav .gov-card__title {
        font-size: 22px;
    }

.dash-card--kpi,
.gov-card--kpi {
    min-height: 110px;
}

/* ==========================================================================
   STATUS SECTION
========================================================================== */

.dashboard-status-section {
    margin: 0 20px 20px;
    background: #ffffff;
    border: 1px solid var(--gov-border);
    border-radius: var(--gov-radius-md);
    padding: 16px 18px;
}

.dashboard-section-title {
    margin: 0 0 12px;
    color: var(--gov-primary);
    font-size: 15px;
    font-weight: 800;
}

.dashboard-status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 11px;
    color: var(--gov-primary);
    background: #e6edf5;
    border: 1px solid rgba(31, 78, 121, 0.12);
    border-radius: var(--gov-radius-sm);
    font-size: 12px;
    font-weight: 700;
}

.dashboard-empty {
    color: var(--gov-muted);
    font-size: 13px;
}

/* ==========================================================================
   DARK MODE
========================================================================== */

html[data-theme="dark"],
.dark-style {
    --gov-primary: #7db7e8;
    --gov-primary-dark: #a9d3f5;
    --gov-primary-soft: #25384d;
    --gov-bg: #101827;
    --gov-surface: #1e293b;
    --gov-card: #243247;
    --gov-card-hover: #293951;
    --gov-border: #36445d;
    --gov-border-strong: #4a5870;
    --gov-text: #e2e8f0;
    --gov-muted: #a1afc2;
    --gov-muted-light: #94a3b8;
}

    html[data-theme="dark"] .gov-page,
    .dark-style .gov-page {
        background: var(--gov-bg);
    }

    html[data-theme="dark"] .dashboard,
    .dark-style .dashboard {
        background: var(--gov-surface);
    }

    html[data-theme="dark"] .gov-hero,
    .dark-style .gov-hero {
        background: var(--gov-surface);
        border-bottom-color: var(--gov-primary);
    }

        html[data-theme="dark"] .gov-hero::before,
        .dark-style .gov-hero::before {
            opacity: 0.25;
        }

    html[data-theme="dark"] .gov-hero__center h1,
    .dark-style .gov-hero__center h1 {
        text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
    }

    html[data-theme="dark"] .gov-hero__box,
    .dark-style .gov-hero__box,
    html[data-theme="dark"] .gov-hero__right > img,
    .dark-style .gov-hero__right > img {
        background: rgba(15, 23, 42, 0.72);
        border-color: var(--gov-primary);
    }

    html[data-theme="dark"] .gov-card,
    html[data-theme="dark"] .access-card.dash-card,
    .dark-style .gov-card,
    .dark-style .access-card.dash-card {
        color: var(--gov-text);
        background: var(--gov-card);
        border-color: var(--gov-border);
    }

        html[data-theme="dark"] .gov-card:hover,
        html[data-theme="dark"] .access-card.dash-card:hover,
        .dark-style .gov-card:hover,
        .dark-style .access-card.dash-card:hover {
            background: var(--gov-card-hover);
            border-color: var(--gov-primary);
        }

    html[data-theme="dark"] .gov-card__icon,
    html[data-theme="dark"] .dash-card__icon,
    .dark-style .gov-card__icon,
    .dark-style .dash-card__icon {
        background: var(--gov-primary);
        border-color: var(--gov-border);
        color: #ffffff;
    }

    html[data-theme="dark"] .dashboard-status-section,
    .dark-style .dashboard-status-section {
        background: var(--gov-card);
        border-color: var(--gov-border);
    }

    html[data-theme="dark"] .dashboard-badge,
    .dark-style .dashboard-badge {
        background: var(--gov-primary-soft);
        border-color: var(--gov-border);
        color: var(--gov-primary);
    }

/* ==========================================================================
   RESPONSIVE
========================================================================== */

@media (max-width: 1199px) {
    .dashboard-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gov-hero__inner {
        grid-template-columns: 240px 1fr 240px;
    }

    .gov-hero__box,
    .gov-hero__right > img {
        width: 230px;
        height: 160px;
    }

    .gov-hero__center h1 {
        font-size: 30px;
    }
}

@media (max-width: 768px) {
    .gov-page {
        padding: 12px;
    }

    .dashboard {
        border-width: 2px;
    }

    .gov-hero {
        min-height: auto;
    }

        .gov-hero::before {
            background-size: cover;
            opacity: 0.18;
        }

    .gov-hero__inner {
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: auto;
        padding: 14px;
        direction: rtl;
    }

    .gov-hero__left,
    .gov-hero__right {
        justify-self: center;
        justify-content: center;
    }

    .gov-hero__box {
        width: 200px;
        height: 130px;
    }

    .gov-hero__right > img {
        width: 240px;
        height: 110px;
        padding: 10px 16px;
    }

    .gov-hero__center {
        order: -1;
    }

        .gov-hero__center h1 {
            font-size: 24px;
        }

    .dashboard-section,
    .dashboard-status-section {
        margin: 12px;
    }

    .dashboard-cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .gov-card,
    .access-card.dash-card {
        min-height: 92px;
        padding: 16px 18px;
    }

    .gov-card__icon,
    .dash-card__icon {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

        .gov-card__icon i,
        .dash-card__icon i {
            font-size: 24px;
        }

    .gov-card__title,
    .dash-card__title {
        font-size: 17px;
        font-weight: 800;
    }

    .gov-card__desc {
        font-size: 12px;
        margin-top: 4px;
    }

    .gov-card__value,
    .dash-card__value {
        font-size: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gov-card,
    .access-card.dash-card {
        transition: none;
    }
}
