/* static/css/menu.css - نسخه نهایی با لوگو در کنار منو (یک سطر) */
/* منوی اصلی: بدون پس‌زمینه، وسط‌چین، زیرخط دار، فلش برای زیرمجموعه‌ها */

/* ===================== */
/* بارگذاری فونت وزیرمتن */
/* ===================== */
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ===================== */
/* سبک‌های پایه */
/* ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', 'IRANSans', system-ui, sans-serif;
    background: #fefefe;
}

/* ===================== */
/* کانتینر هدر */
/* ===================== */

/* استایل آیکون پروفایل */
.profile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 20px;
    background: linear-gradient(135deg, #010207, #82d1e9);
    color: white;
    font-size: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.profile-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
.profile-icon svg {
    width: 22px;
    height: 22px;
    fill: white;
}

/* در موبایل */
@media (max-width: 768px) {
    .user-avatar {
        padding: 6px 10px;
    }
    
    .user-name-mobile {
        display: inline-block;
    }
    
    .user-fullname {
        display: none;
    }
    
    .dropdown-menu-user {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    
    .user-dropdown.active .dropdown-menu-user {
        transform: translateY(0);
    }
}

@media (min-width: 769px) {
    .user-name-mobile {
        display: none;
    }
}

/*================================*/

.site-header {

    background-color: #ffffff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid #eef2f6;
    position: relative;
    width: 100%;
    z-index: 1001;
}

/* ردیف اصلی - لوگو و دکمه همبرگری در کنار هم */
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 70px;
    position: relative;
}

/* ========== استایل لوگو ========== */
.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}
.logo-image {
    height: 50px;
    width: auto;
}

.logo-link:hover {
    opacity: 0.85;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: bold;
    font-family: 'Vazirmatn', system-ui, sans-serif;
    background: linear-gradient(135deg, #1e2a3a, #2c6e9e);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
}

/* ========== دکمه همبرگری ========== */
.menu-toggle {
    display: none;
    background: transparent;
    background-color: #9ddef245;
    border-color: rgb(226, 232, 240);
    color: #2c3e50;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
    font-family: 'Vazirmatn', system-ui, sans-serif;
    flex-shrink: 0;
    z-index: 1002;
    /* position: absolute; */
    order: 1;
    transform: translateY(0%);
    z-index: 10002;
}

.menu-toggle:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

/* ========== منوی اصلی ========== */
.main-nav {
    background: transparent !important;
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;;
}

.main-nav ul {
    direction: rtl;
    text-align: right;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* سطح اول منو */
.main-nav > ul {
    display: flex;
    justify-content: flex-end;
    background: transparent !important;
    gap: 4px;
    flex-wrap: wrap;
}

/* هر آیتم منو */
.main-nav li {
    direction: rtl;
    text-align: right;
    position: relative;
    list-style: none;
}

/* استایل لینک‌ها */
.main-nav li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    color: #2c3e50 !important;
    text-decoration: none;
    background: transparent !important;
    font-weight: bold;
    font-size: 0.95rem;
    font-family: 'Vazirmatn', system-ui, sans-serif;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    border-radius: 8px;
}

/* افکت زیرخط */
.main-nav li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 50%;
    width: 0;
    height: 2.5px;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(50%);
}

.main-nav li a:hover::after {
    width: calc(100% - 36px);
    right: 50%;
    transform: translateX(50%);
}

.main-nav li a:hover {
    color: #1e40af !important;
    background: rgba(59, 130, 246, 0.05) !important;
    transform: translateY(-1px);
}

/* فلش برای آیتم‌های دارای زیرمجموعه */
.main-nav li.has-dropdown > a::before {
    content: "▾";
    font-size: 0.7rem;
    display: inline-block;
    transition: transform 0.25s ease;
    color: #64748b;
    margin-right: 4px;
}

.main-nav li.has-dropdown:hover > a::before {
    transform: rotate(180deg);
    color: #3b82f6;
}

/* ========== زیرمنوها ========== */
.main-nav ul ul {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    padding: 8px 0;
    display: none;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.main-nav li:hover > ul {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* زیرمنو سطح سوم */
.main-nav ul ul ul {
    top: -8px;
    right: 100%;
    left: auto;
}

.main-nav ul ul li a {
    padding: 8px 20px;
    color: #334155 !important;
    background: transparent !important;
    font-weight: normal;
    font-size: 0.85rem;
    white-space: nowrap;
    width: 100%;
    display: block;
    text-align: right;
    border-radius: 8px;
    margin: 0 4px;
}

.main-nav ul ul li a::after {
    display: none;
}

.main-nav ul ul li a:hover {
    background: #f1f5f9 !important;
    color: #1e3a8a !important;
    transform: translateX(-3px);
}

/* فلش برای زیرمنوهای چندسطحی */
.main-nav ul ul .has-dropdown > a::before {
    content: "◀";
    float: left;
    font-size: 0.65rem;
    margin-right: 0;
    transition: transform 0.2s;
}

.main-nav ul ul .has-dropdown:hover > a::before {
    transform: translateX(-3px);
}

/* ========== خط جداکننده ========== */
.menu-content-divider {
    width: 100%;
    margin-top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #cbd5e1, #3b82f6, #cbd5e1, transparent);
    border-radius: 4px;
}

/* ========== محتوای اصلی ========== */
.content-wrapper {
    max-width: 1400px;
    margin: 30px auto 0 auto;
    /* padding: 0 20px; */
    position: relative;
    z-index: 1;
}

/* ===================== */
/* حالت دسکتاپ (بزرگتر از 992px) */
/* ===================== */
@media (min-width: 993px) {
    .header-row {
        flex-wrap: nowrap;
    }
    
    .logo-link {
        order: 1;
    }
    
    .main-nav {
        order: 2;
        justify-content: center;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    .main-nav > ul {
        display: flex !important;
    }
}

/* ===================== */
/* حالت تبلت (769px تا 992px) */
/* ===================== */
@media (min-width: 769px) and (max-width: 992px) {
    .header-row {
        flex-wrap: wrap;
        position: relative;
        justify-content: space-between;
    }
    
    .logo-link {
        order: 1;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    .main-nav {
        display: flex !important;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }

}

/* ===================== */
/* حالت موبایل (حداکثر 768px) - دکمه همبرگری در چپ */
/* ===================== */
@media (max-width: 768px) {

    .header-bottom-row {
        justify-content: space-between;
        grid-template-columns: auto auto;
    }
    
    /* دکمه همبرگری - چسبیده به چپ با position absolute */
    .menu-toggle {

        margin-left: 10px;
        display: block;
    }
    
    .main-nav {
        order: unset;
        width: 100%;

    }
    .main-nav.active {
        right: 0;
    }
    
    /* بخش کاربری در سمت چپ */
    .user-auth-section {
        margin-right: auto;
        position: absolute;
        right: 0;
    }
    
    .main-nav > ul {
        display: none !important;
        flex-direction: column;
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        background: #ffffff !important;
        gap: 4px;
        padding: 15px 10px;
        margin-top: 0;
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
        border: 1px solid #eef2f6;
    }
    
    .main-nav > ul.show {
        display: flex !important;
        position: absolute;
        top: calc(100% + 5px);
        left: 10px;
        right: 10px;
        z-index: 10000;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .main-nav li {
        width: 100%;
        text-align: center;
    }
    
    .main-nav li a {
        display: flex;
        justify-content: center;
        padding: 12px 16px;
        background: #f8fafc !important;
        border-radius: 40px;
        color: #1e293b !important;
        font-weight: bold;
        white-space: normal;
        border: 1px solid #e2e8f0;
        margin: 0 8px;
    }
    
    .main-nav li a::after {
        display: none;
    }
    
    .main-nav li a:hover {
        background: #eef2ff !important;
        transform: none;
    }
    
    .main-nav ul ul {
        position: static;
        background: #ffffff;
        backdrop-filter: none;
        box-shadow: none;
        padding: 0;
        margin-top: 6px;
        margin-right: 16px;
        border-radius: 12px;
        display: none;
        border: 1px solid #eef2ff;
        opacity: 1;
        transform: none;
        width: calc(100% - 16px);
    }
    
    .main-nav ul ul ul {
        margin-right: 16px;
        background: #f8fafc;
    }
    
    .main-nav li.open > ul {
        display: block;
    }
    
    .main-nav li.has-dropdown > a::before {
        content: "▾";
        font-size: 0.9rem;
        float: left;
        transition: transform 0.2s;
    }
    
    .main-nav li.has-dropdown.open > a::before {
        transform: rotate(180deg);
    }
    
    .main-nav ul ul li a {
        background: #f8fafc !important;
        padding: 10px 16px;
        margin: 2px 8px;
        border-radius: 30px;
        text-align: center;
        font-size: 0.85rem;
    }
    
    .main-nav ul ul li a:hover {
        background: #eef2ff !important;
    }
    
    .menu-content-divider {
        margin-top: 15px;
    }
    
    .content-wrapper {
        margin-top: 20px;
        position: relative;
        z-index: 1;
    }
}

/* ===================== */
/* بک‌دراپ و دسترسی */
/* ===================== */
.menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
}

.menu-backdrop.show {
    display: block;
}

.main-nav li a:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 8px;
}

.logo-link::after {
    display: none !important;
}

/* ======================================== */
/* ردیف بالای هدر (لوگو + اطلاعات تماس) */
/* ======================================== */

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0 10px 0;
    border-bottom: 1px solid #eef2f6;
    margin-bottom: 10px;
}

/* اطلاعات تماس سمت چپ */
.header-contact-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c3e50;
    font-size: 13px;
    font-weight: 500;
    background: #f8fafc;
    padding: 6px 14px;
    border-radius: 30px;
}

.contact-item svg {
    color: #3b82f6;
}

/* ======================================== */
/* اطلاعات تماس سمت راست */
/* ======================================== */

.header-contact-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c3e50;
    font-size: 13px;
    font-weight: 500;
    background: #f8fafc;
    padding: 6px 14px;
    border-radius: 30px;
    white-space: nowrap;
}

.contact-item svg {
    width: 16px;
    height: 16px;
    color: #3b82f6;
}

/* ======================================== */
/* تنظیمات دسکتاپ - لوگو چپ، منو وسط، اطلاعات راست */
/* ======================================== */

@media (min-width: 993px) {
    .header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
    }
    
    /* لوگو سمت چپ */
    .logo-link {
        order: 1;
        flex-shrink: 0;
    }
    
    /* منو در وسط */
    .main-nav {
        order: 2;
        flex: 1;
        display: flex;
        justify-content: center;
    }
    
    /* اطلاعات تماس سمت راست */
    .header-contact-info {
        order: 3;
        flex-shrink: 0;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    .main-nav > ul {
        display: flex !important;
    }
}

/* ======================================== */
/* تنظیمات تبلت (769px تا 992px) */
/* ======================================== */

@media (min-width: 769px) and (max-width: 992px) {
    .header-row {
        flex-wrap: wrap;
        position: relative;
        gap: 15px;
    }
    
    .logo-link {
        order: 1;
    }
    
    .header-contact-info {
        order: 2;
        margin-right: auto;
    }
    
    .menu-toggle {
        order: 3;
        display: block;
    }
    
}

/* ======================================== */
/* تنظیمات موبایل (حداکثر 768px) */
/* ======================================== */

@media (max-width: 768px) {


    .header-contact-info {
        order: 2;
        margin-right: auto;
        gap: 8px;
    }
    
    .contact-item {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .contact-item svg {
        width: 12px;
        height: 12px;
    }
    
}

/* موبایل خیلی کوچک */
@media (max-width: 576px) {
    .header-contact-info {
        gap: 5px;
    }
    
    .contact-item {
        padding: 3px 8px;
        font-size: 9px;
    }
    
    .logo-text {
        font-size: 0.9rem;
    }
    
    .logo-icon svg {
        width: 24px;
        height: 24px;
    }
}
/* خط اول: لوگو و اطلاعات تماس */
.header-top-row {
    position: relative;
    z-index: 1;
}

/* خط دوم: منو */
.header-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    position: relative;
}
/* افکت سایه هنگام اسکرول */
.header-bottom-row.sticky-scrolled {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid #eef2f6;
}
/* اطمینان از اینکه منو در sticky به درستی نمایش داده می‌شود */
.header-bottom-row.sticky-scrolled .main-nav li a {
    padding: 8px 15px;
    font-size: 0.9rem;
}

/* منو در مرکز قرار گیرد */
.main-nav {
    width: 100%;
    display: flex;
    justify-content: center;
}

.main-nav > ul {
    justify-content: center !important;
}

/* دکمه همبرگری در دسکتاپ مخفی */
@media (min-width: 993px) {

    .menu-toggle {
        display: none !important;
    }
    
    .main-nav > ul {
        display: flex !important;
    }
}

/* تنظیمات تبلت */
@media (min-width: 769px) and (max-width: 992px) {
    .header-top-row {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .header-bottom-row {
        justify-content: flex-start;
    }
    
    .main-nav {
        width: 100%;
    }
    
    .main-nav > ul {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-radius: 16px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
        padding: 15px;
        z-index: 1000;
    }
    
    .main-nav > ul.show {
        display: flex !important;
        flex-direction: column;
    }
    
    .main-nav li {
        width: 100%;
        text-align: center;
    }
}

/* تنظیمات موبایل */
@media (max-width: 768px) {

    .header-top-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "date logo"
            "buttons buttons";
        gap: 10px;
        align-items: center;
    }

    /* لوگو */
    .logo-link {
        grid-area: logo;
        justify-self: end;
        order: 1;
        flex: 0 0 auto;
        transform: translateX(0%);
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .logo-icon svg {
        width: 28px;
        height: 28px;
    }

    /* تاریخ */
    .header-contact-info {
        grid-area: date;
        justify-self: start;
        margin: 0;
    }

    /* دکمه‌ها */
    .header-buttons {
        grid-area: buttons;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }


}

/* موبایل خیلی کوچک */
@media (max-width: 576px) {
    .header-top-row {
        padding: 10px 0;
    }
    
    .contact-item {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
}

/* ======================================== */
/* دکمه‌های هدر - نسخه نهایی */
/* ======================================== */

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 40px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    cursor: pointer;
    border: none;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

/* افکت ریپل برای دکمه‌ها */
.header-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.header-btn:active::after {
    width: 100%;
    height: 100%;
    padding-top: 100%;
    opacity: 0;
    transition: 0s;
}

/* ======================================== */
/* انواع دکمه‌ها */
/* ======================================== */

/* نوع اولیه (primary) */
.header-btn.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.header-btn.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* نوع ثانویه (secondary) */
.header-btn.btn-secondary {
    background: #64748b;
    color: white;
    box-shadow: 0 2px 6px rgba(100, 116, 139, 0.2);
}

.header-btn.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

/* نوع خطی (outline) */
.header-btn.btn-outline {
    background: transparent;
    border: 2px solid #3b82f6;
    color: #3b82f6;
}

.header-btn.btn-outline:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
    border-color: #3b82f6;
}

/* نوع متنی (text) */
.header-btn.btn-text {
    background: transparent;
    color: #3b82f6;
    padding: 8px 12px;
}

.header-btn.btn-text:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* نوع گرادیانت (gradient) */
.header-btn.btn-gradient {
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    background-size: 200% 200%;
    color: white;
    animation: gradientShift 3s ease infinite;
}

.header-btn.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* نوع موفقیت (success) - اضافی */
.header-btn.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.header-btn.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

/* نوع هشدار (warning) - اضافی */
.header-btn.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.header-btn.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}

/* نوع خطر (danger) - اضافی */
.header-btn.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.header-btn.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* ======================================== */
/* آیکون دکمه */
/* ======================================== */

.btn-icon {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

/* افکت حرکت آیکون در هاور */
.header-btn:hover .btn-icon {
    transform: scale(1.1);
}

/* آیکون در دکمه خطی */
.header-btn.btn-outline .btn-icon {
    color: #3b82f6;
}

.header-btn.btn-outline:hover .btn-icon {
    color: white;
}

/* ======================================== */
/* اندازه‌های مختلف دکمه (اختیاری) */
/* ======================================== */

/* دکمه کوچک */
.header-btn.btn-sm {
    padding: 5px 12px;
    font-size: 11px;
}

.header-btn.btn-sm .btn-icon {
    font-size: 12px;
}

/* دکمه بزرگ */
.header-btn.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}

.header-btn.btn-lg .btn-icon {
    font-size: 18px;
}

/* ======================================== */
/* دکمه با آیکون فقط */
/* ======================================== */

.header-btn.btn-icon-only {
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
}

.header-btn.btn-icon-only .btn-text {
    display: none;
}

.header-btn.btn-icon-only .btn-icon {
    margin: 0;
    font-size: 18px;
}

/* ======================================== */
/* ریسپانسیو */
/* ======================================== */

@media (max-width: 992px) {
    .header-buttons {
        gap: 8px;
    }
    
    .header-btn {
        display: none;
        padding: 6px 14px;
        font-size: 12px;
    }
    
    .btn-icon {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .header-buttons {
        gap: 6px;
    }
    
    .header-btn {
        padding: 5px 12px;
        font-size: 11px;
    }
    
    /* در موبایل مخفی کردن متن و نمایش فقط آیکون */
    .header-btn:not(.btn-text) .btn-text {
        display: none;
    }
    
    .header-btn:not(.btn-text) {
        padding: 6px 10px;
    }
    
    .header-btn .btn-icon {
        margin: 0;
        font-size: 14px;
    }
    
    /* دکمه متنی در موبایل */
    .header-btn.btn-text {
        padding: 5px 8px;
    }
    
    .header-btn.btn-text .btn-text {
        display: inline;
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .header-buttons {
        gap: 4px;
    }
    
    .header-btn {
        padding: 4px 8px;
    }
    
    .header-btn .btn-icon {
        font-size: 12px;
    }
    
    /* دکمه گرد برای موبایل‌های خیلی کوچک */
    .header-btn.btn-primary,
    .header-btn.btn-secondary,
    .header-btn.btn-gradient {
        padding: 6px;
        border-radius: 50%;
        width: 32px;
        height: 32px;
    }
    
    .header-btn.btn-primary .btn-text,
    .header-btn.btn-secondary .btn-text,
    .header-btn.btn-gradient .btn-text {
        display: none;
    }
    
    .header-btn.btn-primary .btn-icon,
    .header-btn.btn-secondary .btn-icon,
    .header-btn.btn-gradient .btn-icon {
        margin: 0;
    }
}

/* ======================================== */
/* حالت غیرفعال */
/* ======================================== */

.header-btn.disabled,
.header-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ======================================== */
/* انیمیشن لودینگ برای دکمه (اختیاری) */
/* ======================================== */

.header-btn.loading {
    position: relative;
    color: transparent !important;
}

.header-btn.loading::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ========== استایل‌های بخش احراز هویت کاربر ========== */

.user-auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    margin-left: 15px;
}

/* دکمه‌های ورود و ثبت‌نام */
.auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.login-btn {
    background: transparent;
    color: #333;
    border-color: #ddd;
}

.login-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
    text-decoration: none;
}

.register-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.register-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a0 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}

/* منوی کشویی کاربر */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 30px;
    background: #f5f5f5;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    background: #e8e8e8;
}

.avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.user-name-mobile {
    font-weight: 500;
    color: #333;
    display: none;
}

.dropdown-arrow {
    font-size: 10px;
    color: #666;
    transition: transform 0.3s ease;
}

.user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu-user {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 220px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 10px;
}

.user-dropdown.active .dropdown-menu-user {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.dropdown-header strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.dropdown-header small {
    color: #666;
    font-size: 12px;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: #f5f5f5;
    text-decoration: none;
    color: #333;
}

.item-icon {
    font-size: 16px;
    width: 24px;
}

.logout-form {
    margin: 0;
}

.logout-btn {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: #e53e3e;
}

.logout-btn:hover {
    background: #fff5f5;
    color: #c53030;
}
