/* ==========================================================================
   Plan4Event Global Select2 Styling
   Brand Colors: #fa1671 (Primary) / #290e3b (Deep Purple) / #ffe9f2 (Soft Pink)
   ========================================================================== */

/* ── Container Base ── */
.select2-container {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

.select2-container * {
    box-sizing: border-box !important;
}

/* ── Single Selection Box ── */
.select2-container .select2-selection--single {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    background-color: #ffffff !important;
    border: 1.5px solid #e0d5dd !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 14px !important;
    transition: border-color 0.18s ease-in-out, box-shadow 0.18s ease-in-out, background-color 0.18s !important;
    box-shadow: 0 1px 3px rgba(41, 14, 59, 0.04) !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.select2-container .select2-selection--single:hover {
    border-color: #fa1671 !important;
}

/* Focused / Opened State */
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #fa1671 !important;
    background-color: #ffffff !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(250, 22, 113, 0.16) !important;
}

/* ── Rendered Text ── */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #241221 !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 41px !important;
    height: 41px !important;
    padding-left: 0 !important;
    padding-right: 32px !important;
    width: 100% !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    display: block !important;
}

/* Placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #8c7d8a !important;
    font-weight: 400 !important;
}

/* Clear (x) button */
.select2-container--default .select2-selection--single .select2-selection__clear {
    color: #a89aa6 !important;
    font-size: 18px !important;
    margin-right: 18px !important;
    line-height: 41px !important;
    float: right !important;
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #fa1671 !important;
}

/* Dropdown Arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 41px !important;
    right: 12px !important;
    top: 0 !important;
    width: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #7d6b7a transparent transparent transparent !important;
    border-width: 5px 4.5px 0 4.5px !important;
    margin-left: -5px !important;
    margin-top: -2px !important;
    transition: transform 0.2s ease, border-color 0.2s ease !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #fa1671 transparent !important;
    border-width: 0 4.5px 5px 4.5px !important;
}

/* ── Dropdown Popup ── */
.select2-dropdown {
    width: 320px !important;
    min-width: 220px !important;
    max-width: calc(100vw - 20px) !important;
    box-sizing: border-box !important;
    border: 1.5px solid #fa1671 !important;
    border-radius: 10px !important;
    box-shadow: 0 14px 34px rgba(41, 14, 59, 0.16), 0 4px 12px rgba(250, 22, 113, 0.08) !important;
    z-index: 105000 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    margin-top: 3px !important;
    animation: select2PopIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

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

/* ── Search Input Field Inside Dropdown ── */
.select2-search--dropdown {
    padding: 8px 10px !important;
    background: #fdf5f8 !important;
    border-bottom: 1px solid #fae2ec !important;
    position: relative !important;
}

.select2-search--dropdown .select2-search__field {
    height: 38px !important;
    line-height: 38px !important;
    border: 1.5px solid #f2bfd3 !important;
    border-radius: 8px !important;
    padding: 0 14px 0 40px !important;
    font-size: 13.5px !important;
    font-family: 'DM Sans', sans-serif !important;
    color: #2b1b2a !important;
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23fa1671' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 14px center !important;
    outline: none !important;
    box-shadow: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #fa1671 !important;
    box-shadow: 0 0 0 3px rgba(250, 22, 113, 0.2) !important;
    background-color: #ffffff !important;
}

/* ── Results Options ── */
.select2-results {
    max-height: 280px !important;
}

.select2-results__options {
    padding: 4px !important;
    list-style: none !important;
    margin: 0 !important;
}

.select2-results__option {
    padding: 9px 14px !important;
    font-size: 13.5px !important;
    color: #3b2a38 !important;
    border-radius: 6px !important;
    transition: background-color 0.12s ease, color 0.12s ease !important;
    cursor: pointer !important;
    user-select: none !important;
    font-family: 'DM Sans', sans-serif !important;
    display: flex !important;
    align-items: center !important;
}

.select2-results__option--highlighted[aria-selected] {
    background-color: #ffe9f2 !important;
    color: #fa1671 !important;
    font-weight: 600 !important;
}

.select2-results__option[aria-selected="true"] {
    background-color: #fa1671 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.select2-results__option[aria-selected="true"]::after {
    content: " \2713";
    margin-left: auto !important;
    font-weight: 700 !important;
}

.select2-results__message {
    padding: 14px !important;
    font-size: 13px !important;
    color: #8c7d8a !important;
    text-align: center !important;
    font-style: italic !important;
}

/* ── Custom Scrollbar for Select2 Results ── */
.select2-results__options::-webkit-scrollbar {
    width: 6px !important;
}
.select2-results__options::-webkit-scrollbar-track {
    background: #fbf5f8 !important;
}
.select2-results__options::-webkit-scrollbar-thumb {
    background: #eccedb !important;
    border-radius: 4px !important;
}
.select2-results__options::-webkit-scrollbar-thumb:hover {
    background: #fa1671 !important;
}

/* ── Context Overrides ── */
.quick-form-card .select2-container .select2-selection--single {
    border-color: #edd9e4 !important;
    background-color: #ffffff !important;
    border-radius: 8px !important;
}

.quick-form-card .select2-container--default.select2-container--open .select2-selection--single,
.quick-form-card .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #fa1671 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(250, 22, 113, 0.16) !important;
}

.bg-light-box .select2-container .select2-selection--single {
    border-color: #e2d8e0 !important;
    background-color: #fafafa !important;
    border-radius: 8px !important;
}

/* ── Venue Filter Card Priority Styles ── */
.venue-filter-card .venue-search-wrap .input-group,
.venue-filter-card select.form-select,
.venue-filter-card .select2-container .select2-selection--single {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    border: 1.5px solid #e0d5dd !important;
    border-radius: 10px !important;
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(41, 14, 59, 0.04) !important;
    box-sizing: border-box !important;
    font-size: 13.5px !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.venue-filter-card .venue-search-wrap .input-group:hover,
.venue-filter-card select.form-select:hover,
.venue-filter-card .select2-container .select2-selection--single:hover {
    border-color: #fa1671 !important;
}

.venue-filter-card .venue-search-wrap .input-group:focus-within,
.venue-filter-card select.form-select:focus,
.venue-filter-card .select2-container--default.select2-container--open .select2-selection--single,
.venue-filter-card .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #fa1671 !important;
    box-shadow: 0 0 0 3px rgba(250, 22, 113, 0.15) !important;
    outline: none !important;
}

/* ── Mobile Friendly Tweaks ── */
@media (max-width: 767.98px) {
    .select2-container .select2-selection--single {
        height: 44px !important;
    }
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 41px !important;
        font-size: 13.5px !important;
    }
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 41px !important;
    }
    .select2-search--dropdown .select2-search__field {
        height: 40px !important;
        font-size: 16px !important; /* Prevents auto-zoom in mobile Safari / Chrome */
    }
    .select2-results__option {
        padding: 10px 14px !important;
        font-size: 13.5px !important;
    }
}
