/* =============================================
   SELECT2 THEME-ADAPTIVE STYLES
   ============================================= */

:root {
  /* Light Theme Variables */
  --select2-bg: #fff;
  --select2-border: #aaa;
  --select2-text: #444;
  --select2-placeholder: #999;
  --select2-dropdown-bg: #fff;
  --select2-dropdown-border: #aaa;
  --select2-option-bg: transparent;
  --select2-option-text: #444;
  --select2-highlight-bg: #5897fb;
  --select2-highlight-text: #fff;
  --select2-selected-bg: #ddd;
  --select2-arrow-color: #888;
  --select2-focus-border: #5897fb;
}

[data-bs-theme="dark"] {
  /* Dark Theme Variables */
  --select2-bg: #3a4259;
  --select2-border: #3a4259;
  --select2-text: #fff;
  --select2-placeholder: #adb5bd;
  --select2-dropdown-bg: #2f3546;
  --select2-dropdown-border: #3a4259;
  --select2-option-bg: transparent;
  --select2-option-text: #DFE5EF;
  --select2-highlight-bg: #365CF5;
  --select2-highlight-text: #fff;
  --select2-selected-bg: #3a4259;
  --select2-arrow-color: #DFE5EF;
  --select2-focus-border: #365CF5;
}

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

/* Single Selection */
.select2-container .select2-selection--single {
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  height: 35px;
  user-select: none;
  -webkit-user-select: none;
  background-color: var(--select2-bg);
  border: 1px solid var(--select2-border);
  border-radius: 4px;
}

.select2-selection--single .select2-selection__rendered {
  display: block;
  padding-left: 8px;
  padding-right: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 35px;
  font-size: 0.7rem;
  color: var(--select2-text);
}

.select2-selection--single .select2-selection__placeholder {
  color: var(--select2-placeholder);
  font-size: 0.8rem;
}

/* Multiple Selection */
.select2-container .select2-selection--multiple {
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  min-height: 32px;
  user-select: none;
  -webkit-user-select: none;
  background-color: var(--select2-bg);
  border: 1px solid var(--select2-border);
  border-radius: 4px;
}

.select2-selection--multiple .select2-selection__rendered {
  display: inline-block;
  overflow: hidden;
  padding-left: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

/* Results */
.select2-results__options {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.select2-results__option {
  padding: 6px;
  user-select: none;
  -webkit-user-select: none;
  color: var(--select2-option-text);
  background-color: var(--select2-option-bg);
}

.select2-results__option[aria-selected=true] {
  background-color: var(--select2-selected-bg);
}

.select2-results__option--highlighted[aria-selected] {
  background-color: var(--select2-highlight-bg) !important;
  color: var(--select2-highlight-text) !important;
}

/* Arrow Styling */
.select2-selection--single .select2-selection__arrow {
  height: 26px;
  position: absolute;
  top: 1px;
  right: 1px;
  width: 20px;
}

.select2-selection--single .select2-selection__arrow b {
  border-color: var(--select2-arrow-color) transparent transparent transparent;
  border-style: solid;
  border-width: 5px 4px 0 4px;
  height: 0;
  left: 50%;
  margin-left: -4px;
  margin-top: -2px;
  position: absolute;
  top: 50%;
  width: 0;
}

.select2-container--open .select2-selection__arrow b {
  border-color: transparent transparent var(--select2-arrow-color) transparent;
  border-width: 0 4px 5px 4px;
}

/* Focus States */
.select2-container--focus .select2-selection--multiple {
  border: 1px solid var(--select2-focus-border);
  outline: 0;
}

/* Responsive Options */
.select2-results>.select2-results__options {
  max-height: 200px;
  overflow-y: auto;
}

/* Accessibility */
.select2-hidden-accessible {
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
}

/* RTL Support */
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
  padding-right: 8px;
  padding-left: 20px;
}


