/* ============================================
   Header Styles - استایل‌های هدر
   ============================================ */

.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.375rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.mobile-menu-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #7c3aed 0%, var(--primary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.mobile-menu-toggle:hover::before {
    opacity: 1;
}

.mobile-menu-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.mobile-menu-toggle i {
    position: relative;
    z-index: 1;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 400px;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--gray-400);
    font-size: 0.9375rem;
    z-index: 2;
    pointer-events: none;
    transition: all 0.3s ease;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--gray-50);
    color: var(--gray-900);
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-box input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(91, 33, 182, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.search-box input:focus + i,
.search-box:has(input:focus) i {
    color: #5b21b6;
    transform: scale(1.1);
}

.search-box:hover input {
    border-color: var(--gray-300);
    background-color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.search-box:hover i {
    color: var(--gray-500);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-item {
    position: relative;
}

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    color: var(--gray-700);
    transition: var(--transition);
    font-size: 1.125rem;
}

.icon-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

.icon-btn .badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Profile */
.user-profile {
    position: relative;
}

.profile-dropdown {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.profile-dropdown:hover {
    background-color: var(--gray-100);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gray-200);
    background: linear-gradient(135deg, #5b21b6, #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.username {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-900);
}

.profile-dropdown i {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 200px;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 1000;
    border: 1px solid var(--gray-200);
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    transition: var(--transition);
    font-size: 0.875rem;
}

.dropdown-item:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

.dropdown-item:hover {
    background-color: var(--gray-50);
    color: var(--gray-900);
}

.dropdown-item i {
    width: 18px;
    color: var(--gray-500);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--gray-200);
    margin: 0.5rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    .header {
        padding: 0 1rem;
        background: linear-gradient(135deg, #1a1625 0%, #0f0a1a 100%);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    .header-left {
        gap: 1rem;
    }
    
    .search-box {
        max-width: none;
        min-width: auto;
        flex: 1;
    }
    
    .search-box input {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.2);
        color: white;
    }
    
    .search-box input::placeholder {
        color: rgba(255, 255, 255, 0.5);
    }
    
    .search-box i {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .header-right {
        color: white;
    }
    
    .username {
        color: white;
    }
    
    .profile-dropdown {
        color: white;
    }
    
    .profile-dropdown:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    .header {
        padding: 0 1rem;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .search-box {
        max-width: 200px;
        min-width: 150px;
    }
    
    .search-box input {
        padding: 0.625rem 0.875rem 0.625rem 2.5rem;
        font-size: 0.8125rem;
    }
    
    .search-box i {
        right: 0.75rem;
        font-size: 0.875rem;
    }
    
    .username {
        display: none;
    }
    
    .profile-dropdown i {
        display: none;
    }
}

@media (max-width: 480px) {
    .search-box {
        display: none;
    }
}

