/*
 * Select2 alanlarını Bootstrap .form-control ile birebir hizalar.
 * Tema adından (default / bootstrap / bootstrap-5) bağımsız çalışır;
 * select2.min.css'ten SONRA yüklenmelidir.
 */
.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    box-sizing: border-box;
    color: #495057;
    font-size: .8125rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 0;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.select2-container .select2-selection--single {
    height: calc(1.5em + .94rem + 2px);
}

.select2-container .select2-selection--multiple {
    min-height: calc(1.5em + .94rem + 2px);
}

.select2-container.select2-container--focus .select2-selection--single,
.select2-container.select2-container--focus .select2-selection--multiple,
.select2-container.select2-container--open .select2-selection--single,
.select2-container.select2-container--open .select2-selection--multiple {
    border-color: #b9bfc4;
    box-shadow: none;
    outline: 0;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    color: #495057;
    line-height: calc(1.5em + .94rem);
    padding-left: .75rem;
    padding-right: 2.75rem;
}

.select2-container .select2-selection--single .select2-selection__placeholder,
.select2-container .select2-selection--multiple .select2-search__field::placeholder {
    color: #74788d;
}

/* Ok işareti: sağa yaslı; tıklamaları yakalamaz ki altındaki × çalışsın. */
.select2-container .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + .94rem);
    pointer-events: none;
    position: absolute;
    right: 3px;
    top: 1px;
    width: 34px;
}

.select2-container .select2-selection--single .select2-selection__arrow b {
    border-color: #adb5bd transparent transparent transparent;
    border-style: solid;
    border-width: 6px 6px 0 6px;
    height: 0;
    left: 50%;
    margin-left: -6px;
    margin-top: -3px;
    position: absolute;
    top: 50%;
    width: 0;
}

.select2-container.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #adb5bd transparent;
    border-width: 0 6px 6px 6px;
}

/* Temizle (×) düğmesi: okun soluna, dikeyde ortalı. */
.select2-container .select2-selection--single .select2-selection__clear,
.select2-container .select2-selection--multiple .select2-selection__clear {
    background: none;
    border: 0;
    color: #74788d;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 700;
    height: auto;
    line-height: 1;
    margin: 0;
    padding: 0;
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

/* Çoklu seçim: rozetler ve satır içi arama tek kutuda akar. */
.select2-container .select2-selection--multiple {
    padding: .2rem 2rem 0 .5rem;
}

.select2-container .select2-selection--multiple .select2-selection__rendered {
    display: inline;
    list-style: none;
    margin: 0;
    padding: 0 !important;
}

.select2-container .select2-selection--multiple .select2-selection__choice {
    background-color: #eff2f7;
    border: 1px solid #e9ebef;
    border-radius: .2rem;
    color: #495057;
    display: inline-block;
    font-size: .8125rem;
    line-height: 1.4;
    margin: 0 .35rem .2rem 0;
    padding: 0 .5rem 0 1.5rem;
    position: relative;
    vertical-align: middle;
}

.select2-container .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove {
    background: none;
    border: 0;
    color: #74788d;
    cursor: pointer;
    font-size: 1em;
    font-weight: 700;
    height: auto;
    left: 0;
    line-height: 1;
    padding: 0 .3rem 0 .4rem;
    position: absolute;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
}

.select2-container .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:hover {
    color: #f46a6a;
}

.select2-container .select2-selection--multiple .select2-selection__choice__display {
    display: inline-block;
}

.select2-container .select2-selection--multiple .select2-search--inline {
    display: inline-block;
    vertical-align: middle;
}

.select2-container .select2-selection--multiple .select2-search--inline .select2-search__field {
    background: transparent;
    border: 0;
    color: #495057;
    font-family: inherit;
    font-size: .8125rem;
    height: 1.5em;
    line-height: 1.5;
    margin: 0 0 .2rem 0;
    max-width: 100%;
    outline: 0;
    padding: 0;
    resize: none;
    vertical-align: middle;
}

.select2-container .select2-selection--multiple .select2-selection__clear {
    right: 10px;
}

/* Açılır liste. */
.select2-container .select2-dropdown {
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    box-shadow: 0 .75rem 1.5rem rgba(18, 38, 63, .06);
    font-size: .8125rem;
}

.select2-container .select2-search--dropdown {
    padding: .5rem;
}

.select2-container .select2-search--dropdown .select2-search__field {
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    color: #495057;
    font-size: .8125rem;
    outline: 0;
    padding: .3rem .5rem;
}

.select2-container .select2-search--dropdown .select2-search__field:focus {
    border-color: #b9bfc4;
    outline: 0;
}

.select2-container .select2-results__option {
    padding: .375rem .75rem;
}

.select2-container .select2-results__option--highlighted[aria-selected],
.select2-container .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #556ee6;
    color: #fff;
}

.select2-container .select2-results__option[aria-selected=true],
.select2-container .select2-results__option--selected {
    background-color: #f8f9fa;
    color: #343a40;
}

.select2-container .select2-results__option[aria-selected=true]:hover,
.select2-container .select2-results__option--selected:hover {
    background-color: #556ee6;
    color: #fff;
}

.select2-container .select2-results__group {
    font-weight: 600;
}

/* Pasif alan. */
.select2-container.select2-container--disabled .select2-selection--single,
.select2-container.select2-container--disabled .select2-selection--multiple {
    background-color: #eff2f7;
    cursor: not-allowed;
}

/* Doğrulama hatası: select'e is-invalid verildiyse kırmızı çerçeve. */
.is-invalid + .select2-container .select2-selection--single,
.is-invalid + .select2-container .select2-selection--multiple {
    border-color: #f46a6a;
}
