/* ==============================================
   0. اصلاح باگ‌های اسکرول و Sticky
   ============================================== */
html, body {
    overflow-x: clip !important; /* حل مشکل اسکرول به چپ بدون از بین بردن sticky */
    position: relative;
}

/* ==============================================
   1. هدر شیشه‌ای ۳بعدی
   ============================================== */
.modern-header.up-glass-header {
    position: sticky !important;
    top: 0;
    z-index: 9999;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.65) 50%, rgba(255, 255, 255, 0.85) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    width: 100%;
}

.modern-header.up-glass-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.6) 50%, transparent 100%);
    pointer-events: none;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 78px;
    padding: 0 25px;
    direction: rtl;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    gap: 20px;
}

/* ==============================================
   2. لوگو با افکت درخشش
   ============================================== */
.brand.up-brand-shine {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 5px 15px;
    border-radius: 15px;
    overflow: hidden;
}
.brand-logo { max-height: 50px; width: auto; display: block; position: relative; z-index: 2; }
.site-title { font-size: 20px; font-weight: 900; color: #1a2b4c; position: relative; z-index: 2; }

.brand.up-brand-shine::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%);
    animation: upLogoShine 4s infinite; z-index: 3;
}
@keyframes upLogoShine { 0% { left: -100%; } 50% { left: 100%; } 100% { left: 100%; } }

/* ==============================================
   3. منوی دسکتاپ
   ============================================== */
.main-nav ul { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; align-items: center; }
.main-nav a { display: inline-block; text-decoration: none; color: #1a2b4c; font-weight: 600; font-size: 14.5px; padding: 10px 16px; border-radius: 10px; transition: 0.3s; white-space: nowrap; }
.main-nav a:hover { color: #b8860b; background: rgba(212, 175, 55, 0.12); }

/* ==============================================
   4. دکمه‌های آیکون دسکتاپ (طلایی درخشان)
   ============================================== */
.desktop-actions-wrapper { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.up-icon-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.25) 100%);
    border: 1px solid rgba(212, 175, 55, 0.4); border-radius: 12px;
    color: #b8860b; font-weight: 700; font-size: 13px; cursor: pointer;
    text-decoration: none; transition: all 0.3s ease; position: relative; overflow: hidden; white-space: nowrap;
}
.up-icon-btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
    transition: left 0.6s ease; pointer-events: none;
}
.up-icon-btn:hover::before { left: 100%; }
.up-icon-btn:hover { background: linear-gradient(135deg, rgba(212, 175, 55, 0.3) 0%, rgba(212, 175, 55, 0.45) 100%); border-color: #D4AF37; color: #8b6508; transform: translateY(-2px); }
.up-icon-btn svg { flex-shrink: 0; filter: drop-shadow(0 1px 2px rgba(212, 175, 55, 0.3)); transition: transform 0.3s ease; }
.up-icon-btn:hover svg { transform: scale(1.15) rotate(-5deg); }

.up-user-avatar { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #D4AF37, #b8860b); color: #fff; font-weight: 800; font-size: 13px; border-radius: 50%; flex-shrink: 0; }
.up-dropdown-arrow { transition: transform 0.3s ease; opacity: 0.7; }
.up-icon-dropdown.open .up-dropdown-arrow { transform: rotate(180deg); }

/* ==============================================
   5. منوهای کشویی (Dropdowns) - با رنگ سرمه‌ای
   ============================================== */
.up-icon-dropdown { position: relative; }

.up-dropdown-menu {
    position: absolute; top: calc(100% + 10px); left: 0;
    min-width: 260px; background: #ffffff;
    border: 1px solid rgba(212, 175, 55, 0.3); border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(212, 175, 55, 0.1);
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    padding: 10px; direction: rtl; z-index: 1000;
}
.up-icon-dropdown.open .up-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.up-dropdown-header { display: flex; align-items: center; gap: 12px; padding: 12px; background: #f8f9fa; border-radius: 12px; margin-bottom: 8px; border: 1px solid #eee; }
.up-dropdown-avatar { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #D4AF37, #b8860b); color: #fff; font-weight: 800; font-size: 18px; border-radius: 12px; flex-shrink: 0; }
.up-dropdown-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.up-dropdown-info strong { color: #1a2b4c; font-size: 14px; font-weight: 800; }

/* آیتم‌های منو با رنگ سرمه‌ای */
.up-dropdown-item {
    display: flex; align-items: center; gap: 10px; padding: 11px 14px;
    color: #1a2b4c; text-decoration: none; border-radius: 10px;
    font-size: 13.5px; font-weight: 600; transition: all 0.2s ease; margin-bottom: 2px;
}
.up-dropdown-item svg { width: 18px; height: 18px; stroke: #1a2b4c; transition: 0.2s; }
.up-dropdown-item:hover { background: rgba(26, 43, 76, 0.05); transform: translateX(-3px); }
.up-dropdown-item:hover svg { stroke: #b8860b; }

.up-dropdown-divider { height: 1px; background: #eee; margin: 8px 0; }

.up-dropdown-logout { color: #dc3545 !important; }
.up-dropdown-logout svg { stroke: #dc3545 !important; }
.up-dropdown-logout:hover { background: rgba(220, 53, 69, 0.08) !important; }
.up-dropdown-logout:hover svg { stroke: #c82333 !important; }

/* زیرمنوی پشتیبانی */
.up-support-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; text-decoration: none; color: #1a2b4c; transition: 0.2s; margin-bottom: 4px; }
.up-support-row .up-support-icon { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: #f8f9fa; border: 1px solid #eee; border-radius: 10px; flex-shrink: 0; }
.up-support-row .up-support-icon svg { width: 18px; height: 18px; stroke: #1a2b4c; }
.up-support-row div { display: flex; flex-direction: column; gap: 2px; }
.up-support-row small { color: #888; font-size: 11px; }
.up-support-row strong { color: #1a2b4c; font-size: 13.5px; font-weight: 700; }
.up-support-row:hover { background: rgba(26, 43, 76, 0.05); }

/* ==============================================
   6. دکمه همبرگری و منوی موبایل (پیش‌فرض مخفی)
   ============================================== */
.mobile-toggle { display: none; }
.mobile-menu-drawer {
    position: fixed; top: 0; right: -320px; width: 300px; height: 100vh;
    background: #fff; z-index: 99999; transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1); display: flex; flex-direction: column;
}
.mobile-menu-drawer.open { right: 0; }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-bottom: 1px solid #eee; font-weight: bold; color: #1a2b4c; font-size: 16px; }
.mobile-menu-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #dc3545; }
.mobile-menu-content { padding: 20px; overflow-y: auto; flex: 1; }
.mobile-nav-list { list-style: none; padding: 0; margin: 0; }
.mobile-nav-list li a { display: block; padding: 12px 15px; border-bottom: 1px solid #f5f5f5; color: #1a2b4c; text-decoration: none; font-weight: 600; font-size: 14px; }
.mobile-quick-links { margin-top: 30px; display: grid; gap: 10px; }
.mob-quick-btn { display: block; text-align: center; padding: 12px; background: #f8f9fa; border-radius: 8px; text-decoration: none; color: #1a2b4c; font-weight: bold; border: 1px solid #eee; }
.mob-logout { color: #dc3545; }

/* ==============================================
   7. ریسپانسیو (موبایل و تبلت)
   ============================================== */
@media (max-width: 900px) {
    /* مخفی کردن منوی دسکتاپ و آیکون‌ها */
    .main-nav, .desktop-actions-wrapper { display: none !important; }

    /* نمایش دکمه همبرگری (سمت چپ) */
    .mobile-toggle {
        display: flex; flex-direction: column; gap: 5px; background: rgba(212, 175, 55, 0.15);
        border: 1px solid rgba(212, 175, 55, 0.3); padding: 10px; border-radius: 10px; cursor: pointer;
    }
    .mobile-toggle span { display: block; width: 22px; height: 2.5px; background: #b8860b; border-radius: 5px; }
    
    /* چیدمان هدر موبایل: لوگو راست، همبرگر چپ */
    .header-inner { height: 68px; padding: 0 15px; }
    
    /* پوشش تاریک پشت منو */
    .mobile-menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 99998; display: none; }
    .mobile-menu-overlay.active { display: block; }
}
/* ==============================================
   زیرمنوی پشتیبانی (طراحی ساده و مینیمال)
   ============================================== */
.up-support-menu-minimal {
    min-width: 230px !important; 
    padding: 15px !important;
}

.up-support-simple-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* بخش ساعت */
.up-support-hours-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1a2b4c; /* رنگ سرمه‌ای */
    direction: rtl;
}

.up-support-hours-wrap svg {
    flex-shrink: 0;
}

/* دکمه تماس (آیکون) */
.up-support-call-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(26, 43, 76, 0.05); /* پس‌زمینه محو سرمه‌ای */
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.up-support-call-icon:hover {
    background: rgba(26, 43, 76, 0.1);
    transform: scale(1.1);
}

.up-support-call-icon svg {
    stroke: #1a2b4c; /* رنگ سرمه‌ای */
}
/* ==============================================
   زیرمنوی حساب کاربری (طراحی ۲ ستونه با خط طلایی)
   ============================================== */
.up-user-menu-dropdown {
    min-width: 340px !important; /* افزایش عرض برای جا شدن دو ستون */
    padding: 15px !important;
}

/* گرید ۲ در ۲ */
.up-user-menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* دو ستون مساوی */
    gap: 5px;
    position: relative;
    padding: 10px 0;
    margin: 10px 0;
}

/* خط طلایی نازک ممتد در وسط */
.up-user-menu-grid::after {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 50%; /* دقیقا وسط */
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, rgba(212, 175, 55, 0.5) 10%, rgba(212, 175, 55, 0.5) 90%, transparent 100%);
    transform: translateX(-50%);
}

/* استایل آیتم‌های داخل گرید */
.up-user-menu-grid .up-dropdown-item {
    margin: 0;
    padding: 12px 10px;
    justify-content: flex-start;
    border-radius: 8px;
    transition: 0.2s;
}

/* تغییر افکت هاور در حالت گرید (به جای انتقال به چپ، فقط رنگ پس‌زمینه تغییر کند) */
.up-user-menu-grid .up-dropdown-item:hover {
    background: rgba(26, 43, 76, 0.05);
    transform: none;
    box-shadow: none;
}

/* یکپارچه‌سازی رنگ آیکون‌های داخل گرید به سرمه‌ای */
.up-user-menu-grid .up-dropdown-item svg {
    stroke: #1a2b4c !important;
    transition: 0.2s;
}

/* تغییر رنگ آیکون به طلایی هنگام هاور */
.up-user-menu-grid .up-dropdown-item:hover svg {
    stroke: #b8860b !important;
}
