﻿/* CSS for Select Multiple */
.select2-container--bootstrap5 .select2-selection--multiple.form-select-sm {
    min-height: 2.5rem;
    height: 2.5rem;
    background-color: #fcfcfc;
    border: 1px solid var(--bs-gray-300);
    border-radius: 0.5rem;

    /* Line Dimensions for Search Field (inline) */
    .select2-search__field {
        font-weight: 400;
        font-size: var(--size-14);
        line-height: var(--size-20);
        height: 1.25rem;
        width: 100%;
    }

    .select2-selection__rendered {
        display: inline-flex;
        min-width: 0;
        /* The list of items can shrink, the rest of the space is for the search field */
    }

    /* Prevent overflow in the search field */
    .select2-search--inline {
        min-width: 0;
    }

    /* Style applied by JS when the select component has selected items */
    .select2-search__field.constrained {
        max-width: 2.5rem;
        white-space: nowrap;
    }

    /* Style for Tags */
    .etc {
        margin-top: .1rem;
        margin-right: .35rem;
        margin-bottom: .1rem;
    }

    .select2-selection__choice,
    .etc {
        border-radius: var(--radius-4);
        height: 1.25rem;
        background-color: var(--bs-gray-200);
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
        padding: 0.08rem 0.4375rem;
        white-space: nowrap;
    }

    .select2-selection__choice:not(.etc) {
        min-width: 0;
    }

    /* Style for Tags Text */
    .select2-selection__choice .select2-selection__choice__display {
        font-weight: 500;
        font-size: var(--size-14);
        line-height: var(--size-20);
        order: 1;
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

}

/* Style for Tags Remove Button */
.select2-container--bootstrap5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice .select2-selection__choice__remove {
    content: "\e9b5";
    font-family: keenicons-outline;
    font-size: var(--size-14);
    line-height: var(--size-16);
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    order: 2;
    position: relative;
    transform: none;
    top: unset;
    color: var(--bs-gray-700);
    opacity: 1;
}

/* Styles for Select Multiple when HasIcon prop is True */
.magnifying-glass-icon~.select2.select2-container .select2-selection--multiple .select2-selection__rendered {
    padding-left: var(--spacing-24);
}

.magnifying-glass-icon~.select2-container--bootstrap5 .select2-selection--multiple.form-select-sm .select2-selection__choice:first-child {
    margin-left: var(--spacing-8);
}

/* Styles for Dropdown of Select (Simple and Multiple) */
.select2-search--dropdown {
    display: flex;
    align-items: center;
    margin: var(--spacing-8);
}

.select2-container--bootstrap5 .select2-dropdown {
    padding: var(--spacing-4);
    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.06), 0px 6px 12px -2px rgba(0, 0, 0, 0.08) !important;
    min-width: fit-content;
}

.select2-container--bootstrap5 .select2-dropdown .select2-results__option {
    font-weight: 400;
    font-size: var(--size-12);
    line-height: var(--size-16);
    border-radius: var(--radius-8);
    color: var(--bs-gray-700);
    padding: var(--spacing-10) var(--spacing-12);
    display: flex;
    gap: var(--spacing-8);
    min-width: fit-content;
    white-space: nowrap;
}

/* Style for Option of the Dropdown */
.select2-container--bootstrap5 .select2-dropdown .select2-results__option.select2-results__option--selected:after {
    font-family: keenicons-outline;
    content: "\e99f";
    font-size: var(--size-16);
    line-height: var(--size-16);
    color: var(--bs-primary);
    font-style: normal;
    font-weight: 400;
    font-variant: normal;
    text-transform: none;
    height: 1rem;
    /* Need to remove default */
    mask-repeat: unset;
    background-color: transparent;
    -webkit-mask-image: none;
    mask-image: none;
    mask-position: unset;
}