@use '../utils' as *;

/*----------------------------------------*/
/*  Select2 customize
/*----------------------------------------*/
.select2-container--default {
    .select2-results__option--highlighted[aria-selected] {
        background-color: rgba($white, $alpha: 0.2) !important;
        color: var(--td-white) !important;
    }

    .select2-selection {
        background-color: rgba($white, $alpha: 0.12);
        border: 1px solid rgba($white, $alpha: 0.12);

        &:hover {
            border-color: rgba($white, $alpha: 0.1);
        }
    }

    .select2-selection--single {
        height: 50px;
        line-height: 50px;
        padding-inline-start: 6px;
        height: 50px;
        line-height: 50px;
        @include flexbox();
        align-items: center;

        .select2-selection__arrow {
            top: 6px;
        }
    }

    .select2-search--dropdown {
        .select2-search__field {
            height: 40px;
        }
    }
}

.select2-container--default.select2-container--focus {
    .select2-selection {
        border-width: 1px;
        border-color: rgba($white, $alpha: 0.12) !important;
    }
}

.select2-container--default.select2-container--open {
    .select2-selection {
        border-width: 1px;
        border-color: rgba($white, $alpha: 0.12) !important;
    }
}

.select2-primary {
    .select2-container--default {
        .select2-selection--multiple {
            .select2-selection__choice {
                background: rgba(115, 103, 240, .16) !important;
                color: var(--td-primary) !important;
            }
        }
    }
}

.select2-search__field {
    height: 40px;
}

.select2-dropdown {
    border: 1px solid rgba($white, $alpha: 0.12) !important;
    background-color: var(--td-black-alt) !important;
    color: var(--td-white) !important;
}

.select2-container--default {
    .select2-selection--single {
        .select2-selection__rendered {
            color: rgba($white, $alpha: 0.7);
            font-size: 14px;
        }
    }
}

.select2-container--default .select2-results__option {
    color: rgba($white, $alpha: 0.7);
    font-weight: 500;
    font-size: 14px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    background-image: none;
    width: 8px;
    height: 8px;
    border-bottom: 1.5px solid var(--td-text-primary);
    border-right: 1.5px solid var(--td-text-primary);
    font-size: 16px;
    content: "";
    top: 50% !important;
    transform: translateY(-50%) rotate(45deg);
    border: 5px solid;
    border-top-color: transparent;
    border-left-color: transparent;
    background-color: transparent;
    transition: all ease-in-out 0.2s;
    -webkit-border-radius: 2px;
    -moz-border-radius: 2px;
    -o-border-radius: 2px;
    -ms-border-radius: 2px;
    border-radius: 2px;
    -webkit-transform-origin: 66% 66%;
    -ms-transform-origin: 66% 66%;
    transform-origin: 66% 66%;
}

.select2-container--default {
	&.select2-container--above {
		&.select2-container--open {
			.select2-selection__arrow {
				b {
					transform: rotate(223deg);
				}
			}
		}
	}
	.select2-search--dropdown {
		.select2-search__field {
			border: 1px solid rgba($white, $alpha: 0.6);
		}
	}
	&.select2-container--open {
		.select2-selection {
			border-width: 1px;
			border-color: var(--td-primary) !important;
		}
	}
}
