/* ========================================
   Select2 - Modern Enterprise Theme
   WPDM Custom Styles
   ======================================== */

/* CSS Variables for easy customization */
:root {
    --s2-primary: var(--admin-color, #3b74d5);
    --s2-primary-light: rgba(59, 116, 213, 0.08);
    --s2-primary-hover: rgba(59, 116, 213, 0.12);
    --s2-border: #dde6ee;
    --s2-border-focus: var(--admin-color, #3b74d5);
    --s2-bg: #fff;
    --s2-bg-hover: #f8fafc;
    --s2-bg-selected: #f1f5f9;
    --s2-text: #1e293b;
    --s2-text-muted: #64748b;
    --s2-text-placeholder: #94a3b8;
    --s2-radius: 6px;
    --s2-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    --s2-transition: 150ms ease;
}

/* Base Container */
.select2-container {
    box-sizing: border-box;
    display: inline-block;
    margin: 0;
    position: relative;
    vertical-align: middle;
}

/* Full width for multiple selection containers */
.select2-container--default.select2-container--multiple {
    display: block;
    width: 100%;
}

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

/* ========================================
   Single Selection
   ======================================== */
.select2-container .select2-selection--single {
    box-sizing: border-box;
    cursor: pointer;
    display: block;
    height: 36px;
    user-select: none;
    -webkit-user-select: none;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 34px;
}

.select2-container .select2-selection--single .select2-selection__clear {
    background-color: transparent;
    border: none;
    font-size: 1em;
    cursor: pointer;
}

.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
    padding-left: 28px;
    padding-right: 12px;
}

/* Default Theme - Single */
.select2-container--default .select2-selection--single {
    background-color: var(--s2-bg);
    border: 1px solid var(--s2-border);
    border-radius: var(--s2-radius);
    height: 36px;
    padding: 0 12px;
    transition: border-color var(--s2-transition), box-shadow var(--s2-transition);
}

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

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--s2-border-focus);
    box-shadow: 0 0 0 3px var(--s2-primary-light);
    outline: none;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--s2-text);
    font-size: 13px;
    line-height: 34px;
    padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--s2-text-placeholder);
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    float: right;
    font-weight: 400;
    height: 34px;
    line-height: 34px;
    margin-right: 24px;
    color: var(--s2-text-muted);
    font-size: 16px;
}

.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: var(--s2-text);
}

/* Arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 34px;
    position: absolute;
    top: 1px;
    right: 8px;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--s2-text-muted) transparent transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    height: 0;
    width: 0;
    transition: transform var(--s2-transition);
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: var(--s2-primary) transparent transparent transparent;
    transform: rotate(180deg);
}

/* ========================================
   Multiple Selection
   ======================================== */
.select2-container .select2-selection--multiple {
    box-sizing: border-box;
    cursor: text;
    display: block;
    min-height: 36px;
    user-select: none;
    -webkit-user-select: none;
    width: 100%;
}

.select2-container .select2-selection--multiple .select2-selection__rendered {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    padding: 10px;
    margin: 0;
    align-items: center;
    width: 100%;
}

.select2-container .select2-selection--multiple .select2-selection__rendered > li {
    display: inline-flex;
    align-items: center;
}

.select2-container--default .select2-selection--multiple {
    background-color: var(--s2-bg);
    border: 1px solid var(--s2-border);
    border-radius: var(--s2-radius);
    min-height: 36px;
    transition: border-color var(--s2-transition), box-shadow var(--s2-transition);
}

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

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--s2-border-focus);
    box-shadow: 0 0 0 3px var(--s2-primary-light);
    outline: none;
}

/* Tags/Chips */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--s2-primary-light);
    border: 1px solid rgba(59, 116, 213, 0.2);
    border-radius: 4px;
    color: var(--s2-primary);
    font-size: 12px;
    font-weight: 500;
    padding: 2px 6px 2px 8px;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background-color var(--s2-transition);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice:hover {
    background: var(--s2-primary-hover);
}

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

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    order: 2;
    background: none;
    border: none;
    color: var(--s2-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity var(--s2-transition);
    position: static;
    margin-left: 2px;
}

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

/* Clear button for multiple */
.select2-container--default .select2-selection--multiple .select2-selection__clear {
    cursor: pointer;
    font-weight: 400;
    margin-right: 4px;
    color: var(--s2-text-muted);
    font-size: 16px;
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.select2-container--default .select2-selection--multiple.select2-selection--clearable {
    padding-right: 28px;
}

/* Inline Search */
.select2-container .select2-search--inline {
    border-top: 1px solid var(--s2-border);
    width: 100%;
    display: block;
}


.select2-container .select2-search--inline .select2-search__field {
    box-sizing: border-box;
    border: none !important;
    font-size: 13px;
    margin: 0;
    padding: 8px 12px;
    width: 100%;
    min-width: 50px;
    resize: none;
    height: 32px;
    line-height: 16px;
    vertical-align: middle;
    font-family: inherit;
    overflow: hidden;
    word-break: keep-all;
    background: transparent;
    outline: none;
    color: var(--s2-text);
}
.select2-selection--multiple .select2-search__field{
    border-radius: 0 !important;
    height: 30px;
    width: 100% !important;
    content: "OK...";
}
.w3eden .select2-selection--multiple .select2-search__field:focus {
    border: 0 !important;
    box-shadow: none !important;
}

.select2-container .select2-search--inline .select2-search__field::placeholder {
    color: var(--s2-text-placeholder);
    content: attr(data-placeholder) !important;
}

.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* ========================================
   Dropdown
   ======================================== */
.select2-dropdown {
    background-color: var(--s2-bg);
    border: 1px solid var(--s2-border);
    border-radius: var(--s2-radius);
    box-sizing: border-box;
    display: block;
    position: absolute;
    left: -100000px;
    width: 100%;
    z-index: 1051;
    box-shadow: var(--s2-shadow);
    margin-top: 4px;
    overflow: hidden;
}

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

.select2-container--open .select2-dropdown {
    left: 0;
}

.select2-container--open .select2-dropdown--above {
    margin-top: 0;
    margin-bottom: 4px;
    border-radius: var(--s2-radius);
}

.select2-container--open .select2-dropdown--below {
    border-radius: var(--s2-radius);
}

/* Dropdown Search */
.select2-search--dropdown {
    display: block;
    padding: 8px;
    border-bottom: 1px solid var(--s2-border);
    background: #f8fafc;
}

.select2-search--dropdown .select2-search__field {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--s2-border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--s2-text);
    background: var(--s2-bg);
    outline: none;
    transition: border-color var(--s2-transition), box-shadow var(--s2-transition);
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--s2-border-focus);
    box-shadow: 0 0 0 3px var(--s2-primary-light);
}

.select2-search--dropdown .select2-search__field::placeholder {
    color: var(--s2-text-placeholder);
}

.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.select2-search--dropdown.select2-search--hide {
    display: none;
}

/* ========================================
   Results
   ======================================== */
.select2-results {
    display: block;
}

.select2-results__options {
    list-style: none;
    margin: 0;
    padding: 4px;
    max-height: 280px;
    overflow-y: auto;
}

/* Custom Scrollbar */
.select2-results__options::-webkit-scrollbar {
    width: 8px;
}

.select2-results__options::-webkit-scrollbar-track {
    background: transparent;
}

.select2-results__options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.select2-results__options::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.select2-results__option {
    padding: 10px 12px;
    margin: 0 !important;
    user-select: none;
    -webkit-user-select: none;
    font-size: 13px;
    color: var(--s2-text);
    border-radius: 4px;
    transition: background-color var(--s2-transition);
}

.select2-results__option--selectable {
    cursor: pointer;
}

.select2-results__option--disabled {
    color: var(--s2-text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.select2-results__option--selected {
    background-color: var(--s2-bg-selected) !important;
    font-weight: 700 !important;
}

.select2-results__option--highlighted {
    background-color: var(--s2-primary);
    color: white;
}

/* Option Groups */
.select2-results__option--group {
    padding: 0;
}

.select2-results__group {
    cursor: default;
    display: block;
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--s2-text-muted);
}

/* Nested Options */
.select2-container--default .select2-results__option .select2-results__option {
    padding-left: 24px;
}

.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
    padding-left: 12px;
}

/* ========================================
   States
   ======================================== */

/* Disabled */
.select2-container--default.select2-container--disabled .select2-selection--single,
.select2-container--default.select2-container--disabled .select2-selection--multiple {
    background-color: #f1f5f9;
    cursor: not-allowed;
    opacity: 0.7;
}

.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear,
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
    display: none;
}

/* Open State - Border Radius Adjustments */
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,
.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
    border-top-left-radius: var(--s2-radius);
    border-top-right-radius: var(--s2-radius);
}

.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,
.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
    border-bottom-left-radius: var(--s2-radius);
    border-bottom-right-radius: var(--s2-radius);
}

/* ========================================
   RTL Support
   ======================================== */
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
    float: left;
}

.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
    left: 8px;
    right: auto;
}

.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
    flex-direction: row-reverse;
}

.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
    margin-left: 0;
    margin-right: 2px;
}

.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__clear {
    left: 4px;
    right: auto;
}

/* ========================================
   Accessibility
   ======================================== */
.select2-hidden-accessible {
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    -webkit-clip-path: inset(50%) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important;
    white-space: nowrap !important;
}

/* Close Mask */
.select2-close-mask {
    border: 0;
    margin: 0;
    padding: 0;
    display: block;
    position: fixed;
    left: 0;
    top: 0;
    min-height: 100%;
    min-width: 100%;
    height: auto;
    width: auto;
    opacity: 0;
    z-index: 99;
    background-color: #fff;
}

/* ========================================
   Loading State
   ======================================== */
.select2-container--default .select2-results__option--loading {
    color: var(--s2-text-muted);
    font-style: italic;
}

/* ========================================
   No Results Message
   ======================================== */
.select2-results__message {
    padding: 12px;
    color: var(--s2-text-muted);
    text-align: center;
    font-size: 13px;
}

/* ========================================
   Small Size Variant (for compact UIs)
   ======================================== */
.select2-container--small .select2-selection--single {
    height: 30px;
}

.select2-container--small .select2-selection--single .select2-selection__rendered {
    line-height: 28px;
    font-size: 12px;
}

.select2-container--small .select2-selection--single .select2-selection__arrow {
    height: 28px;
}

.select2-container--small .select2-selection--multiple {
    min-height: 30px;
    padding: 0 !important;
    width: 100% !important;
}

.select2-container--small .select2-selection--multiple .select2-selection__choice {
    font-size: 11px;
    padding: 1px 4px 1px 6px;
}

