/* User Dropdown Responsive Styles */

/* Mobile Optimizations */
@media (max-width: 640px) {
    /* جلوگیری از overflow افقی */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    [x-data*="userDropdownOpen"] {
        position: relative !important;
    }
    
    [x-data*="userDropdownOpen"] > div[x-show] {
        z-index: 99999 !important;
        max-width: calc(100vw - 1rem) !important;
    }
    
    [x-data*="userDropdownOpen"] > div[x-show] a,
    [x-data*="userDropdownOpen"] > div[x-show] h6 {
        padding: 0.75rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    [x-data*="userDropdownOpen"] > div[x-show] a i {
        font-size: 1rem !important;
    }
    
}

/* Small Mobile */
@media (max-width: 375px) {
    [x-data*="userDropdownOpen"] > div[x-show] {
        max-width: calc(100vw - 1rem) !important;
    }
}

/* Touch Optimization */
@media (hover: none) and (pointer: coarse) {
    [x-data*="userDropdownOpen"] > div[x-show] a {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }
}

/* Dark Mode Mobile */
.dark-mode [x-data*="userDropdownOpen"] > div[x-show]::-webkit-scrollbar-track {
    background: #334155 !important;
}

.dark-mode [x-data*="userDropdownOpen"] > div[x-show]::-webkit-scrollbar-thumb {
    background: #10b981 !important;
}

@media (max-width: 768px) {
    /* کلید کاربر را دایره‌ای می‌کنیم در موبایل */
    .user-dropdown-btn {
        width: 45px !important;
        height: 45px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }
    
    /* مخفی کردن نام کاربری و آیکن dropdown در موبایل */
    .user-dropdown-btn span,
    .user-dropdown-btn .fa-chevron-down {
        display: none !important;
    }
    
    /* تنظیم اندازه عکس پروفایل در موبایل */
    .user-dropdown-btn .user-avatar-img {
        width: 100% !important;
        height: 100% !important;
        border-radius: 50% !important;
        object-fit: cover !important;
        margin: 0 !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
    }
    
    /* تنظیم اندازه آیکن کاربر در موبایل */
    .user-dropdown-btn .user-avatar-icon {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        font-size: 1.25rem !important;
    }
    
    /* اطمینان از تراز بودن با لوگو و منوی همبرگر */
    header .container > div:first-child,
    header .container > div:last-child {
        display: flex !important;
        align-items: center !important;
    }
    
    /* منوی همبرگر */
    header button[class*="md:hidden"],
    header .mobile-menu-button {
        width: 45px !important;
        height: 45px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    /* آیکن‌های منوی همبرگر */
    .mobile-menu-icon-bars {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .mobile-menu-icon-bars.hidden {
        display: none !important;
    }
    
    .mobile-menu-icon-times {
        display: none !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .mobile-menu-icon-times:not(.hidden) {
        display: inline-block !important;
    }
    
    /* لوگو */
    header .flex.items-center a[href*="home"],
    header .flex.items-center a[href*="welcome"],
    header .header-logo-link {
        display: flex !important;
        align-items: center !important;
        min-width: 0 !important;
        flex-shrink: 1 !important;
    }
    
    header .flex.items-center svg,
    header .header-logo-section svg {
        width: 35px !important;
        height: 35px !important;
        flex-shrink: 0 !important;
    }
    
    /* اطمینان از اعمال انیمیشن لوگو */
    header .logo-animated {
        animation: bounce-custom 3s infinite ease-in-out !important;
    }
    
    /* متن لوگو در موبایل */
    header .header-logo-text {
        font-size: 1.125rem !important;
        line-height: 1.2 !important;
    }
    
    /* دکمه فلش بک */
    header .header-back-button {
        flex-shrink: 0 !important;
        margin-right: 0.5rem !important;
    }
    
    header .header-back-button i {
        font-size: 1.125rem !important;
    }
    
    /* Container هدر */
    header .header-container {
        flex-wrap: nowrap !important;
        overflow: visible !important;
        gap: 0.5rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        position: relative !important;
    }
    
    /* Header padding در موبایل - فضای اضافی برای انیمیشن لوگو */
    header {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        overflow: visible !important;
    }
    
    /* بخش لوگو */
    header .header-logo-section {
        min-width: 0 !important;
        flex-shrink: 1 !important;
        overflow: visible !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* لینک لوگو */
    header .header-logo-link {
        overflow: visible !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* SVG لوگو - فضای کافی برای انیمیشن */
    header .logo-animated {
        position: relative !important;
        z-index: 2 !important;
        overflow: visible !important;
    }
    
    /* بخش User Actions */
    header .header-container > div:last-child {
        flex-shrink: 0 !important;
        min-width: fit-content !important;
    }
}
