/* Header/style.css - نسخه نهایی با فونت Estedad */

/* ===== Font Face ===== */
@font-face {
    font-family: 'Estedad';
    src: url('/webfonts/Estedad-Thin.woff2') format('woff2');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('/webfonts/Estedad-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('/webfonts/Estedad-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('/webfonts/Estedad-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('/webfonts/Estedad-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('/webfonts/Estedad-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('/webfonts/Estedad-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('/webfonts/Estedad-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Estedad';
    src: url('/webfonts/Estedad-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    background: transparent;
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================ */
/* هدر اصلی */
/* ============================================ */
.header-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    max-width: 100vw;
    overflow: visible;
}

.header-main {
    background: rgba(8, 14, 20, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 180, 80, 0.12);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1001;
    width: 100%;
    overflow: visible;
}

.header-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 12px;
    overflow: visible;
}

/* ============================================ */
/* لوگو */
/* ============================================ */
.logo-section {
    flex-shrink: 0;
    max-width: 50%;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #FFB347, #FF7E33);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    color: #1e2a3e;
    flex-shrink: 0;
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

.logo-text {
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFB347, #FF7E33);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text-mobile {
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, #FFB347, #FF7E33);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* ============================================ */
/* منوی ناوبری دسکتاپ */
/* ============================================ */
.nav-desktop {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
    overflow: visible;
}

.nav-list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
    white-space: nowrap;
}

.nav-list li {
    display: inline-flex;
    flex-shrink: 0;
}

.nav-list a {
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    color: rgba(212, 230, 245, 0.85);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-list a:hover {
    color: #FFB347;
    background: rgba(255, 180, 71, 0.08);
}

/* ============================================ */
/* بخش کاربری دسکتاپ */
/* ============================================ */
.user-section {
    flex-shrink: 0;
}

.avatar-dropdown {
    position: relative;
    display: inline-block;
}

.avatar-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border: 1px solid rgba(255, 180, 80, 0.15);
    border-radius: 50px;
    background: rgba(44, 76, 110, 0.3);
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: inherit;
    color: inherit;
    outline: none;
    white-space: nowrap;
}

.avatar-trigger:hover {
    background: rgba(44, 76, 110, 0.5);
    border-color: rgba(255, 180, 80, 0.3);
}

.avatar-trigger.active {
    background: rgba(44, 76, 110, 0.6);
    border-color: #FFB347;
}

.avatar-image {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 180, 80, 0.3);
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(44, 76, 110, 0.5);
    border: 2px solid rgba(255, 180, 80, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8899aa;
    flex-shrink: 0;
}

.avatar-name {
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    color: #eef4ff;
    font-size: 13px;
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-arrow {
    color: #8899aa;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.avatar-trigger.active .avatar-arrow {
    transform: rotate(180deg);
}

/* ============================================ */
/* منوی dropdown دسکتاپ */
/* ============================================ */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: rgba(15, 25, 40, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 180, 80, 0.1);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.96);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    overflow: visible;
    max-height: none;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: rgba(15, 25, 40, 0.98);
    border-top: 1px solid rgba(255, 180, 80, 0.1);
    border-right: 1px solid rgba(255, 180, 80, 0.1);
    transform: rotate(-45deg);
    border-radius: 3px 0 0 0;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(212, 230, 245, 0.9);
    text-decoration: none;
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
}

.dropdown-item:hover {
    background: rgba(255, 180, 80, 0.08);
    color: #FFB347;
}

.dropdown-icon {
    font-size: 16px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.dropdown-badge {
    margin-right: auto;
    background: #ff4444;
    color: white;
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
    line-height: 18px;
    flex-shrink: 0;
}

.dropdown-badge.notification-badge {
    background: #FFB347;
    color: #1e2a3e;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 4px 12px;
}

/* ============================================ */
/* هدر موبایل */
/* ============================================ */
.header-mobile {
    display: none;
}

.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: #eef4ff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================ */
/* منوی موبایل (اسلاید از راست) - منوی اصلی */
/* ============================================ */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-mobile {
    position: fixed;
    top: 0;
    right: -280px;
    bottom: 0;
    width: 260px;
    max-width: 75vw;
    background: linear-gradient(180deg, #0e1a26 0%, #0a1118 100%);
    z-index: 9999;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 180, 80, 0.08);
}

.nav-mobile.open {
    right: 0;
}

.nav-mobile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 2px;
    background: rgba(255, 180, 71, 0.02);
}

.nav-mobile-title {
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    color: #eef4ff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-mobile-list {
    list-style: none;
    padding: 4px 0;
    margin: 0;
}

.nav-mobile-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.nav-mobile-list li:last-child {
    border-bottom: none;
}

.nav-mobile-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(212, 230, 245, 0.85);
    text-decoration: none;
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
    border-radius: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-mobile-list a:hover,
.nav-mobile-list a:active {
    background: rgba(255, 180, 71, 0.06);
    color: #FFB347;
}

/* ============================================ */
/* منوی اواتار موبایل - اسلاید از راست (باریک‌تر) */
/* ============================================ */
.mobile-avatar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.mobile-avatar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.avatar-slide-menu {
    position: fixed;
    top: 0;
    right: -160px;
    bottom: 0;
    width: 140px;
    max-width: 55vw;
    background: linear-gradient(180deg, #0e1a26 0%, #0a1118 100%);
    z-index: 9998;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 180, 80, 0.08);
}

.avatar-slide-menu.open {
    right: 0;
}

.avatar-slide-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 12px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 2px;
    background: rgba(255, 180, 71, 0.02);
}

.avatar-slide-title {
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    color: #eef4ff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.avatar-slide-list {
    list-style: none;
    padding: 4px 0;
    margin: 0;
}

.avatar-slide-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.avatar-slide-list li:last-child {
    border-bottom: none;
}

.avatar-slide-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: rgba(212, 230, 245, 0.85);
    text-decoration: none;
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s ease;
    border-radius: 0;
}

.avatar-slide-list a:hover,
.avatar-slide-list a:active {
    background: rgba(255, 180, 71, 0.06);
    color: #FFB347;
}

.avatar-slide-badge {
    margin-right: auto;
    background: #ff4444;
    color: white;
    font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
    line-height: 16px;
}

.avatar-slide-badge.notification-badge {
    background: #FFB347;
    color: #1e2a3e;
}

.avatar-slide-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 4px 10px;
}

/* ============================================ */
/* ریسپانسیو - تبلت و موبایل */
/* ============================================ */
@media (max-width: 1024px) {
    .header-desktop {
        display: none !important;
    }
    
    .header-mobile {
        display: block !important;
    }
    
    .header-container {
        height: 56px;
        padding: 0 12px;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }
    
    .hamburger-btn {
        display: flex !important;
        flex-shrink: 0;
    }
    
    .mobile-avatar {
        flex-shrink: 0;
        margin-right: 0;
        padding-right: 0;
    }
    
    .mobile-trigger {
        padding: 2px !important;
        border-radius: 50% !important;
        width: 38px !important;
        height: 38px !important;
        justify-content: center;
        border-color: rgba(255, 180, 80, 0.2);
        background: rgba(44, 76, 110, 0.2);
        border: 1px solid rgba(255, 180, 80, 0.2);
    }
    
    .mobile-trigger .avatar-image {
        width: 32px;
        height: 32px;
        border-width: 2px;
    }
    
    .mobile-trigger .avatar-placeholder {
        width: 32px;
        height: 32px;
    }
    
    .mobile-trigger .avatar-placeholder svg {
        width: 16px;
        height: 16px;
    }
    
    .mobile-trigger .avatar-name,
    .mobile-trigger .avatar-arrow {
        display: none !important;
    }
    
    .logo-text-mobile {
        font-size: 14px;
        font-weight: 700;
    }
    
    .mobile-avatar .dropdown-menu {
        display: none !important;
    }
}

/* ============================================ */
/* موبایل کوچک (حداکثر 480px) */
/* ============================================ */
@media (max-width: 480px) {
    .header-container {
        height: 48px;
        padding: 0 10px;
        gap: 6px;
        overflow: visible;
    }
    
    .logo-icon-mobile {
        width: 28px;
        height: 28px;
        background: linear-gradient(135deg, #FFB347, #FF7E33);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Estedad', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
        font-size: 12px;
        font-weight: 900;
        color: #1e2a3e;
        flex-shrink: 0;
    }
    
    .logo-text-mobile {
        font-size: 12px;
        font-weight: 700;
        background: linear-gradient(135deg, #FFB347, #FF7E33);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        white-space: nowrap;
    }
    
    .hamburger-btn .hamburger-line {
        width: 18px;
        height: 2px;
    }
    
    .hamburger-btn {
        gap: 4px;
        padding: 3px;
    }
    
    .hamburger-btn.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(3px, 4px);
    }
    
    .hamburger-btn.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(3px, -4px);
    }
    
    .mobile-trigger {
        width: 34px !important;
        height: 34px !important;
        padding: 2px !important;
    }
    
    .mobile-trigger .avatar-image {
        width: 28px;
        height: 28px;
    }
    
    .mobile-trigger .avatar-placeholder {
        width: 28px;
        height: 28px;
    }
    
    .mobile-trigger .avatar-placeholder svg {
        width: 14px;
        height: 14px;
    }
    
    .nav-mobile {
        width: 240px;
        right: -240px;
        max-width: 80vw;
    }
    
    .avatar-slide-menu {
        width: 120px;
        right: -120px;
        max-width: 50vw;
    }
    
    .nav-mobile-header {
        padding: 14px 16px 10px;
    }
    
    .nav-mobile-title {
        font-size: 14px;
        font-weight: 700;
    }
    
    .nav-mobile-list a {
        padding: 10px 16px;
        font-size: 12px;
        gap: 8px;
        font-weight: 600;
    }
    
    .avatar-slide-header {
        padding: 14px 10px 10px;
    }
    
    .avatar-slide-title {
        font-size: 12px;
        font-weight: 700;
    }
    
    .avatar-slide-list a {
        padding: 10px 12px;
        font-size: 11px;
        gap: 8px;
        font-weight: 600;
    }
    
    .avatar-slide-badge {
        font-size: 8px;
        padding: 1px 5px;
        min-width: 16px;
        line-height: 14px;
    }
}

/* ============================================ */
/* تبلت */
/* ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-container {
        height: 60px;
        padding: 0 16px;
        overflow: visible;
    }
    
    .logo-text-mobile {
        font-size: 16px;
        font-weight: 700;
    }
    
    .logo-icon-mobile {
        width: 32px;
        height: 32px;
        font-size: 14px;
        font-weight: 900;
    }
    
    .mobile-trigger {
        width: 42px !important;
        height: 42px !important;
    }
    
    .mobile-trigger .avatar-image {
        width: 36px;
        height: 36px;
    }
    
    .mobile-trigger .avatar-placeholder {
        width: 36px;
        height: 36px;
    }
    
    .nav-mobile {
        width: 300px;
        right: -300px;
        max-width: 65vw;
    }
    
    .avatar-slide-menu {
        width: 150px;
        right: -150px;
        max-width: 45vw;
    }
    
    .nav-mobile-list a {
        padding: 14px 22px;
        font-size: 14px;
        font-weight: 600;
    }
    
    .avatar-slide-list a {
        padding: 14px 16px;
        font-size: 13px;
        font-weight: 600;
    }
}

/* ============================================ */
/* تنظیمات نمایش Badge */
/* ============================================ */
.dropdown-badge[style*="display: none"],
.avatar-slide-badge[style*="display: none"] {
    display: none !important;
}

/* ============================================ */
/* انیمیشن‌ها */
/* ============================================ */
@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-menu.show {
    animation: dropdownSlideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}