/* Dark Theme compatibility for select2 multiselects*/
@media (prefers-color-scheme: dark) {

    .select2-dropdown,
    .select2-selection {
        color: #b1b1b1 !important;
        background-color: #222 !important;
        border: 1px solid #515151 !important;
    }

    .select2-results__option {
        display: flex;
        gap: 0.5rem;
        color: #b1b1b1 !important;
        background-color: #222 !important;
    }

    .select2-results__option:hover,
    .select2-results__option[aria-selected=true]:hover {
        color: #dfe0e1 !important;
        background-color: #343a40 !important;
    }

    .select2-selection__choice:has(> span:hover) {
        opacity: 0.5;
    }

    /* Filters adjusts color of svg used as remove-button for selected options */
    .select2-selection__choice__remove:first-child {
        background-color: transparent !important;
        filter: brightness(70) saturate(0%);
    }

    .select2-selection__choice__remove:hover {
        filter: invert(1)
    }

    .select2-results__option[aria-selected=true],
    .select2-result__option,
    .select2-selection__choice,
    .select2-selection__choice__remove {
        color: #fafafa !important;
        background-color: #626262 !important;
        border-color: #626262 !important;
    }

    /* This is a check mark displayed for the selected options */
    .select2-results__option[aria-selected=true]::after {
        content: '';
        display: block;
        width: 0.5em;
        height: 1em;
        border-style: solid;
        border-width: 0 0.26em 0.26em 0;
        -webkit-transform-style: preserve-3d;
        transform-style: preserve-3d;
        -webkit-transform: rotate(45deg);
        -ms-transform: rotate(45deg);
        -o-transform: rotate(45deg);
        transform: rotate(45deg);
    }
}
