:root {
    --green-deep: #021a0e;
    --green-dark: #042d16;
    --green-mid: #06401f;
    --green-accent: #0a5c2c;
    --green-light: #2ecc71;
    --cyan: #00d4aa;
    --gold: #e6a817;
    --gold-light: #ffd740;
    --white: #ffffff;
    --white-60: rgba(255, 255, 255, 0.6);
    --white-08: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.10);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-h: 72px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--green-deep);
    color: var(--white);
    min-height: 100vh;
    direction: rtl;
}

/* ── BACKGROUND ── */
.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-canvas::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 15% 20%, rgba(10, 92, 44, 0.55) 0%, transparent 60%),
        radial-gradient(ellipse 55% 70% at 85% 80%, rgba(0, 212, 170, 0.10) 0%, transparent 55%),
        linear-gradient(170deg, #021a0e 0%, #042d16 45%, #021a0e 100%);
}

.bg-canvas::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    animation: drift linear infinite;
    pointer-events: none;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(10, 92, 44, 0.45), transparent 70%);
    top: -10%;
    right: -8%;
    animation-duration: 22s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(0, 212, 170, 0.12), transparent 70%);
    bottom: 5%;
    left: -6%;
    animation-duration: 17s;
    animation-direction: reverse;
}

@keyframes drift {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(25px, -18px) scale(1.05);
    }

    66% {
        transform: translate(-18px, 25px) scale(0.95);
    }
}

/* ── LAYOUT ── */
.page-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-h);
}

/* ══════════════════════════════════
   HEADER — موحد
══════════════════════════════════ */
header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    height: var(--header-h);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(2, 26, 14, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(46, 204, 113, 0.15);
    animation: slide-down 0.6s ease both;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(46, 204, 113, 0.3));
    transition: filter var(--transition), transform var(--transition);
}

.header-brand:hover .logo-img {
    filter: drop-shadow(0 4px 16px rgba(46, 204, 113, 0.55));
    transform: scale(1.04);
}

.logo-fallback {
    display: none;
    align-items: center;
    gap: 10px;
}

.logo-fallback-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0a5c2c, #00d4aa);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.logo-fallback-text {
    font-family: 'Amiri Quran', serif;
    font-size: 20px;
    color: white;
}

.logo-fallback-sub {
    font-size: 11px;
    color: #2ecc71;
    letter-spacing: 2px;
}

/* Nav — أصفر موحد */
.header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    color: var(--gold-light);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: white;
    background: var(--white-08);
}

.nav-link.active {
    color: var(--gold-light);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 16px;
    left: 16px;
    height: 2px;
    background: var(--gold-light);
    border-radius: 2px;
}

/* زر تسجيل الدخول */
.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, rgba(230, 168, 23, 0.15), rgba(255, 215, 64, 0.08));
    border: 1px solid rgba(230, 168, 23, 0.35);
    border-radius: 50px;
    color: var(--gold-light);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login:hover {
    background: linear-gradient(135deg, rgba(230, 168, 23, 0.28), rgba(255, 215, 64, 0.15));
    border-color: var(--gold-light);
    transform: translateY(-1px);
}

/* ── PAGE TITLE ── */
.page-title-section {
    padding: 48px 40px 32px;
    text-align: center;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.38);
    margin-bottom: 14px;
}

.breadcrumb-link {
    color: var(--green-light);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumb-link:hover {
    color: var(--cyan);
}

.page-main-title {
    font-family: 'Amiri Quran', serif;
    font-size: clamp(28px, 4vw, 48px);
    color: var(--gold-light);
    text-shadow: 0 0 40px rgba(230, 168, 23, 0.3);
    margin-bottom: 10px;
}

.page-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
}

/* ── SECTIONS GRID ── */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0 40px 32px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.section-card {
    background: rgba(6, 64, 31, 0.4);
    border: 1px solid rgba(46, 204, 113, 0.15);
    border-radius: var(--radius-lg);
    padding: 28px 20px 24px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.section-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    background: radial-gradient(ellipse at center, rgba(46, 204, 113, 0.10), transparent 70%);
    transition: opacity var(--transition);
}

.section-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity var(--transition);
}

.section-card:hover {
    transform: translateY(-5px);
    border-color: rgba(46, 204, 113, 0.35);
    background: rgba(10, 92, 44, 0.55);
}

.section-card:hover::before {
    opacity: 1;
}

.section-card:hover::after {
    opacity: 1;
}

.section-card.active {
    border-color: var(--green-light);
    background: rgba(10, 92, 44, 0.65);
    box-shadow: 0 0 24px rgba(46, 204, 113, 0.15);
}

.section-card.active::after {
    opacity: 1;
}

.section-icon {
    font-size: 38px;
    margin-bottom: 12px;
    display: block;
    transition: transform var(--transition);
}

.section-card:hover .section-icon {
    transform: scale(1.12) translateY(-3px);
}

.section-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 6px;
}

.section-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.40);
}

.section-card.coming-soon {
    opacity: 0.7;
}

.section-card.coming-soon:hover {
    opacity: 1;
}

/* ── CONTENT AREA ── */
.content-area {
    flex: 1;
    padding: 0 40px 60px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    display: none;
}

.content-area.visible {
    display: block;
}

.subsections-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0;
}

.sub-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.45);
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: -1px;
}

.sub-tab:hover {
    color: white;
}

.sub-tab.active {
    color: var(--green-light);
    border-bottom-color: var(--green-light);
}

/* Category accordion */
.category-block {
    margin-bottom: 12px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(6, 64, 31, 0.5);
    border: 1px solid rgba(46, 204, 113, 0.15);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.category-header:hover {
    background: rgba(10, 92, 44, 0.65);
    border-color: rgba(46, 204, 113, 0.30);
}

.category-header.open {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-color: rgba(46, 204, 113, 0.30);
}

.cat-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cat-icon {
    font-size: 18px;
}

.cat-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
}

.cat-count {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.2);
    border-radius: 50px;
    color: var(--green-light);
    font-weight: 700;
}

.cat-arrow {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    transition: transform var(--transition);
}

.category-header.open .cat-arrow {
    transform: rotate(180deg);
}

.category-body {
    display: none;
    background: rgba(4, 45, 22, 0.4);
    border: 1px solid rgba(46, 204, 113, 0.15);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
}

.category-body.open {
    display: block;
}

.cat-empty {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.30);
}

/* File rows */
.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background var(--transition);
    gap: 12px;
}

.file-row:last-child {
    border-bottom: none;
}

.file-row:hover {
    background: rgba(46, 204, 113, 0.05);
}

.file-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.file-pdf-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
    background: rgba(220, 50, 50, 0.15);
    border: 1px solid rgba(220, 50, 50, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name-ar {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.90);
    margin-bottom: 2px;
    line-height: 1.4;
}

.file-name-en {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.30);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.30);
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-download {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(0, 212, 170, 0.10));
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 8px;
    color: var(--green-light);
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-download:hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.28), rgba(0, 212, 170, 0.20));
    border-color: var(--green-light);
    box-shadow: 0 4px 14px rgba(46, 204, 113, 0.2);
    transform: translateY(-1px);
}

/* Coming soon panel */
.coming-soon-panel {
    display: none;
    text-align: center;
    padding: 60px 20px;
    background: rgba(6, 64, 31, 0.35);
    border: 1px solid rgba(46, 204, 113, 0.12);
    border-radius: var(--radius-lg);
    margin: 0 40px 40px;
}

.coming-soon-panel.visible {
    display: block;
}

.coming-soon-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.coming-soon-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 10px;
}

.coming-soon-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.8;
}

.coming-soon-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 8px 20px;
    background: rgba(230, 168, 23, 0.10);
    border: 1px solid rgba(230, 168, 23, 0.25);
    border-radius: 50px;
    font-size: 13px;
    color: var(--gold-light);
    font-weight: 600;
}

/* ══════════════════════════════════
   FOOTER — موحد
══════════════════════════════════ */
footer {
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-top: 1px solid rgba(46, 204, 113, 0.10);
    position: relative;
    z-index: 1;
}

.footer-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.footer-copy-main {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.30);
}

.footer-copy-main strong {
    color: rgba(255, 255, 255, 0.55);
}

.footer-copy-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.20);
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border: none;
    border-radius: 50px;
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 3px 14px rgba(37, 211, 102, 0.25);
    transition: var(--transition);
}

.btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
}

/* ══════════════════════════════════
   LOGIN MODAL
══════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: linear-gradient(160deg, #042d16, #021a0e);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 20px;
    padding: 36px 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    transform: translateY(30px) scale(0.96);
    transition: transform 0.35s ease;
    position: relative;
}

.modal-overlay.open .modal-box {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: 12px;
    left: 14px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: white;
}

.modal-logo {
    text-align: center;
    margin-bottom: 20px;
}

.modal-logo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #0a5c2c, #00d4aa);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 8px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 3px;
}

.modal-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.40);
}

.modal-tabs {
    display: flex;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 4px;
}

.modal-tab {
    flex: 1;
    padding: 8px;
    background: none;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.50);
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.modal-tab.active {
    background: rgba(46, 204, 113, 0.15);
    color: var(--green-light);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
}

.form-input {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    outline: none;
    direction: rtl;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--green-light);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.btn-submit {
    padding: 11px;
    margin-top: 4px;
    background: linear-gradient(135deg, #0a5c2c, #1a8c4e);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-submit:hover {
    transform: translateY(-2px);
}

.modal-footer-note {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.30);
    margin-top: 6px;
}

.modal-footer-note span {
    color: var(--green-light);
    cursor: pointer;
    font-weight: 600;
}

/* ── RESPONSIVE ── */
@media (max-width:900px) {
    .sections-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 20px 24px;
    }

    header {
        padding: 0 16px;
    }

    .page-title-section {
        padding: 36px 20px 24px;
    }

    .content-area {
        padding: 0 20px 40px;
    }

    .coming-soon-panel {
        margin: 0 20px 40px;
    }

    .header-nav {
        display: none;
    }

    footer {
        padding: 16px 20px;
    }
}

@media (max-width:480px) {
    .sections-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .file-name-en {
        display: none;
    }

    .file-size {
        display: none;
    }

    .modal-box {
        margin: 16px;
        padding: 28px 20px;
    }
}