/* User Dropdown Custom Styles (Bootstrap-like) */
.user-dropdown { 
    position: relative; 
    display: inline-block; 
}

.user-dropdown-btn {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 0;
    padding: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.user-dropdown-btn:focus, .user-dropdown-btn.active {
    outline: none;
    box-shadow: 0 0 0 2px #b6d4fe;
    border-color: #86b7fe;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 110%;
    min-width: 280px; /* Increased from 200px for better mobile experience */
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px; /* Added rounded corners */
    box-shadow: 0 8px 25px rgba(0,0,0,0.15); /* Enhanced shadow */
    z-index: 99999; /* Very high z-index to ensure visibility */
    padding: 0; /* Removed padding to control spacing internally */
    list-style: none;
    max-width: 90vw; /* Ensure it doesn't overflow on mobile */
}

.user-dropdown-menu.show { 
    display: block !important; /* Force display */
}

.user-dropdown-item, .user-dropdown-item-text {
    padding: 16px 20px; /* Increased padding for better touch targets */
    font-size: 16px; /* Increased font size for better readability */
    color: #212529;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: block;
    text-decoration: none;
    min-height: 48px; /* Minimum touch target size */
    display: flex;
    align-items: center;
}

.user-dropdown-item:hover {
    background: #f8f9fa;
    text-decoration: none;
    color: #212529;
}

.user-dropdown-item:active {
    background: #e9ecef;
}

.user-dropdown-divider {
    height: 1px;
    margin: 8px 0; /* Increased margin */
    background: #e9ecef;
    border: none;
}

.user-dropdown-item-text.text-muted {
    color: #6c757d;
    font-size: 14px; /* Slightly larger than before */
    padding: 12px 20px; /* Adjusted padding */
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    .user-dropdown {
        position: relative;
        z-index: 99998; /* High z-index for mobile */
    }
    
    .user-dropdown-menu {
        min-width: 250px;
        right: -10px; /* Slight offset to prevent edge cutoff */
        max-width: calc(100vw - 20px); /* Ensure it fits on screen */
        z-index: 99999; /* Very high z-index for mobile */
    }
    
    .user-dropdown-item, .user-dropdown-item-text {
        padding: 18px 20px; /* Even bigger touch targets on mobile */
        font-size: 16px;
        min-height: 52px;
    }
    
    .user-dropdown-item-text.text-muted {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .user-dropdown-divider {
        margin: 10px 0;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .user-dropdown-menu {
        min-width: 220px;
        right: -15px;
    }
    
    .user-dropdown-item, .user-dropdown-item-text {
        padding: 20px 20px; /* Maximum touch target size */
        font-size: 16px;
        min-height: 56px;
    }
    
    .user-dropdown-item-text.text-muted {
        padding: 16px 20px;
    }
}