/* Select2 Bootstrap 4 Theme */
.select2-container--bootstrap4 {
    display: block;
    width: auto !important;
    min-width: 100px;
    max-width: none !important;
}

/* Force auto width and prevent JavaScript width setting */
.select2-container {
    width: auto !important;
    min-width: 100px;
    max-width: none !important;
}

/* Override any inline styles that select2 might add */
.select2-container[style*="width"] {
    width: auto !important;
    min-width: 100px;
    max-width: none !important;
}

/* Force auto width for all select2 containers regardless of inline styles */
.select2-container[style] {
    width: auto !important;
    min-width: 100px;
    max-width: none !important;
}

/* Specific override for any width value */
.select2-container[style*="width:"] {
    width: auto !important;
    min-width: 100px;
    max-width: 100% !important;
    /* max-width: none !important; */
    
}

.select2-container--bootstrap4 .select2-selection--single {
    height: calc(1.5em + 0.75rem + 2px) !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: #fff !important;
    border: 1px solid #d8dfed !important;
    border-radius: 0.25rem !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1.5 !important;
    color: #495057 !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    color: #6c757d !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 0.75rem) !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 20px !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
    border-color: #495057 transparent transparent transparent !important;
    border-style: solid !important;
    border-width: 5px 4px 0 4px !important;
    height: 0 !important;
    left: 50% !important;
    margin-left: -4px !important;
    margin-top: -2px !important;
    position: absolute !important;
    top: 50% !important;
    width: 0 !important;
}

.select2-container--bootstrap4.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #495057 transparent !important;
    border-width: 0 4px 5px 4px !important;
}

/* Focus state */
.select2-container--bootstrap4.select2-container--focus .select2-selection--single,
.select2-container--bootstrap4.select2-container--open .select2-selection--single {
    border-color: #5ba6fa !important;
    box-shadow: 0 0 0 0.2rem rgba(6, 101, 208, 0.25) !important;
}

/* Multiple selection */
.select2-container--bootstrap4 .select2-selection--multiple {
    min-height: calc(1.5em + 0.75rem + 2px) !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: #fff !important;
    border: 1px solid #d8dfed !important;
    border-radius: 0.25rem !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1.5 !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
    background-color: #0665d0 !important;
    border: 1px solid #0665d0 !important;
    border-radius: 0.25rem !important;
    color: #fff !important;
    padding: 0.25rem 0.5rem !important;
    margin: 0.125rem !important;
    font-size: 0.875rem !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff !important;
    margin-right: 0.5rem !important;
    font-weight: bold !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff !important;
    opacity: 0.8 !important;
}

/* Dropdown */
.select2-container--bootstrap4 .select2-dropdown {
    border: 1px solid #d8dfed !important;
    border-radius: 0.25rem !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.select2-container--bootstrap4 .select2-search--dropdown .select2-search__field {
    border: 1px solid #d8dfed !important;
    border-radius: 0.25rem !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

.select2-container--bootstrap4 .select2-search--dropdown .select2-search__field:focus {
    border-color: #5ba6fa !important;
    box-shadow: 0 0 0 0.2rem rgba(6, 101, 208, 0.25) !important;
}

.select2-container--bootstrap4 .select2-results__option {
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

.select2-container--bootstrap4 .select2-results__option--highlighted[aria-selected] {
    background-color: #0665d0 !important;
    color: #fff !important;
}

.select2-container--bootstrap4 .select2-results__option[aria-selected=true] {
    background-color: #e9ecef !important;
    color: #495057 !important;
}

/* Small size */
.select2-container--bootstrap4.select2-container--sm .select2-selection--single {
    height: calc(1.5em + 0.5rem + 2px) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    border-radius: 0.2rem !important;
}

.select2-container--bootstrap4.select2-container--sm .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 0.5rem) !important;
}

.select2-container--bootstrap4.select2-container--sm .select2-selection--multiple {
    min-height: calc(1.5em + 0.5rem + 2px) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    border-radius: 0.2rem !important;
}

/* Large size */
.select2-container--bootstrap4.select2-container--lg .select2-selection--single {
    height: calc(1.5em + 1rem + 2px) !important;
    padding: 0.5rem 1rem !important;
    font-size: 1.25rem !important;
    border-radius: 0.3rem !important;
}

.select2-container--bootstrap4.select2-container--lg .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 1rem) !important;
}

.select2-container--bootstrap4.select2-container--lg .select2-selection--multiple {
    min-height: calc(1.5em + 1rem + 2px) !important;
    padding: 0.5rem 1rem !important;
    font-size: 1.25rem !important;
    border-radius: 0.3rem !important;
}

/* Disabled state */
.select2-container--bootstrap4.select2-container--disabled .select2-selection--single,
.select2-container--bootstrap4.select2-container--disabled .select2-selection--multiple {
    background-color: #e9ecef !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
}

/* Fix for form-control-sm class */
.form-control-sm + .select2-container--bootstrap4 .select2-selection--single {
    height: calc(1.5em + 0.5rem + 2px) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    border-radius: 0.2rem !important;
}

.form-control-sm + .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 0.5rem) !important;
}

.form-control-sm + .select2-container--bootstrap4 .select2-selection--multiple {
    min-height: calc(1.5em + 0.5rem + 2px) !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
    border-radius: 0.2rem !important;
}

/* Fix for form-control-lg class */
.form-control-lg + .select2-container--bootstrap4 .select2-selection--single {
    height: calc(1.5em + 1rem + 2px) !important;
    padding: 0.5rem 1rem !important;
    font-size: 1.25rem !important;
    border-radius: 0.3rem !important;
}

.form-control-lg + .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 1rem) !important;
}

.form-control-lg + .select2-container--bootstrap4 .select2-selection--multiple {
    min-height: calc(1.5em + 1rem + 2px) !important;
    padding: 0.5rem 1rem !important;
    font-size: 1.25rem !important;
    border-radius: 0.3rem !important;
}


