/* Dropdown Styles */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    min-width: 18rem;
    max-width: 24rem;
    width: max-content;
    background-color: rgba(12, 12, 30, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9999;
    pointer-events: none;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.dropdown-item:hover {
    background-color: rgba(0, 255, 255, 0.1);
    color: rgb(0, 255, 255);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.dropdown-arrow.active {
    transform: rotate(180deg);
}

/* Ensure dropdown container has proper positioning */
.dropdown-group {
    position: relative;
}

/* Smart dropdown positioning to prevent off-screen issues */
.dropdown-menu {
    left: 0;
    right: auto;
}

/* If dropdown would go off-screen to the right, position it to the left */
.dropdown-group:hover .dropdown-menu {
    left: auto;
    right: 0;
}

/* Ensure dropdown items are properly spaced */
.dropdown-menu > div {
    padding: 0.5rem 0;
}

/* Mobile dropdown styles - Enhanced for better responsive behavior */
@media (max-width: 480px) {
    .dropdown-menu {
        position: static;
        width: 100%;
        margin-top: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: rgba(12, 12, 30, 0.9);
        border: none;
        border-radius: 0;
        box-shadow: none;
        min-width: auto;
        max-width: none;
    }
    
    .dropdown-item {
        padding: 1rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        white-space: normal;
        text-overflow: initial;
        overflow: visible;
        font-size: 0.95rem;
    }
    
    .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .dropdown-trigger {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .dropdown-menu {
        position: static;
        width: 100%;
        margin-top: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: rgba(12, 12, 30, 0.85);
        border: none;
        border-radius: 0;
        box-shadow: none;
        min-width: auto;
        max-width: none;
    }
    
    .dropdown-item {
        padding: 0.875rem 1.125rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        white-space: normal;
        text-overflow: initial;
        overflow: visible;
        font-size: 0.9rem;
    }
    
    .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .dropdown-trigger {
        font-size: 0.95rem;
    }
}

/* Responsive dropdown positioning for medium screens */
@media (min-width: 769px) and (max-width: 1024px) {
    .dropdown-menu {
        min-width: 20rem;
        max-width: 28rem;
    }
}

/* Ensure dropdown doesn't go off-screen on small desktop */
@media (min-width: 1025px) and (max-width: 1280px) {
    .dropdown-menu {
        min-width: 19rem;
        max-width: 26rem;
    }
}
