/* Modern Premium Select2 Skin */
/* Designed for high-end dashboard aesthetics */

/* 1. Main Container & Selection Styling */
.select2-container--default .select2-selection--single {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    height: 5.6rem;
    padding: 0.8rem 1.2rem;
    background-color: #fff;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    min-height: 5.6rem !important;
    height: auto !important; /* Force expansion for multi-row chips */
    padding: 1rem 1.2rem;
    background-color: #fff;
    transition: all 0.2s ease-in-out;
    display: block;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* 2. Single Select Specifics */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #1e293b;
    font-size: 1.4rem;
    font-weight: 500;
    padding-left: 0;
    line-height: normal;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 5.4rem;
    right: 1.2rem;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8;
}

/* 3. Multiple Select & Pills (Tags) */
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #3b82f6;
    border: 1px solid #2563eb;
    border-radius: 8px;
    padding: 1px 8px;
    margin: 0;
    color: #ffffff;
    font-size: 1.0rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.select2-container--default .select2-selection--multiple .select2-search--inline {
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    margin-top: 0;
    margin-left: 5px;
    height: 24px;
    line-height: 24px;
    font-family: inherit;
    font-size: 1.4rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice:hover {
    background: #2563eb;
    color: #ffffff;
}

/* Custom Remove Button */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.8);
    border: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.2s;
    background: none;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ffffff;
    background: none;
}

/* 4. Dropdown Menu Styling */
.select2-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-top: 4px;
    background: #fff;
    z-index: 9999;
}

.select2-container--default .select2-results__option {
    padding: 10px 16px;
    font-size: 1.4rem;
    color: #475569;
    transition: background 0.2s;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #f8fafc !important;
    color: #3b82f6 !important;
    font-weight: 600;
}

.select2-results__option[aria-disabled="true"] {
    color: #cbd5e1;
}

/* 5. Search Box Styling */
.select2-search--dropdown {
    padding: 12px;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.4rem;
    outline: none;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #3b82f6;
}

/* Integration with existing sf-select classes */
.sf-select-dropdown .select2-dropdown {
    border-radius: 12px !important;
}

.sf-select-section .select2-selection {
    border-radius: 12px !important;
}

/* Wide Dropdown Overlay for Multi-Col Layouts */
.sf-select-dropdown-wide .select2-dropdown {
    width: 180% !important;
    min-width: 500px;
    z-index: 1060 !important; /* Above modal content */
    border: 1px solid #3b82f6 !important;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.2) !important;
}

@media (max-width: 768px) {
    .sf-select-dropdown-wide .select2-dropdown {
        width: 100% !important;
        min-width: auto;
    }
}
