/* Select2 styling for Cv.Individuals — matches form inputs (rounded-lg, #0042ff focus) */

.select2-container {
    width: 100% !important;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .select2-container {
        font-size: 1rem;
    }
}

.select2-container--default .select2-selection--single {
    position: relative !important;
    background-color: #fff !important;
    border: 1px solid #c5d4ff !important;
    border-radius: 0.75rem !important;
    min-height: 2.75rem !important;
    padding: 0.5rem 2.25rem 0.5rem 0.75rem !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 640px) {
    .select2-container--default .select2-selection--single {
        min-height: 3rem !important;
        padding-top: 0.625rem !important;
        padding-bottom: 0.625rem !important;
        padding-left: 1rem !important;
    }
}

[dir="rtl"] .select2-container--default .select2-selection--single {
    padding: 0.5rem 0.75rem 0.5rem 2.25rem !important;
}

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

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: transparent !important;
    box-shadow: 0 0 0 2px #0042ff !important;
    outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 0.75rem !important;
    width: 1.25rem !important;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    left: 0.75rem !important;
    right: auto !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #9ca3af transparent transparent transparent !important;
    border-width: 5px 4px 0 4px !important;
    margin-left: -4px !important;
    margin-top: -2px !important;
}

.select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #fff !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.select2-container--default .select2-dropdown {
    background-color: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1) !important;
    margin-top: 0.5rem !important;
    overflow: hidden;
    z-index: 99999 !important;
}

.select2-container--open {
    z-index: 99999 !important;
}

/* Single-select: type in the main field (CvSearchableSelect moves dropdown search into the box). */
.select2-container--default .select2-selection--single .select2-search--inline.cv-search-in-field {
    position: absolute !important;
    inset: 0 !important;
    padding: inherit !important;
    margin: 0 !important;
    background: #fff !important;
    border-radius: inherit !important;
    display: flex !important;
    align-items: center !important;
    z-index: 2 !important;
    pointer-events: auto !important;
}

.select2-container--default .select2-selection--single .select2-search--inline.cv-search-in-field .select2-search__field {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #374151 !important;
    font-size: inherit !important;
}

.Cv-select-hidden {
    visibility: hidden !important;
}

/* Single-select list: options only (search lives in the field). */
.select2-dropdown.cv-select2-single-dropdown .select2-search--dropdown,
.select2-dropdown:not(.cv-select2-dropdown-search):not(.js-category-dropdown) .select2-search--dropdown {
    display: none !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline {
    position: relative !important;
    inset: auto !important;
    flex: 1 1 3rem !important;
    min-width: 2.5rem !important;
    background: transparent !important;
    display: inline-flex !important;
    align-items: center !important;
    z-index: auto !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    width: 100% !important;
    min-width: 2rem !important;
    height: auto !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    color: #374151 !important;
    font-size: inherit !important;
}

.select2-dropdown.cv-select2-dropdown-search .select2-search--dropdown,
.select2-dropdown.js-category-dropdown .select2-search--dropdown {
    display: block !important;
    padding: 0.5rem 0.5rem 0.25rem !important;
}

.select2-dropdown.cv-select2-dropdown-search .select2-search--dropdown .select2-search__field,
.select2-dropdown.js-category-dropdown .select2-search--dropdown .select2-search__field {
    border: 1px solid #c5d4ff !important;
    border-radius: 0.65rem !important;
    padding: 0.45rem 0.65rem !important;
    font-size: 0.875rem !important;
    width: 100% !important;
    pointer-events: auto !important;
}

.select2-dropdown.cv-select2-dropdown-search .select2-search--dropdown .select2-search__field:focus,
.select2-dropdown.js-category-dropdown .select2-search--dropdown .select2-search__field:focus {
    border-color: #0042ff !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(0, 66, 255, 0.25) !important;
}

.select2-container--default .select2-results > .select2-results__options {
    max-height: 15rem !important;
    padding: 0.25rem !important;
}

.select2-container--default .select2-results__option {
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.75rem !important;
    color: #334155 !important;
    margin: 0.125rem 0 !important;
}

.select2-container--default .select2-results__group {
    display: none !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #e6edff !important;
    color: #0036d6 !important;
    font-weight: 600 !important;
}

.select2-container.is-invalid .select2-selection--single,
.select2-container--default.is-invalid .select2-selection--single {
    border-color: #ef4444 !important;
}

.select2-container.is-valid .select2-selection--single,
.select2-container--default.is-valid .select2-selection--single {
    border-color: #10b981 !important;
}

.select2-hidden-accessible.is-invalid + .select2-container .select2-selection--single {
    border-color: #ef4444 !important;
}

/* —— Multiple selection (categories, tags) —— */
.select2-container--default .select2-selection--multiple {
    position: relative !important;
    background-color: #fff !important;
    border: 1px solid #c5d4ff !important;
    border-radius: 0.75rem !important;
    min-height: 3rem !important;
    padding: 0.35rem 2.25rem 0.35rem 0.65rem !important;
    cursor: pointer !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[dir="rtl"] .select2-container--default .select2-selection--multiple {
    padding: 0.35rem 0.65rem 0.35rem 2.25rem !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: transparent !important;
    box-shadow: 0 0 0 2px #0042ff !important;
    outline: none !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.35rem !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: linear-gradient(145deg, #e6edff 0%, #f8fcfd 100%) !important;
    border: 1px solid rgba(0, 66, 255, 0.35) !important;
    border-radius: 0.5rem !important;
    color: #0036d6 !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    padding: 0.15rem 0.45rem !important;
    margin: 0 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #64748b !important;
    margin-inline-end: 0.2rem !important;
    border: none !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #dc2626 !important;
    background: transparent !important;
}

