/* ============================================= */
/* استيراد الخط العربي (Tajawal) لترتيب المظهر */
/* ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

/* ============================================= */
/* 1. أساسيات وتصحيح الهيكل                     */
/* ============================================= */
:root {
    --primary-color: #1a2a45;
    --secondary-color: #bfa06a;
    --surface-color: #ffffff;
    /* جعلت اللون أكثر شفافية لظهور تأثير الزجاج */
    --nav-glass: rgba(255, 255, 255, 0.85);
    --shadow-soft: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
    /* تطبيق الخط على كامل الموقع */
}

body {
    padding-top: 110px;
    /* تعويض مساحة النافبار العلوية الأساسية */
}

ul,
li {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

a {
    text-decoration: none;
    transition: all 0.3s ease;
}

button {
    font-family: 'Tajawal', sans-serif;
}

/* ============================================= */
/* 2. حاوية النافبار (الكمبيوتر)                 */
/* ============================================= */
.main-nav-wrapper {
    position: fixed;
    top: 25px;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.main-nav-wrapper.scrolled {
    top: 10px;
}

.desktop-nav-container {
    display: flex;
    align-items: center;
    gap: 20px;
    pointer-events: auto;
}

/* ============================================= */
/* 3. القائمة الأفقية (الكبسولة الزجاجية)        */
/* ============================================= */
.nav-links {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 25px;
    padding: 12px 35px;

    /* تأثير الزجاج */
    background: var(--nav-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow-soft);
}

.nav-logo-li img {
    height: 42px;
    width: auto;
    vertical-align: middle;
    margin-left: 15px;
    transition: transform 0.3s;
}

.nav-logo-li img:hover {
    transform: scale(1.05);
}

.nav-links a {
    color: var(--primary-color);
    font-weight: 700;
    /* تعريض الخط قليلاً */
    font-size: 1rem;
    /* حجم مناسب للقراءة */
    position: relative;
    padding: 5px 0;
    letter-spacing: 0.3px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary-color);
}

/* الخط السفلي المتحرك */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2.5px;
    border-radius: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
    left: 0;
}

/* ============================================= */
/* 4. زر المستخدم والإشعارات                     */
/* ============================================= */
.auth-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--nav-glass);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.auth-btn:hover {
    background: #fff;
    color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.auth-btn:active {
    transform: scale(0.95);
}

/* أنيميشن الوميض للإشعارات */
@keyframes flash-red {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
        border-color: #e74c3c;
        color: #e74c3c;
    }

    70% {
        box-shadow: 0 0 0 12px rgba(231, 76, 60, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
        border-color: rgba(255, 255, 255, 0.6);
        color: var(--primary-color);
    }
}

.auth-btn.has-notification {
    animation: flash-red 1.5s infinite;
}

/* ============================================= */
/* 5. نافذة تسجيل الدخول (Modal)                 */
/* ============================================= */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 42, 69, 0.4);
    /* خلفية داكنة خفيفة */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
    backdrop-filter: blur(8px);
    /* تعتيم الخلفية */
}

.auth-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.auth-modal-content {
    background: #fff;
    padding: 40px 30px;
    border-radius: 25px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    max-height: 85vh;
    overflow-y: auto;
}

.auth-modal-overlay.open .auth-modal-content {
    transform: scale(1) translateY(0);
}

/* الحقول والأزرار */
.auth-form input {
    width: 100%;
    padding: 14px 15px;
    margin: 10px 0;
    border: 1px solid #eee;
    border-radius: 12px;
    box-sizing: border-box;
    background: #fcfcfc;
    font-size: 0.95rem;
    transition: 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(191, 160, 106, 0.1);
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 15px;
    transition: 0.3s;
}

.auth-submit-btn:hover {
    background: #253b5e;
    transform: translateY(-2px);
}

/* القوائم داخل المودال */
.notifications-list {
    text-align: right;
    margin-top: 20px;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

.notif-item {
    background: #fdfdfd;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    border-right: 4px solid var(--secondary-color);
    transition: 0.2s;
}

.notif-item:hover {
    background: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
}

/* ============================================= */
/* 6. الجوال (Mobile) - تصميم زجاجي أيضاً        */
/* ============================================= */
.mobile-header,
#mobile-nav-links {
    display: none;
}

@media (max-width: 992px) {
    body {
        padding-top: 80px;
        /* مساحة النافبار في الجوال */
    }

    .main-nav-wrapper {
        display: none !important;
    }

    .mobile-header {
        display: block;
        position: fixed;
        top: 0;
        width: 100%;
        height: 75px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        z-index: 1000;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    }

    .mobile-header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 100%;
        padding: 0 25px;
    }

    .nav-logo {
        display: flex;
        align-items: center;
        color: var(--primary-color);
        font-weight: 800;
        font-size: 1.1rem;
    }

    .nav-logo img {
        height: 38px;
        margin-left: 10px;
    }

    /* القائمة الجانبية للجوال */
    #mobile-nav-links {
        display: block;
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        height: 100vh;

        /* شفافية القائمة الجانبية */
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(15px);

        z-index: 1005;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
        padding-top: 20px;
    }

    #mobile-nav-links.active {
        right: 0;
    }

    #mobile-nav-links li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    }

    #mobile-nav-links a {
        display: flex;
        justify-content: space-between;
        padding: 18px 25px;
        color: var(--primary-color);
        font-weight: 600;
        font-size: 1rem;
    }

    #mobile-nav-links a:hover,
    #mobile-nav-links a.active {
        background: rgba(191, 160, 106, 0.1);
        color: var(--primary-color);
        padding-right: 35px;
        /* حركة بسيطة عند اللمس */
    }

    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(3px);
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}