/* ============================================
   SELECT2 LIBRARY CUSTOMIZATION
   Professional Select2 dropdown styling
   Matches Bootstrap form-control styling
   ============================================ */

/* ============================================
   SELECT2 CONTAINER POSITIONING FOR ICONS
   ============================================ */

/* Select2 container takes full width but allows icon to show */
.has-icon-focus .select2-container,
.position-relative.has-icon-focus .select2-container {
    width: 100%;
}

/* Icon color on focus - specific to Select2 parent */
.has-icon-focus:focus-within .icon-absolute {
    color: #e91e63;
}

/* ============================================
   SINGLE SELECT STYLING
   ============================================ */

.select2-container--default .select2-selection--single {
    height: 48px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding-left: 45px;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.select2-container--default .select2-selection--single:hover {
    border-color: #ccc;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1), 0 2px 8px rgba(233, 30, 99, 0.12);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px;
    padding-left: 0;
    color: #333;
    font-size: 15px;
}

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

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px;
    right: 15px;
    transition: transform 0.3s ease;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    transform: rotate(180deg);
}

/* ============================================
   MULTI SELECT STYLING
   ============================================ */

.select2-container--default .select2-selection--multiple {
    min-height: 48px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 6px 6px 6px 45px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.select2-container--default .select2-selection--multiple:hover {
    border-color: #ccc;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1), 0 2px 8px rgba(233, 30, 99, 0.12);
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Selected items (chips/badges) */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
    border: none;
    color: white;
    border-radius: 20px;
    padding: 8px 14px;
    margin: 0 6px 6px 0;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(233, 30, 99, 0.4);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
    order: 1;
    padding: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    order: 2;
    color: white;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.2s ease;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    position: relative;
    right: 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg) scale(1.1);
}

.select2-container--default .select2-search--inline .select2-search__field {
    margin: 0;
    padding: 6px 0;
    min-height: 32px;
}

/* ============================================
   DROPDOWN STYLING
   ============================================ */

.select2-dropdown {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
    overflow: hidden;
    animation: dropdownSlideIn 0.2s ease-out;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.select2-container--default .select2-search--dropdown {
    padding: 12px;
    background: #f8f9fa;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
    outline: none;
}

.select2-results {
    max-height: 300px;
}

.select2-container--default .select2-results__option {
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.15s ease;
    color: #333;
}

/* Optgroup styling */
.select2-container--default .select2-results__group {
    padding: 10px 16px 6px 16px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #e91e63;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

/* Hover state - brand gradient background */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
    color: white;
}

/* Selected state - white background with brand text */
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: white;
    color: #e91e63;
    font-weight: 600;
    position: relative;
    padding-left: 40px;
}

/* Checkmark icon for selected items */
.select2-container--default .select2-results__option[aria-selected=true]:before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 16px;
    color: #e91e63;
}

/* Hovering over selected item */
.select2-container--default .select2-results__option[aria-selected=true].select2-results__option--highlighted {
    background: linear-gradient(135deg, #e91e63 0%, #d81b60 100%);
    color: white;
}

.select2-container--default .select2-results__option[aria-selected=true].select2-results__option--highlighted:before {
    color: white;
}

/* ============================================
   DISABLED STATE
   ============================================ */

.select2-container--default.select2-container--disabled .select2-selection--single,
.select2-container--default.select2-container--disabled .select2-selection--multiple {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .select2-container--default .select2-selection--single,
    .select2-container--default .select2-selection--multiple {
        min-height: 50px;
        height: auto;
    }

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 46px;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        font-size: 13px;
        padding: 6px 12px;
    }
}
