/* Dropdown CSS */

.dropdown-component {
    position: relative;
    width: 100%;
    margin: var(--gap-sm) 0;
}

.dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 10px 16px;
    margin: 0;
    position: relative;
}

.dropdown-text {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center content */
    gap: 8px;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dropdown-label-prefix {
    opacity: 0.8;
    margin-right: 4px;
    font-size: 0.9em;
    flex-shrink: 0;
    width: 65px;
    /* Fixed width to ensure text centering stability */
    text-align: left;
}

.dropdown-arrow {
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 8px;
    transition: transform 0.3s ease;
    width: 12px;
}

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

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--panel-bg-solid, #2a2a3e);
    /* Fallback */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-top: 4px;
    padding: 4px 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center the text! */
    transition: background 0.2s;
    color: var(--text-secondary, #ccc);
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main, #fff);
}

.dropdown-item.selected {
    background: rgba(var(--primary-color-rgb, 74, 144, 226), 0.2);
    color: var(--primary-color, #4a90e2);
    font-weight: bold;
}

.item-icon {
    margin-left: 8px;
}