@use '../../shared/option/styles/option.mixin';
@use '../../shared/select/styles/select.mixin';
@use '../../styles/bootstrap/mixins/text-truncate';
@use '../../styles/variables';

@mixin thy-tree-select-option() {
    &.disabled {
        pointer-events: unset;
    }
    &:not(.disabled) {
        &.hover,
        &:hover {
            .thy-tree-select-option-icon {
                color: variables.$gray-500;
            }
        }
    }
}

.thy-tree-select-selection-text {
    @include text-truncate.text-truncate();
}

.thy-tree-select-dropdown {
    @include select.thy-select-dropdown();

    .thy-tree-select-options {
        @include select.thy-select-options-container();

        .loading-more {
            min-height: auto;
            text-align: center;
        }

        .thy-tree-select-node {
            .thy-tree-select-option-icon {
                color: variables.$gray-500;
                &:hover {
                    cursor: variables.$hand-cursor;
                    color: variables.$gray-600;
                }
                .thy-icon-caret-right-down,
                .thy-icon-caret-right {
                    padding-right: 5px;
                    font-size: variables.$font-size-md;
                }
                .thy-icon-minus-square,
                .thy-icon-plus-square {
                    padding-right: 10px;
                    font-size: variables.$font-size-base;
                }
            }
            .thy-tree-select-option-text {
                margin-left: 6px;
                display: flex;
                align-items: center;
                @include text-truncate.text-truncate();
            }
        }

        .thy-option-item {
            @include option.thy-option();
            @include thy-tree-select-option();
        }

        .cdk-virtual-scroll-content-wrapper {
            width: 100%;
        }
    }

    &.thy-tree-select-dropdown-multiple {
        .thy-tree-select-options {
            .thy-option-item {
                @include option.thy-multiple-option();
                @include thy-tree-select-option();
            }
        }
    }
}
