@import "@scss_mixins";

.container {
    position: relative;
}

.dropdown_toggle_button {
    position: relative;
    background-color: var(--dark_950_color);
    min-width: 20rem;
    padding: 0.8rem 1.4rem;
    cursor: pointer;
    border-radius: 0.4rem;
    &:hover {
        background-color: var(--dark_925_color);
    }
    &:active {
        background-color: var(--dark_975_color);
    }
    &.is_pending {
        pointer-events: none;
    }
    &.is_disabled {
        pointer-events: none;
        .dropdown_selected_text, .arrow_left_svg {
            color: var(--dark_550_color);
        }
    }
}

.dropdown_selected_text {
    font-size: 1.4rem;
    padding-right: 2.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown_content_wrapper {
    display: none;
    position: absolute;
    top: 100%; // Position it below the toggle button
    right: 0;
    min-width: 20rem;
    z-index: 1;
    &.is_opened {
        display: block;
    }
    &.is_disabled {
        pointer-events: none;
        .value_text {
            color: var(--dark_550_color);
        }
    }
}

.dropdown_content {
    background-color: var(--dark_900_color);
    border: 0.1rem solid var(--dark_600_color);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    white-space: nowrap;
    max-height: 20rem;
    overflow-y: scroll;
}

.value_button {
    background-color: var(--dark_875_color);
    padding: 1.2rem;
    cursor: pointer;
    &:hover {
        background-color: var(--dark_800_color);
    }
    &:active {
        background-color: var(--dark_900_color);
    }
}

.value_text {
    font-size: 1.4rem;
}

.loader {
    @include loader(2rem, 0.2rem, right, 0);
}

.arrow_left_svg {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translate(-50%, -50%) rotate(-90deg);
    width: 1.4rem;
    &.is_opened {
        transform: translate(-50%, -50%) rotate(90deg);
    }
}