/* Select 2 */

/* Keep the select2 options visible above modals */
.select2-container--open {
    z-index: 9999;
}

.select2-selection {
    background-color: var(--bs-body-bg) !important;
    font-size: 1rem !important;
    padding: 0.375rem 0.75rem !important;
}

.select2-container--bootstrap .select2-selection,
.select2-container--bootstrap.select2-container--disabled .select2-selection {
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-sm) !important;
    box-shadow: none;
    -webkit-box-shadow: none;
}

.select2-container--bootstrap .select2-selection--single {
    line-height: 1.5 !important;
    height: fit-content !important;
}

.select2-selection__rendered {
    color: var(--bs-body-color) !important;
}

.select2-selection__choice {
  display: flex;
  align-items: center;
  padding-left: 3px !important;
  color: var(--bs-body-color) !important;
  background-color: var(--bs-tertiary-bg) !important;
  border: var(--bs-border-width) solid var(--bs-border-color) !important;
}

.select2-selection__choice > button {
  border: none;
  background-color: var(--bs-tertiary-bg);
}

.select2-results__option--selected { display: none; }


.select2-container--bootstrap .select2-results__option {
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
}
/* 
.select2-container--bootstrap .select2-results__option[aria-selected="true"] {

} */

.select2-container--bootstrap .select2-results__option--highlighted {
    color: var(--bs-white) !important;
    background-color: var(--bs-primary) !important;
}

.select2-container--bootstrap .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--bs-secondary-color);
}

.select2-container--bootstrap .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--bs-tertiary-color);
}

.select2-container--bootstrap.select2-container--focus
.select2-selection, .select2-container--bootstrap.select2-container--open .select2-selection {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.select2-container--bootstrap .select2-dropdown {
    border-color: #86b7fe;
    background-color: var(--bs-body-bg);
}

.select2-container--bootstrap .select2-search--dropdown .select2-search__field {
    background-color: var(--bs-body-bg);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--bs-body-color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-sm);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Invalid Select2 */

select.select-2.is-invalid + .select2 .select2-selection {
    color: var(--bs-form-invalid-color);
    padding-right: calc(1.5em + 0.75rem) !important;
    border-color: var(--bs-form-invalid-border-color) !important;
    background-repeat: no-repeat;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}
