/**
 * Simple Mobile Menu CSS
 * استایل‌های ساده برای منوی کاربری موبایل
 */

/* فقط در موبایل اعمال شود */
@media (max-width: 991px) {
    
    /* تنظیمات badge_count */
    .widget-header .badge_count {
        position: absolute;
        top: 3px;
        right: calc(50% - 25px);
        min-width: 18px;
        height: 21px;
        line-height: 20px;
        font-size: 11px;
        background: #d1a04d;
        color: #fff;
        border-radius: 15px;
        padding: 0 4px;
        text-align: center;
    }
    
    /* انیمیشن‌های سریع و نرم */
    .user-dropdown,
    .guest-dropdown {
        transition: opacity 0.2s ease, transform 0.2s ease !important;
    }
    
    .user-dropdown[style*="display: none"],
    .guest-dropdown[style*="display: none"] {
        opacity: 0 !important;
        transform: translateY(10px) !important;
    }
    
    /* دکمه‌های منو */
    .user-icon,
    .guest-icon {
        background: none;
        border: none;
        padding: 0;
        width: 100%;
        height: 100%;
        display: flex !important;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        font-size: 1.5rem;
        color: #333;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* رنگ آیکون کاربر لاگین شده */
    .user-menu .user-icon i {
        color: #d1a04d !important;
    }
    
    /* منوهای کشویی */
    .user-dropdown,
    .guest-dropdown {
        display: none;
        position: fixed !important;
        bottom: 70px !important; /* بالای نوار پایین با فاصله مناسب */
        top: auto !important;
        left: auto !important;
        right: 217px !important; /* موقعیت در سمت چپ */
        width: auto !important; /* عرض بر اساس محتوا */
        min-width: 200px; /* حداقل عرض */
        max-width: calc(100% - 20px); /* حداکثر عرض */
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.12), 0 -2px 10px rgba(0,0,0,0.08);
        z-index: 99999 !important;
        padding: 8px 0;
        margin: 0;
        overflow: visible;
        transform-origin: bottom left; /* انیمیشن از پایین چپ */
    }
    
    /* آیتم‌های منو */
    .user-dropdown .dropdown-item,
    .guest-dropdown .dropdown-item {
        display: flex;
        align-items: center;
        padding: 10px 20px;
        border-bottom: 1px solid #f5f5f5;
        text-decoration: none !important;
        color: #333;
        font-size: 14px;
        background: transparent;
        border: none;
        width: 100%;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        justify-content: flex-start;
        gap: 12px;
        white-space: nowrap; /* جلوگیری از شکستن متن */
        transition: background 0.2s ease;
    }
    
    /* حذف border از آخرین آیتم */
    .user-dropdown .dropdown-item:last-child,
    .guest-dropdown .dropdown-item:last-child {
        border-bottom: none;
    }
    
    /* حالت active */
    .user-dropdown .dropdown-item:active,
    .guest-dropdown .dropdown-item:active {
        background: #f5f5f5;
    }
    
    /* آیکون‌های منو */
    .dropdown-item i {
        font-size: 16px;
        color: #d1a04d;
        width: 20px;
        text-align: center;
        flex-shrink: 0;
    }
    
    /* متن آیتم‌ها */
    .dropdown-item span {
        flex: 1;
        text-align: right;
    }
    
    /* اطلاعات کاربر */
    .dropdown-item.user-info {
        background: #f8f8f8;
        border-bottom: 2px solid #d1a04d;
        font-weight: 500;
        pointer-events: none;
        cursor: default;
        padding: 12px 20px;
    }
    
    /* آیتم خروج */
    .dropdown-item.logout-item {
        color: #dc3545;
    }
    
    .dropdown-item.logout-item i {
        color: #dc3545;
    }
    
    /* مطمئن شویم منوها روی همه چیز نمایش داده می‌شوند */
    .area-widget-header-fixed {
        z-index: 9999;
    }
    
    .account-user {
        position: relative;
    }
    
    /* اطمینان از نمایش منو در حالت block */
    .user-dropdown[style*="display: block"],
    .guest-dropdown[style*="display: block"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    

    
    /* برای گوشی‌های خیلی کوچک */
    @media (max-width: 360px) {
        .user-dropdown,
        .guest-dropdown {
            min-width: 180px; /* عرض کمتر */
            right: 50% !important;
            transform: translateX(50%) !important; /* وسط‌چین کردن منو */
        }
    }
    
    /* اطمینان از نمایش آیکون منو */
    .icon_meni_bar a i.fas {
        font-family: "Font Awesome 5 Pro" !important;
        font-weight: 900 !important;
    }
    
    /* اطمینان از نمایش آیکون پنل ادمین */
    .dropdown-item i.fal.fa-user-circle {
        font-family: "Font Awesome 5 Pro" !important;
        font-weight: 300 !important;
    }
    
    /* جلوگیری از تغییر آیکون در موبایل */
    @media (max-width: 991px) {
        .dropdown-item i.fal.fa-user-circle:before {
            content: "\f2bd" !important; /* کد آیکون fa-user-circle */
        }
        
        /* اطمینان از عدم تغییر به fa-user-shield */
        .dropdown-item i.fas.fa-user-shield:before {
            content: "\f2bd" !important; /* اجبار به نمایش fa-user-circle */
        }
    }
}
