/*
         Rulestex Select v0.1.0
 An open-source web-based option picker
        © 2025 Codemaster United

Basic Stylesheet (with customizations)
*/

:root {
    --shadow-color: #00A0FF;
    --list-max-height: 300px;
}

/* Dropdown Toggle */
.dropdown-toggle {
    background: transparent;
    border: 1px solid grey;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dropdown-toggle .toggle-label {
    font-size: 0.85rem;
}

.dropdown-toggle .toggle-arrow {
    transition: transform 0.3s;
    width: 20px;
    aspect-ratio: 1;
}

.dropdown-toggle.list-showing .toggle-arrow {
    transform: rotate(180deg);
}


/* Dropdown List */
.dropdown-list {
    position: absolute;
    background: white;
    border-radius: 12px;
    max-height: var(--list-max-height);
    overflow-x: hidden;
    overflow-y: scroll;
    max-width: 200px;
    padding: 12px;
    box-shadow: 0 0 5px 0px var(--shadow-color);
    transform: scale(0.95);
    transform-origin: top center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 999;
}

.dropdown-list.showing {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.dropdown-list .dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    width: 100%;
    transition: background 0.2s ease;
}

.dropdown-list .dropdown-option > * {
    display: block;
    height: auto;
}

.dropdown-list .dropdown-option .icon, .dropdown-toggle .toggle-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dropdown-list .dropdown-option .label {
    font-size: 0.85rem;
}

.dropdown-list .dropdown-option.selected {
    background: #D8F2FF80;
}

.dropdown-list .dropdown-option .icon svg, .dropdown-toggle .toggle-icon svg {
    fill: currentColor;
    width: 20px;
    height: 20px;
}

/* Custom styles */
.dropdown-toggle {
    background: transparent;
    color: white;
    border-color: white;
}

.dropdown-list {
    background: var(--dark-color);
    --shadow-color: #0056FF80;
}

.dropdown-list .dropdown-option.selected {
    background: rgba(0,0,0,0.5);
    box-shadow: 0 0 1px 1px #0056FF40;
}