﻿/* =========================================
   Base Layout (CRITICAL – DO NOT TOUCH)
   ========================================= */

html,
body {
    min-height: 100%;
    margin: 0;
    background-attachment: fixed;
}

.w3-container,
.mud-main-content {
    background: transparent !important;
}


/* =========================================
   Global Theme Background
   ========================================= */

body.theme-green {
    background: linear-gradient(135deg, rgba(41,131,118,0.08), rgba(197,165,114,0.06) ), #f8fbfa;
}

body.theme-gold {
    background: linear-gradient(135deg, rgba(197,165,114,0.12), rgba(41,131,118,0.05) ), #fbf9f4;
}

body.theme-gray {
    background: linear-gradient(135deg, rgba(107,114,128,0.08), rgba(229,231,235,0.15) ), #fafafa;
}

body.theme-blue {
    background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(14,165,233,0.12) ), #f5f9ff;
}

body.theme-rose {
    background: linear-gradient(135deg, rgba(236,72,153,0.10), rgba(251,113,133,0.08) ), #fff6f9;
}

body.theme-mint {
    background: linear-gradient(135deg, rgba(20,184,166,0.10), rgba(110,231,183,0.08) ), #f0fdfa;
}

body.theme-orange {
    background: linear-gradient(135deg, rgba(249,115,22,0.10), rgba(251,191,36,0.08) ), #fff7ed;
}

body.theme-crimson {
    background: linear-gradient(135deg, rgba(220,38,38,0.10), rgba(248,113,113,0.08) ), #fff5f5;
}

body.theme-purple {
    background: linear-gradient(135deg, rgba(139,92,246,0.10), rgba(168,85,247,0.08) ), #f8f6ff;
}


/* =========================================
   Theme CSS Variables
   ========================================= */

.theme-green {
    --primary: #298376;
    --primary-dark: #1F6F63;
    --primary-light: rgba(41,131,118,0.12);
    --icon-color: #1F6F63;
    --icon-soft: #f8fbfa;
    --mud-palette-primary: #298376;
}

.theme-gold {
    --primary: #C5A572;
    --primary-dark: #9E7F3F;
    --primary-light: rgba(197,165,114,0.12);
    --icon-color: #9E7F3F;
    --icon-soft: #fbf9f4;
    --mud-palette-primary: #C5A572;
}

.theme-gray {
    --primary: #6B7280;
    --primary-dark: #4B5563;
    --primary-light: rgba(107,114,128,0.12);
    --icon-color: #4B5563;
    --icon-soft: #fafafa;
    --mud-palette-primary: #6B7280;
}

.theme-blue {
    --primary: #2563EB;
    --primary-dark: #1E40AF;
    --primary-light: rgba(37,99,235,0.12);
    --icon-color: #1E40AF;
    --icon-soft: #f5f9ff;
    --mud-palette-primary: #2563EB;
}

.theme-rose {
    --primary: #EC4899;
    --primary-dark: #BE185D;
    --primary-light: rgba(236,72,153,0.12);
    --icon-color: #BE185D;
    --icon-soft: #fff6f9;
    --mud-palette-primary: #EC4899;
}

.theme-mint {
    --primary: #14B8A6;
    --primary-dark: #0F766E;
    --primary-light: rgba(20,184,166,0.12);
    --icon-color: #0F766E;
    --icon-soft: #f0fdfa;
    --mud-palette-primary: #14B8A6;
}

.theme-orange {
    --primary: #F97316;
    --primary-dark: #C2410C;
    --primary-light: rgba(249,115,22,0.12);
    --icon-color: #C2410C;
    --icon-soft: #fff7ed;
    --mud-palette-primary: #F97316;
}

.theme-crimson {
    --primary: #DC2626;
    --primary-dark: #991B1B;
    --primary-light: rgba(220,38,38,0.12);
    --icon-color: #991B1B;
    --icon-soft: #fff5f5;
    --mud-palette-primary: #DC2626;
}

.theme-purple {
    --primary: #8B5CF6;
    --primary-dark: #6D28D9;
    --primary-light: rgba(139,92,246,0.12);
    --icon-color: #6D28D9;
    --icon-soft: #f8f6ff;
    --mud-palette-primary: #8B5CF6;
}


/* =========================================
   Glass UI Elements
   ========================================= */

.glass-card {
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.side-glass {
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(14px);
    border-radius: 20px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

.theme-gray .side-glass {
    background: rgba(255,255,255,0.70);
}


/* =========================================
   Top Bar
   ========================================= */

.topbar-glass {
    backdrop-filter: blur(14px);
    color: #fff;
}

.theme-green .topbar-glass {
    background: rgba(41,131,118,0.75);
}

.theme-gold .topbar-glass {
    background: rgba(197,165,114,0.85);
}

.theme-gray .topbar-glass {
    background: rgba(107,114,128,0.85);
}

.theme-blue .topbar-glass {
    background: rgba(37,99,235,0.85);
}

.theme-rose .topbar-glass {
    background: rgba(236,72,153,0.85);
}

.theme-mint .topbar-glass {
    background: rgba(20,184,166,0.85);
}

.theme-orange .topbar-glass {
    background: rgba(249,115,22,0.85);
}

.theme-crimson .topbar-glass {
    background: rgba(220,38,38,0.85);
}

.theme-purple .topbar-glass {
    background: rgba(139,92,246,0.85);
}


/* =========================================
   Icons
   ========================================= */

.mud-icon-root,
.mud-nav-link-icon,
.fa, .fas, .far, .fab, i {
    transition: color 0.2s ease;
}

[class*="theme-"] i,
[class*="theme-"] .mud-icon-root {
    color: var(--icon-color);
}

.menu-icon i {
    color: rgba(255,255,255,0.85);
}


/* =========================================
   Solid Primary Button
   ========================================= */

[class*="theme-"] .btn-solid {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border: none;
    transition: opacity .15s ease, transform .15s ease;
}

    [class*="theme-"] .btn-solid:hover {
        opacity: 0.88;
        transform: translateY(-1px);
    }

    [class*="theme-"] .btn-solid:active {
        opacity: 1.00;
        transform: translateY(0);
    }


/* =========================================
   MudBlazor Icon Buttons
   ========================================= */

.mud-icon-button {
    background-color: transparent !important;
}

    .mud-icon-button:hover {
        background-color: rgba(0,0,0,0.04) !important;
    }

    .mud-icon-button:active {
        background-color: rgba(0,0,0,0.06) !important;
    }

    .mud-icon-button:focus-visible {
        outline: none;
        box-shadow: none;
    }


/* =========================================
   Filter Chips (ثلاثية الحالة)
   ========================================= */

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1.5px solid rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.7);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    color: #555;
    transition: all .18s ease;
}

    .filter-chip:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    /* ── مُفعَّل ── */
    .filter-chip.chip-on {
        background: var(--primary);
        border-color: var(--primary);
        color: #fff;
    }

        .filter-chip.chip-on i {
            color: #fff !important;
        }

    /* ── مُعطَّل ── */
    .filter-chip.chip-off {
        background: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary-dark);
        text-decoration: line-through;
        opacity: .75;
    }

        .filter-chip.chip-off i {
            color: var(--primary-dark) !important;
        }


/* =========================================
   Toolbar / Action Bar (شريط الأدوات)
   ========================================= */

.action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.60);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

    /* فاصل رأسي خفيف داخل شريط الأدوات */
    .action-bar .mud-divider-vertical {
        height: 26px !important;
        opacity: .35;
    }

    /* تسمية المجموعة داخل شريط الأدوات */
    .action-bar .group-label {
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .6px;
        color: #888;
        padding: 0 2px;
    }


/* =========================================
   Stat Cards (بطاقات الإحصائيات)
   ========================================= */

.stat-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    transition: transform .2s ease, box-shadow .2s ease;
    height: 100%;
}

    .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    }

/* رأس البطاقة الملوّن */
.stat-card__header {
    padding: .75rem 1.2rem .6rem;
    font-size: .95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .4px;
    background: var(--primary);
}

/* أيقونة خلفية كبيرة شفافة */
.stat-card__icon {
    position: absolute;
    left: .8rem;
    top: .4rem;
    font-size: 2.8rem;
    color: #fff;
    opacity: .12;
    pointer-events: none;
}

/* جسم البطاقة */
.stat-card__body {
    padding: .8rem 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

/* صف الإحصائية */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .28rem .5rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.55);
    transition: background .15s;
}

    .stat-row:hover {
        background: var(--primary-light);
    }

.stat-row__label {
    font-size: .8rem;
    color: #555;
    font-weight: 500;
}

.stat-row__value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    min-width: 2rem;
    text-align: center;
    background: var(--primary-light);
    padding: .1rem .5rem;
    border-radius: 20px;
}

/* قيمة تحذيرية */
.stat-row__value--warn {
    background: rgba(249,115,22,0.12);
    color: #c2410c;
}


/* =========================================
   Chart Cards (بطاقات الرسوم البيانية)
   ========================================= */

.chart-card {
    background: rgba(255,255,255,0.68);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1rem 1.2rem 1.4rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    transition: box-shadow .2s;
    height: 100%;
}

    .chart-card:hover {
        box-shadow: 0 8px 28px rgba(0,0,0,0.11);
    }

.chart-card__title {
    font-size: .88rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: .6rem;
    padding-bottom: .45rem;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: .45rem;
}

    .chart-card__title i {
        color: var(--primary) !important;
    }


/* =========================================
   Table Cards (بطاقات الجداول)
   ========================================= */

.table-card {
    background: rgba(255,255,255,0.68);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}

.table-card__title {
    padding: .7rem 1.2rem;
    font-size: .92rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: .45rem;
    background: var(--primary);
}


/* =========================================
   Print / Report Buttons (أزرار الطباعة)
   ========================================= */

.print-btn {
    width: 100%;
    padding: .58rem .5rem;
    border: none;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.14);
    transition: opacity .15s, transform .15s, box-shadow .15s;
}

    .print-btn:hover {
        opacity: .87;
        transform: translateY(-2px);
        box-shadow: 0 5px 14px rgba(0,0,0,0.18);
    }

    .print-btn:active {
        opacity: 1;
        transform: translateY(0);
    }

/* ألوان متغيرة للتمييز البصري بين أنواع التقارير */
.print-btn--secondary {
    background: var(--primary-dark);
}

.print-btn--outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

    .print-btn--outline:hover {
        background: var(--primary);
        color: #fff;
    }


/* =========================================
   Filter Section & Print Section
   =========================================*/

.filter-section,
.print-section {
    background: rgba(255,255,255,0.62);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 1rem 1.2rem 1.4rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 3px 14px rgba(0,0,0,0.06);
    border: 1px solid rgba(255,255,255,0.35);
}

.filter-section__title,
.print-section__title {
    font-size: .85rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: .8rem;
    padding-bottom: .45rem;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: .42rem;
}

    .filter-section__title i {
        color: var(--primary) !important;
    }

    .print-section__title i {
        color: var(--primary) !important;
    }

.field-label {
    font-size: .78rem;
    font-weight: 600;
    color: #555;
    display: block;
    margin-bottom: 2px;
}


/* =========================================
   Report Viewer (عارض التقرير)
   ========================================= */

.report-viewer {
    width: 100%;
    height: 72vh;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
    margin-top: .5rem;
    background: rgba(255,255,255,0.5);
}


/* =========================================
   Shared Utilities
   ========================================= */

.mb-6 {
    margin-bottom: 1.5rem;
}

.dashboard-wrapper {
    padding: 1.5rem 1rem;
    direction: rtl;
}

.card-page-wrapper {
    padding: 1rem;
    direction: rtl;
}


/* ══ HajjInfoBar — ربط بالثيم ══ */

/* الثيم الأخضر (الافتراضي) */
.theme-green .hib-top-strip {
    background: rgba(41,131,118,0.85);
}

.theme-green .hib-city-strip {
    background: rgba(41,131,118,0.07);
    border-bottom-color: rgba(41,131,118,0.12);
}

.theme-green .hib-prayers-strip {
    background: rgba(41,131,118,0.04);
}

/* الذهبي */
.theme-gold .hib-top-strip {
    background: rgba(197,165,114,0.90);
}

.theme-gold .hib-city-strip {
    background: rgba(197,165,114,0.08);
    border-bottom-color: rgba(197,165,114,0.15);
}

.theme-gold .hib-city-dot, .theme-gold .hib-p-time {
    color: #9E7F3F;
}

.theme-gold .hib-prayers-strip {
    background: rgba(197,165,114,0.05);
}

/* الرمادي */
.theme-gray .hib-top-strip {
    background: rgba(107,114,128,0.85);
}

.theme-gray .hib-city-strip {
    background: rgba(107,114,128,0.07);
}

.theme-gray .hib-prayers-strip {
    background: rgba(107,114,128,0.04);
}

/* الأزرق */
.theme-blue .hib-top-strip {
    background: rgba(37,99,235,0.85);
}

.theme-blue .hib-city-strip {
    background: rgba(37,99,235,0.07);
}

.theme-blue .hib-prayers-strip {
    background: rgba(37,99,235,0.04);
}

/* الوردي */
.theme-rose .hib-top-strip {
    background: rgba(236,72,153,0.85);
}

.theme-rose .hib-city-strip {
    background: rgba(236,72,153,0.07);
}

.theme-rose .hib-prayers-strip {
    background: rgba(236,72,153,0.04);
}

/* النعناعي */
.theme-mint .hib-top-strip {
    background: rgba(20,184,166,0.85);
}

.theme-mint .hib-city-strip {
    background: rgba(20,184,166,0.07);
}

.theme-mint .hib-prayers-strip {
    background: rgba(20,184,166,0.04);
}

/* البرتقالي */
.theme-orange .hib-top-strip {
    background: rgba(249,115,22,0.85);
}

.theme-orange .hib-city-strip {
    background: rgba(249,115,22,0.07);
}

.theme-orange .hib-prayers-strip {
    background: rgba(249,115,22,0.04);
}

/* القرمزي */
.theme-crimson .hib-top-strip {
    background: rgba(220,38,38,0.85);
}

.theme-crimson .hib-city-strip {
    background: rgba(220,38,38,0.07);
}

.theme-crimson .hib-prayers-strip {
    background: rgba(220,38,38,0.04);
}

/* البنفسجي */
.theme-purple .hib-top-strip {
    background: rgba(139,92,246,0.85);
}

.theme-purple .hib-city-strip {
    background: rgba(139,92,246,0.07);
}

.theme-purple .hib-prayers-strip {
    background: rgba(139,92,246,0.04);
}