/**
 * Select2 Custom Styles untuk Template Sneat
 * Styling minimal dan fokus untuk mengatasi masalah tampilan
 */

/* ========== Reset dan Base Styling ========== */
.select2-container {
    width: 100% !important;
    box-sizing: border-box;
}

/* ========== Input Month Styling ========== */
input[type="month"].form-control-sm {
    height: calc(1.875rem + 2px) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.8125rem !important;
    line-height: 1.5 !important;
    border-radius: 0.25rem !important;
}

/* ========== Single Selection - Bootstrap 5 Theme ========== */
.select2-container--bootstrap-5 .select2-selection--single {
    height: calc(2.25rem + 2px) !important;
    border: 1px solid #d9dee3 !important;
    border-radius: 0.375rem !important;
    background-color: #fff !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #697a8d !important;
    font-size: 0.9375rem !important;
    line-height: 1.53 !important;
    padding: 0 0.875rem !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: block !important;
    width: calc(100% - 2rem) !important;
    box-sizing: border-box !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    right: 0.875rem !important;
    top: 0 !important;
    height: calc(2.25rem) !important;
    width: 1rem !important;
}

/* ========== Small Size Support ========== */
.select2-container--bootstrap-5.select2-container--small .select2-selection--single,
.form-select-sm.select2-hidden-accessible + .select2-container--bootstrap-5 .select2-selection--single {
    height: 31px !important;
    font-size: 0.8125rem !important;
}

.select2-container--bootstrap-5.select2-container--small .select2-selection--single .select2-selection__rendered,
.form-select-sm.select2-hidden-accessible + .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    font-size: 0.8125rem !important;
    padding: 0.25rem 0.5rem !important;
    line-height: 1.5 !important;
}

.select2-container--bootstrap-5.select2-container--small .select2-selection--single .select2-selection__arrow,
.form-select-sm.select2-hidden-accessible + .select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    right: 0.5rem !important;
    height: 29px !important;
}

/* ========== Focus State ========== */
.select2-container--bootstrap-5.select2-container--focus .select2-selection--single,
.select2-container--bootstrap-5.select2-container--open .select2-selection--single {
    border-color: #2E7D32 !important;
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25) !important;
    outline: none !important;
}

/* ========== Dropdown ========== */
.select2-container--bootstrap-5 .select2-dropdown {
    border: 1px solid #d9dee3 !important;
    border-radius: 0.375rem !important;
    background-color: #fff !important;
    box-shadow: 0 0.25rem 1rem rgba(161, 172, 184, 0.45) !important;
    z-index: 9999 !important;
    margin-top: 1px !important;
}

.select2-container--bootstrap-5.select2-container--open .select2-dropdown {
    border-color: #2E7D32 !important;
}

/* ========== Search Field ========== */
.select2-container--bootstrap-5 .select2-search--dropdown {
    padding: 0.5rem !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    width: 100% !important;
    border: 1px solid #d9dee3 !important;
    border-radius: 0.375rem !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
    background-color: #fff !important;
    color: #697a8d !important;
    box-sizing: border-box !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field:focus {
    border-color: #2E7D32 !important;
    outline: none !important;
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 50, 0.25) !important;
}

/* ========== Results Options ========== */
.select2-container--bootstrap-5 .select2-results__options {
    max-height: 200px !important;
    overflow-y: auto !important;
}

.select2-container--bootstrap-5 .select2-results__option {
    padding: 0.5rem 0.875rem !important;
    font-size: 0.9375rem !important;
    color: #697a8d !important;
    cursor: pointer !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #2E7D32 !important;
    color: #fff !important;
}

.select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: rgba(46, 125, 50, 0.08) !important;
    color: #2E7D32 !important;
}

/* ========== Multiple Selection ========== */
.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: calc(2.25rem + 2px) !important;
    border: 1px solid #d9dee3 !important;
    border-radius: 0.375rem !important;
    background-color: #fff !important;
    padding: 0.25rem 0.5rem !important;
    box-sizing: border-box !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: #2E7D32 !important;
    border: 1px solid #2E7D32 !important;
    border-radius: 0.25rem !important;
    color: #fff !important;
    font-size: 0.8125rem !important;
    padding: 0.125rem 0.5rem !important;
    margin: 0.125rem 0.25rem 0.125rem 0 !important;
    display: inline-block !important;
    max-width: 150px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.8) !important;
    margin-right: 0.25rem !important;
    font-weight: bold !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff !important;
}

/* ========== Clear Button ========== */
.select2-container--bootstrap-5 .select2-selection__clear {
    position: absolute !important;
    right: 2rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #8592a3 !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    z-index: 2 !important;
}

.select2-container--bootstrap-5 .select2-selection__clear:hover {
    color: #ff3e1d !important;
}

/* ========== Loading dan No Results ========== */
.select2-container--bootstrap-5 .select2-results__option--loading-more,
.select2-container--bootstrap-5 .select2-results__option--no-results {
    color: #8592a3 !important;
    font-style: italic !important;
    text-align: center !important;
    padding: 1rem !important;
}

/* ========== Responsive ========== */
@media (max-width: 767.98px) {
    .select2-container--bootstrap-5 .select2-selection--single {
        height: calc(2.5rem + 2px) !important;
    }

    .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
        font-size: 1rem !important;
    }
}

/* ========== Dark Mode ========== */
.dark-style .select2-container--bootstrap-5 .select2-selection--single,
.dark-style .select2-container--bootstrap-5 .select2-selection--multiple {
    background-color: #2b2c40 !important;
    border-color: #444564 !important;
    color: #a3a4cc !important;
}

.dark-style .select2-container--bootstrap-5 .select2-dropdown {
    background-color: #2b2c40 !important;
    border-color: #444564 !important;
}

.dark-style .select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    background-color: #2b2c40 !important;
    border-color: #444564 !important;
    color: #a3a4cc !important;
}

.dark-style .select2-container--bootstrap-5 .select2-results__option {
    color: #a3a4cc !important;
}

.dark-style .select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #2E7D32 !important;
    color: #fff !important;
}

/* ========== Fix untuk Placeholder ========== */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: #8592a3 !important;
    font-style: italic !important;
}


