/*
 * Dropdown Z-Index Fixes - Enhanced Version
 * Resolves dropdown positioning conflicts with sidebar navigation
 * Ensures notification and user profile dropdowns appear correctly
 */

/* Ultra-aggressive dropdown fix - Force visibility */
.dropdown-menu,
.topbar-dropdown .dropdown-menu,
.notification-list .dropdown-menu,
.dropdown-menu.show {
    z-index: 1020 !important;
    position: absolute !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Hide by default unless .show class is present */
.dropdown-menu:not(.show) {
    display: none !important;
}

/* Force Bootstrap dropdowns to appear above sidebar elements */
.dropdown-menu.show {
    z-index: 1020 !important;
    position: absolute !important;
    display: block !important;
}

/* Specific fixes for topbar dropdowns */
.topbar-custom .dropdown-menu {
    z-index: 1020 !important;
}

/* Notification dropdown specific fix - using actual class names from topbar.blade.php */
.notification-list.topbar-dropdown .dropdown-menu {
    z-index: 1020 !important;
    right: 0 !important;
    left: auto !important;
    transform: translateX(0) !important;
}

/* User profile dropdown specific fix */
.topbar-dropdown .dropdown-menu {
    z-index: 1020 !important;
    right: 0 !important;
    left: auto !important;
    transform: translateX(0) !important;
}

/* Ensure dropdown toggle buttons are clickable */
.dropdown-toggle {
    position: relative;
    z-index: 1015 !important;
}

/* Make sure dropdowns work on mobile too */
@media (max-width: 768px) {
    .dropdown-menu {
        z-index: 1050 !important;
    }
}

/* Override any conflicting z-index values from sidebar */
.topbar-custom {
    position: relative;
    z-index: 1010;
}

/* Ensure proper stacking context */
.header-dropdown,
.notification-dropdown,
.profile-dropdown {
    position: relative;
    z-index: 1015;
}

/* Fix for dropdown backdrop */
.dropdown-backdrop {
    z-index: 1015 !important;
}

/* Profile dropdown contrast fixes */
.profile-dropdown {
    background: #fff !important;
    border: 1px solid #dee2e6 !important;
}

.profile-dropdown .dropdown-item {
    color: #495057 !important;
    background: transparent !important;
}

.profile-dropdown .dropdown-item:hover,
.profile-dropdown .dropdown-item:focus {
    color: #fff !important;
    background: #355a84 !important;
}

.profile-dropdown .dropdown-item.active {
    color: #fff !important;
    background: #355a84 !important;
}

.profile-dropdown .dropdown-header {
    color: #6c757d !important;
    background: #f8f9fa !important;
}

/* Override any blue text in dropdowns */
.dropdown-menu .dropdown-item {
    color: #495057 !important;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    color: #fff !important;
    background-color: #355a84 !important;
}

/* Specific fix for profile dropdown */
.topbar-dropdown .profile-dropdown .dropdown-item {
    color: #495057 !important;
    background: #fff !important;
}

.topbar-dropdown .profile-dropdown .dropdown-item:hover {
    color: #fff !important;
    background: #355a84 !important;
}