﻿/* Dashboard Tab Dropdown Styles */

.CQDashboardDropDown {
    position: relative;
    display: inline-block;
    z-index: 1000; /* Very high z-index to be above all other elements */
}

.CQDashboardDropDown-menu {
    display: none;
    position: fixed; /* Changed from absolute to fixed to escape stacking context */
    top: auto; /* Will be set via JavaScript */
    left: auto; /* Will be set via JavaScript */
    transform: translateX(-50%);
    background-color: #ffffff;
    min-width: 150px;
    max-width: 300px;
    box-shadow: rgba(0, 0, 0, 0.08) 0px 1px 24px 0px;
    border-radius: 8px;
    z-index: 1000; /* Highest possible z-index to ensure visibility */
    list-style: none;
    margin: 8px 0 0 0;
    padding: 12px 8px;
    border: none;
    max-height: calc(100vh - var(--global-nav-height,44px) - 8px);
    overflow: hidden auto;
}

.CQDashboardDropDown-menu.show {
    display: block;
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.CQDashboardDropDown-item {
    margin: 0;
    padding: 0;
}

.CQDashboardDropDown-item a {
    display: block;
    padding: 5px 5px 5px 5px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
  
}

    .CQDashboardDropDown-item a:hover {
        background-color: rgb(33, 37, 41);
        color: #fff; /* Ensure readable text on dark hover background */
    }

.CQDashboardDropDown-item a:active {
    background-color: #e8e8e8;
}

/* Add a small arrow indicator to show dropdown exists */
.dxbl-tab:has(.CQDashboardDropDown)::after {
    content: '▼';
    font-size: 10px;
    margin-left: 6px;
    opacity: 0.6;
    vertical-align: middle;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .CQDashboardDropDown-menu {
        min-width: 180px;
        left: 0;
        transform: none;
    }
    
    .CQDashboardDropDown-item a {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Dark theme support (if applicable) */
@media (prefers-color-scheme: dark) {
    .CQDashboardDropDown-menu {
        /* Use a dark background for dark mode */
        background-color: #1e1e1e;
        border-color: #444;
    }

    .CQDashboardDropDown-item a {
        color: #ddd;
    }

    .CQDashboardDropDown-item a:hover {
        /* subtle light overlay for hover in dark mode */
        background-color: rgba(255, 255, 255, 0.06);
        color: #fff;
    }

    .CQDashboardDropDown-item a:active {
        background-color: #111;
    }
}

/* Scrollbar styling for the dropdown menu */
.CQDashboardDropDown-menu::-webkit-scrollbar {
    width: 8px;
}

.CQDashboardDropDown-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.CQDashboardDropDown-menu::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.CQDashboardDropDown-menu::-webkit-scrollbar-thumb:hover {
    background: #555;
}
