/**
 * Custom Select2 Styling
 * Consistent styling for all Select2 dropdowns across the project
 */

/* ========================================
   BASE SELECTION STYLING
   ======================================== */

/* Single Select */
.select2-container--default .select2-selection--single {
    background: #fff;
    border: 1px solid #dee2e6 !important;
    border-radius: 12px;
    height: 48px;
    padding: 0 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.select2-container--default .select2-selection--single:hover {
    border-color: #2e6f40;
    box-shadow: 0 4px 12px rgba(46, 111, 64, 0.12);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #333;
    font-size: 15px;
    font-weight: 500;
    line-height: 44px;
    padding-left: 0;
    padding-right: 40px;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #8e9aac;
    font-weight: 400;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 15px;
    top: 0;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #2e6f40 transparent transparent transparent;
    border-width: 6px 5px 0 5px;
    margin-top: 0;
    margin-left: 0;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Focus State for Single Select */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #2e6f40;
    box-shadow: 0 0 0 3px rgba(46, 111, 64, 0.15);
    outline: none;
}

/* ========================================
   MULTIPLE SELECT STYLING
   ======================================== */

.select2-container--default .select2-selection--multiple {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    min-height: 48px;
    padding: 6px 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    cursor: text;
}

.select2-container--default .select2-selection--multiple:hover {
    border-color: #2e6f40;
    box-shadow: 0 4px 12px rgba(46, 111, 64, 0.12);
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #2e6f40;
    box-shadow: 0 0 0 3px rgba(46, 111, 64, 0.15);
    outline: none;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    list-style: none;
    margin: 0;
}

/* Selected Tags/Chips */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #2e6f40;
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px 6px 28px;
    margin: 2px 0;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(46, 111, 64, 0.25);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice:hover {
    background: #245533;
    box-shadow: 0 3px 8px rgba(46, 111, 64, 0.35);
}

/* Remove Button (X) for Selected Items */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.8);
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    font-weight: 700;
    border: none;
    background: none;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
}

/* Search Input inside Multiple Select */
.select2-container--default .select2-selection--multiple .select2-search--inline {
    margin-top: 0;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    margin-top: 0;
    height: 28px !important;
    line-height: 28px;
    font-size: 14px;
    color: #333;
    border: none !important;
    background: transparent !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field::placeholder {
    color: #8e9aac;
}

/* ========================================
   DROPDOWN STYLING
   ======================================== */

.select2-dropdown {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
    overflow: hidden;
}

.select2-container--default .select2-results__options {
    padding: 8px;
}

/* Dropdown Options */
.select2-container--default .select2-results__option {
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.select2-container--default .select2-results__option:last-child {
    margin-bottom: 0;
}

/* Hover State */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: linear-gradient(135deg, #2e6f40 0%, #3d8f54 100%);
    color: #fff;
    border-radius: 8px;
}

/* Selected Option State */
.select2-container--default .select2-results__option--selected,
.select2-container--default .select2-results__option[aria-selected="true"] {
    background: rgba(46, 111, 64, 0.1);
    color: #2e6f40;
    font-weight: 600;
}

/* Selected AND Highlighted (hover on selected) */
.select2-container--default .select2-results__option--selected.select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option[aria-selected="true"].select2-results__option--highlighted[aria-selected] {
    background: linear-gradient(135deg, #2e6f40 0%, #3d8f54 100%);
    color: #fff;
}

/* Disabled Option */
.select2-container--default .select2-results__option--disabled {
    color: #adb5bd;
    cursor: not-allowed;
    background: transparent;
}

/* ========================================
   SEARCH BOX IN DROPDOWN
   ======================================== */

.select2-container--default .select2-search--dropdown {
    padding: 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #2e6f40;
    box-shadow: 0 0 0 3px rgba(46, 111, 64, 0.15);
    outline: none;
}

/* ========================================
   LOADING & NO RESULTS MESSAGES
   ======================================== */

.select2-results__message {
    padding: 16px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

/* ========================================
   CLEAR BUTTON
   ======================================== */

.select2-container--default .select2-selection--single .select2-selection__clear {
    color: #6c757d;
    font-size: 20px;
    font-weight: 400;
    margin-right: 5px;
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #dc3545;
}

/* ========================================
   RESPONSIVE WIDTH
   ======================================== */

.select2-container {
    width: 100% !important;
}

/* ========================================
   ANIMATION
   ======================================== */

.select2-container--open .select2-dropdown {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   DISABLED STATE
   ======================================== */

.select2-container--disabled .select2-selection--single,
.select2-container--disabled .select2-selection--multiple {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.select2-container--disabled .select2-selection--single:hover,
.select2-container--disabled .select2-selection--multiple:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
