/* =========================================
   متغیرهای پایه (برای هماهنگی با style.css)
   ========================================= */
:root {
    --glass-bg: rgba(10, 15, 20, 0.65);
    --glass-border: rgb(247 154 154 / 18%);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(18px);
    --accent-gold: #d8aa5d;
    --text-primary: #f5f7fb;
    --text-muted: #b8c1d1;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =========================================
   ساختار اصلی هدر
   ========================================= */
.site-header {
    position: sticky;
    top: 1rem;
    z-index: 1000;
    display: grid;
    grid-template-columns: auto 1fr auto;
    /* gap: 1.5rem; */
    align-items: center;
    padding: 0.8rem 1.5rem;
    margin: 0 auto;
    width: 95%;
    /* max-width: 1400px; */
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--navbar-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    /* border: 1px solid var(--glass-border); */
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
}

/* =========================================
   برند (لوگو و متن)
   ========================================= */
.brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, var(--accent-gold) 35%, rgba(255, 255, 255, 0.15) 80%);
    box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.18);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: all ease 0.5s;
}

.brand-mark:hover {
    transform: scale(2) rotate(360deg);
}

.brand-mark img {
    width: 80%;
    height: auto;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-text strong {
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.brand-text small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =========================================
   ناوبری دسکتاپ
   ========================================= */
.nav {
    /* display: flex; */
    display: none;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.lg-nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    width: 30%;
    text-wrap-mode: nowrap;
}

.lg-nav-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.3s ease;
}

.lg-nav-link:hover {
    color: var(--accent-gold);
    background: rgba(216, 170, 93, 0.1);
    border-color: rgba(216, 170, 93, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(216, 170, 93, 0.15);
}

.lg-nav-link.active {
    box-shadow: -1px 9px 24px rgb(21 38 60), inset 0 1px 10px rgb(255 202 101), inset 0 -1px 7px 0px rgb(255 147 21 / 81%);
    text-shadow: 0px 1px 20px #937a00;
    /* transform: translateY(-2px); */
    padding-inline: 90px;
    padding-block: 10px;
    justify-content: center;
}

.lg-nav-link:hover svg {
    transform: scale(1.1);
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-gold);
    background: rgba(216, 170, 93, 0.1);
    border-color: rgba(216, 170, 93, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(216, 170, 93, 0.15);
}

.nav-link.active {
    box-shadow: -1px 9px 24px rgb(21 38 60), inset 0 1px 10px rgb(255 202 101), inset 0 -1px 7px 0px rgb(255 147 21 / 81%);
    text-shadow: 0px 1px 20px #937a00;
    transform: translateY(-2px);
    /* padding-inline: 90px; */
    padding-block: 10px;
    justify-content: center;
}

.nav-link:hover svg {
    transform: scale(1.1);
}

/* =========================================
   دکمه‌های اکشن (ورود/ثبت‌نام)
   ========================================= */
.header-actions {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 0.8rem;
}


/* =========================================
   دکمه همبرگری موبایل
   ========================================= */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    cursor: var(--cursor-pointer);
    position: relative;
    z-index: 1002;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: var(--transition-smooth);
}

.menu-toggle span:nth-child(1) {
    top: 12px;
}

.menu-toggle span:nth-child(2) {
    top: 19px;
}

.menu-toggle span:nth-child(3) {
    top: 26px;
}

.menu-toggle.active span:nth-child(1) {
    top: 19px;
    transform: translateX(-50%) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    top: 19px;
    transform: translateX(-50%) rotate(-45deg);
}

/* =========================================
   منوی کاربر (Dropdown)
   ========================================= */
.user-menu-wrapper {
    position: relative;
    display: flex;
}

.profile-trigger {
    padding: 0.3rem;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all ease 0.5s;
    font-size: large;
    color: var(--accent);
    cursor: var(--cursor-pointer);
}

.profile-trigger:hover {
    border-color: var(--accent-gold);
    background: rgba(216, 170, 93, 0.1);

}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 1.4rem);
    left: 0;
    width: 280px;
    background: var(--body-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.5rem;
    /* backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); */
    /* opacity: 0;
    visibility: hidden; */
    display: none;
    transform: translateY(10px);
    transition: var(--transition-smooth);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    overflow-y: scroll;
    max-height: 500px;
    scrollbar-width: none;
}

/* .user-menu-wrapper:hover .user-dropdown-menu, */
.user-dropdown-menu.open {
    /* opacity: 1;
    visibility: visible; */
    display: block;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
    text-align: center;
}

.dropdown-header strong {
    display: block;
    color: var(--accent-gold);
    margin-bottom: 0.2rem;
}

.dropdown-header small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.dropdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition-smooth);
    font-size: 0.9rem;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    opacity: 0.7;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent);
}

.dropdown-item:hover svg {
    opacity: 1;
    color: var(--accent-gold);
}

.dropdown-item.logout {
    color: #ff7c7c;
    margin-top: 0.5rem;
    border-top: 1px solid var(--glass-border);
}

.dropdown-item.logout:hover {
    background: rgba(255, 124, 124, 0.1);
    color: #ff7c7c;
}

.badge {
    margin-right: auto;
    background: var(--accent-gold);
    color: #000;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 0.1rem 0.4rem;
    border-radius: 99px;
}

/* استایل خاص برای بخش ادمین */
.admin-section {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.section-title {
    display: block;
    padding: 0 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.sidebar-header {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--accent-gold);
    /* margin-bottom: 1rem; */
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile-section {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
    padding: 1rem;
    border-bottom: 1px solid var(--accent-gold);
}

.auth-buttons {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 1rem;
    border-bottom: 1px solid var(--accent-gold);
    /* margin-bottom: 1rem; */
}

.auth-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
}

.auth-btn.primary {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.btn.themeToggleBtn {
    padding: 5px 10px;
}

.lg-nav {
    overflow-x: scroll;
    width: 95%;
    display: flex;
    gap: 5px;
    scrollbar-width: none;
    background: var(--border-color);
    padding: 5px;
    border-radius: 30px;
    margin: auto;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-sidebar-logout {}

/* =========================================
   ریسپانسیو (موبایل و تبلت)
   ========================================= */
@media (max-width: 900px) {
    .site-header {
        grid-template-columns: auto 1fr auto;
        padding: 0.6rem 1rem;
    }

    .menu-toggle {
        display: block;
        justify-self: left;
    }

    .nav {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 110%;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 35rem;
        background: rgb(9 11 13 / 75%);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 1rem;
        gap: 0.5rem;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 1001;
        overflow-y: auto;
        scrollbar-width: none;
        border: 1px solid var(--border);
        border-radius: 10px;
    }

    .nav.open {
        right: 0;
    }

    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 0.5rem 1rem;
        margin: 1rem 0 0 0;
        font-size: 1.1rem;
        /* border-radius: 12px; */
        border: 1px solid transparent;
    }

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--glass-border);
    }

    /* در موبایل، دکمه‌های اکشن را داخل منو یا زیر هدر قرار می‌دهیم */
    /* اما طبق درخواست: در حالت گوشی بجز لوگو و برند و دکمه سایدبار چیزی نباشد */
    /* پس header-actions را در موبایل مخفی می‌کنیم و در منو اضافه می‌کنیم */

    .header-actions {
        display: none !important;
        /* در هدر اصلی مخفی شود */
    }

    /* اضافه کردن بخش اکشن به داخل منوی موبایل */
    .mobile-actions {
        margin-top: auto;
        padding-top: 2rem;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .mobile-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* اگر کاربر لاگین است، پروفایل را در پایین منو نشان بده */
    .mobile-user-profile {
        margin-top: 2rem;
        padding-top: 1rem;
        border-top: 1px solid var(--glass-border);
    }

    .mobile-user-profile .profile-trigger {
        width: 100%;
        height: auto;
        padding: 1rem;
        border-radius: 12px;
        display: flex;
        align-items: center;
        gap: 1rem;
        background: rgba(255, 255, 255, 0.05);
    }

    .mobile-user-profile .user-name {
        display: block;
        font-size: 1rem;
        color: var(--text-primary);
    }

    .mobile-user-profile .user-dropdown-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        /* پیش‌فرض بسته */
        margin-top: 0.5rem;
        box-shadow: none;
        background: transparent;
        border: none;
    }

    .mobile-user-profile .user-dropdown-menu.open {
        display: block;
        bottom: 0px;
    }

    .sidebar-overlay {
        background: #00000033;
        width: 100%;
        height: 110vh;
        position: fixed;
        z-index: 1000;
        backdrop-filter: blur(5px);
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .nav.is-open {
        justify-content: start;
        padding-top: 0.8rem;
    }
}

@media (max-width: 700px) {
    .lg-nav {
        display: none;
    }

    .theme-toggle-box {
        display: none;
    }
}

/* =========================================
   انیمیشن‌ها
   ========================================= */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slideUpAnimation {
    animation: slideUp 0.3s ease-out forwards;
}