/* ════════════════════════════════════════════════════════════
   main.css — ستايل الموقع الرئيسي (_MainLayout)
   اتنقل من بلوك <style> اللي كان inline جوه _MainLayout.cshtml.
   الموقع الرئيسي مشروع مستقل بالكامل: باليتة ألوان خاصة
   (--gold-lt / --header-bg / --bg …) ومش معتمد على أي ملف تاني.
   ════════════════════════════════════════════════════════════ */

:root {
    --gold: #C8A27A;
    --gold-lt: #E8C99A;
    --gold-dk: #7A4E28;
    --gold-grad: linear-gradient(135deg, #7A4E28 0%, #CF8855 55%, #E8C99A 100%);
    --gold-grad2: linear-gradient(225deg, #69452B 0%, #CF8855 100%);
    --ease-silk: cubic-bezier(0.76, 0, 0.24, 1);
}

[data-theme="dark"] {
    --bg: #0A0804;
    --header-bg: rgba(10,8,4,0.92);
    --btn-color: #C8A27A;
    --btn-border: rgba(200,162,122,0.28);
    --overlay-bot: rgba(0,0,0,0.88);
    --overlay-mid: rgba(0,0,0,0.40);
    --overlay-top: rgba(0,0,0,0.08);
    --panel-desc: rgba(255,255,255,0.72);
    --script-col: rgba(255,255,255,0.28);
    --watermark: rgba(200,162,122,0.07);
    --watermark-h: rgba(200,162,122,0.22);
    --index-col: rgba(200,162,122,0.32);
    --index-h: rgba(200,162,122,0.85);
    --hint-color: rgba(200,162,122,0.4);
    --dot-off: rgba(200,162,122,0.2);
    --veil: #0A0804;
}

[data-theme="light"] {
    --bg: #EDE5D8;
    --header-bg: rgba(237,229,216,0.94);
    --btn-color: #7A4E28;
    --btn-border: rgba(122,78,40,0.32);
    --overlay-bot: rgba(10,5,2,0.85);
    --overlay-mid: rgba(10,5,2,0.32);
    --overlay-top: rgba(10,5,2,0.04);
    --panel-desc: rgba(255,255,255,0.78);
    --script-col: rgba(255,255,255,0.32);
    --watermark: rgba(122,78,40,0.08);
    --watermark-h: rgba(122,78,40,0.24);
    --index-col: rgba(122,78,40,0.38);
    --index-h: rgba(122,78,40,0.9);
    --hint-color: rgba(122,78,40,0.5);
    --dot-off: rgba(122,78,40,0.2);
    --veil: #EDE5D8;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* عناصر النماذج مبتورّثش الخط افتراضيًا — نجبرها تاخد خط الموقع */
button, input, select, textarea, optgroup {
    font-family: inherit;
}

::selection {
    background: var(--gold);
    color: #fff;
}

html, body {
    width: 100%;
    min-height: 100%;
    background: var(--bg);
}

body {
    font-family: 'Tajawal', sans-serif;
    cursor: none;
    transition: background .4s;
    overflow-x: hidden;
}

/* ── CURSOR (ديسكتوب فقط) ── */
#cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--gold);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: width .3s, height .3s;
}

#cursor-ring {
    position: fixed;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(200,162,122,.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: width .4s var(--ease-silk), height .4s var(--ease-silk), opacity .3s;
}

body.hovered #cursor {
    width: 6px;
    height: 6px;
}

body.hovered #cursor-ring {
    width: 60px;
    height: 60px;
    opacity: .5;
}

/* ── HEADER ── */
header {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 200;
    padding: 20px clamp(20px, 5vw, 52px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(to bottom, var(--header-bg) 0%, transparent 100%);
    transition: background .4s;
}

.logo {
    font-family: 'Tajawal', sans-serif;
    font-weight: 900;
    font-size: clamp(20px, 4vw, 26px);
    letter-spacing: .06em;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    white-space: nowrap;
}

.header-right {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.hdr-pill {
    font-family: 'Tajawal', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--btn-color);
    padding: 6px 18px;
    border: 1px solid var(--btn-border);
    border-radius: 40px;
    background: none;
    cursor: none;
    white-space: nowrap;
    transition: background .25s, border-color .25s, color .25s, box-shadow .25s, transform .2s, filter .25s;
}

    .hdr-pill:hover {
        background: rgba(200,162,122,.22);
        border-color: var(--gold);
        color: var(--gold-lt);
        box-shadow: 0 0 0 1px rgba(200,162,122,.45), 0 6px 20px rgba(200,136,80,.35);
        transform: translateY(-2px) scale(1.04);
    }

    .hdr-pill:active {
        transform: translateY(0) scale(.97);
        box-shadow: 0 2px 8px rgba(200,136,80,.3);
        filter: brightness(.95);
    }

    .hdr-pill:focus-visible {
        outline: none;
        border-color: var(--gold-lt);
        box-shadow: 0 0 0 3px rgba(200,162,122,.45);
    }

#themeBtn {
    min-width: 40px;
    text-align: center;
    padding: 6px 12px;
}

/* ── BOTTOM STRIP ── */
.bottom-strip {
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    z-index: 50;
    padding: 0 clamp(20px, 5vw, 52px) 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.strip-hint {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 13px;
    color: var(--hint-color);
    letter-spacing: .08em;
    animation: ph 3.5s ease-in-out infinite;
    transition: color .4s;
}

@keyframes ph {
    0%,100% {
        opacity: .55
    }

    50% {
        opacity: 1
    }
}

.strip-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.strip-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--dot-off);
    transition: background .3s, width .3s;
}

    .strip-dot.active {
        background: var(--gold);
        width: 20px;
        border-radius: 3px;
    }

/* ══════════════════════════════════════
   ── LOADING SCREEN ──
══════════════════════════════════════ */
#veil {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--veil);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    transition: opacity .9s var(--ease-silk), visibility .9s, background .4s;
}

    #veil.hide {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    /* ── وضع "التنقّل بين الصفحات": نفس اللود بس مضغوط وسريع ── */
    #veil.replay #veil-logo span {
        animation-duration: .34s;
    }

        #veil.replay #veil-logo span:nth-child(1) {
            animation-delay: 0s;
        }

        #veil.replay #veil-logo span:nth-child(2) {
            animation-delay: .04s;
        }

        #veil.replay #veil-logo span:nth-child(3) {
            animation-delay: .08s;
        }

        #veil.replay #veil-logo span:nth-child(4) {
            animation-delay: .12s;
        }

        #veil.replay #veil-logo span:nth-child(5) {
            animation-delay: .16s;
        }

        #veil.replay #veil-logo span:nth-child(6) {
            animation-delay: .20s;
        }

    #veil.replay #veil-line-top,
    #veil.replay #veil-line-bot {
        animation-duration: .4s;
        animation-delay: 0s;
    }

    #veil.replay #veil-tagline {
        animation-duration: .35s;
        animation-delay: .28s;
    }

    #veil.replay #veil-progress {
        animation-duration: .7s;
        animation-delay: .1s;
    }

/* ── ambient glow rings behind logo ── */
#veil-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(200,136,60,.18) 0%, transparent 70%);
    animation: glow-pulse 2.4s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%,100% {
        transform: scale(1);
        opacity: .6;
    }

    50% {
        transform: scale(1.18);
        opacity: 1;
    }
}

/* ── decorative ring ── */
#veil-ring {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 1px solid rgba(200,162,122,.15);
    animation: ring-expand 2s ease-out infinite;
}

#veil-ring2 {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 1px solid rgba(200,162,122,.08);
    animation: ring-expand 2s ease-out .7s infinite;
}

@keyframes ring-expand {
    0% {
        width: 160px;
        height: 160px;
        opacity: .8;
    }

    100% {
        width: 340px;
        height: 340px;
        opacity: 0;
    }
}

/* ── logo wrapper ── */
#veil-logo-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 2;
}

/* ── top line ── */
#veil-line-top {
    width: 0;
    height: 1px;
    background: linear-gradient(to left, transparent, rgba(200,162,122,.6), transparent);
    animation: line-grow .8s .3s var(--ease-silk) forwards;
}

@keyframes line-grow {
    to {
        width: 160px;
    }
}

/* ── EVENTY letters — each animates in separately ── */
#veil-logo {
    font-family: 'Lato', sans-serif;
    font-weight: 300;
    font-size: clamp(32px, 9vw, 50px);
    letter-spacing: .34em;
    color: transparent;
    display: flex;
    direction: ltr;
    padding-inline-start: .34em;
}

    #veil-logo span {
        display: inline-block;
        background: var(--gold-grad);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        opacity: 0;
        transform: translateY(22px) scale(.9);
        animation: letter-in .6s var(--ease-silk) forwards;
    }

        #veil-logo span:nth-child(1) {
            animation-delay: .40s;
        }

        #veil-logo span:nth-child(2) {
            animation-delay: .50s;
        }

        #veil-logo span:nth-child(3) {
            animation-delay: .60s;
        }

        #veil-logo span:nth-child(4) {
            animation-delay: .70s;
        }

        #veil-logo span:nth-child(5) {
            animation-delay: .80s;
        }

        #veil-logo span:nth-child(6) {
            animation-delay: .90s;
        }

@keyframes letter-in {
    to {
        opacity: 1;
        transform: none;
    }
}

/* ── tagline under logo ── */
#veil-tagline {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 13px;
    font-weight: 300;
    letter-spacing: .22em;
    color: rgba(200,162,122,.55);
    opacity: 0;
    text-align: center;
    animation: fade-in .8s 1.1s ease forwards;
}

[dir="rtl"] #veil-tagline {
    font-family: 'Tajawal', sans-serif;
    font-style: normal;
    letter-spacing: .12em;
}

@keyframes fade-in {
    to {
        opacity: 1;
    }
}

/* ── bottom line ── */
#veil-line-bot {
    width: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(200,162,122,.6), transparent);
    animation: line-grow .8s .3s var(--ease-silk) forwards;
}

/* ── progress bar ── */
#veil-progress-wrap {
    margin-top: 48px;
    width: 160px;
    height: 1px;
    background: rgba(200,162,122,.12);
    border-radius: 2px;
    overflow: hidden;
    z-index: 2;
}

#veil-progress {
    height: 100%;
    width: 0%;
    background: var(--gold-grad);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(200,136,60,.6);
    animation: prog-fill 2s .5s var(--ease-silk) forwards;
}

@keyframes prog-fill {
    to {
        width: 100%;
    }
}

/* ── main content يبدأ تحت الهيدر ── */
main {
    display: block;
}

/* ── MOBILE ── */
@media (max-width: 768px) {
    html, body {
        height: auto;
    }

    body {
        cursor: auto;
    }

    #cursor, #cursor-ring {
        display: none;
    }

    .bottom-strip {
        display: none;
    }

    header {
        padding: 12px 16px;
    }

    .hdr-pill {
        padding: 6px 14px;
        font-size: 11px;
    }

        /* لمسة واضحة على أزرار الهيدر على الموبايل */
        .hdr-pill:active {
            background: rgba(200,162,122,.3) !important;
            border-color: var(--gold-lt) !important;
            color: var(--gold-lt) !important;
            box-shadow: 0 0 0 1px rgba(200,162,122,.5) !important;
            transform: scale(.95) !important;
        }

    #veil-progress-wrap {
        margin-top: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #veil-glow, #veil-ring, #veil-ring2, .strip-hint {
        animation: none !important;
    }

    #veil-logo span, #veil-tagline, #veil-line-top, #veil-line-bot, #veil-progress {
        animation-duration: .01ms !important;
        opacity: 1 !important;
        transform: none !important;
        width: auto;
    }
}

/* ── شريحة المستخدم المسجّل في هيدر الصفحة الرئيسية ── */
.hdr-user {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 170px;
    padding: 3px;
    padding-inline-end: 14px;
}

.hdr-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.hdr-user-avatar-ph {
    display: grid;
    place-items: center;
    background: var(--gold-grad);
    color: #fff;
}

.hdr-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hdr-logout {
    display: grid;
    place-items: center;
    padding: 6px 11px;
    text-decoration: none;
}

@media (max-width: 768px) {
    .hdr-user-name {
        display: none;
    }

    .hdr-user {
        padding: 3px;
    }
}

/* ── زرار تسجيل الدخول في هيدر الصفحة الرئيسية (للزائر غير المسجّل) ── */
.hdr-signin {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background: var(--gold-grad2);
    border-color: transparent;
    color: #fff;
    font-weight: 700;
}

    .hdr-signin:hover {
        background: var(--gold-grad2);
        border-color: transparent;
        color: #fff;
        filter: brightness(1.1);
    }
