/* Shared select controls across the public, user, admin, auth and onboarding UI. */
:root {
  --fesarea-select-border: var(--fesarea-line, #d8e2eb);
  --fesarea-select-focus: var(--fesarea-primary, #0ea2bd);
  --fesarea-select-text: var(--fesarea-ink, #18212f);
  --fesarea-select-muted: var(--fesarea-muted, #64748b);
}

select.form-control:not([multiple]):not([size]):not(.select2-hidden-accessible),
select.form-select:not([multiple]):not([size]):not(.select2-hidden-accessible),
select.custom-select:not([multiple]):not([size]):not(.select2-hidden-accessible),
select.searchable-select:not([multiple]):not([size]):not(.select2-hidden-accessible) {
  -webkit-appearance: none;
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  border: 1px solid var(--fesarea-select-border);
  border-radius: 8px;
  color: var(--fesarea-select-text);
  font: inherit;
  font-size: 1rem;
  height: 48px !important;
  line-height: 1.5;
  padding: 0.65rem 2.75rem 0.65rem 1rem;
  text-overflow: ellipsis;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

html[dir="rtl"] select.form-control:not([multiple]):not([size]):not(.select2-hidden-accessible),
html[dir="rtl"] select.form-select:not([multiple]):not([size]):not(.select2-hidden-accessible),
html[dir="rtl"] select.custom-select:not([multiple]):not([size]):not(.select2-hidden-accessible),
html[dir="rtl"] select.searchable-select:not([multiple]):not([size]):not(.select2-hidden-accessible) {
  background-position: left 1rem center;
  padding-left: 2.75rem;
  padding-right: 1rem;
}

select.form-control:not(.select2-hidden-accessible):focus,
select.form-select:not(.select2-hidden-accessible):focus,
select.custom-select:not(.select2-hidden-accessible):focus,
select.searchable-select:not(.select2-hidden-accessible):focus {
  border-color: var(--fesarea-select-focus) !important;
  box-shadow: 0 0 0 0.2rem rgba(14, 162, 189, 0.14) !important;
  outline: 0;
}

select.form-control:not(.select2-hidden-accessible):disabled,
select.form-select:not(.select2-hidden-accessible):disabled,
select.custom-select:not(.select2-hidden-accessible):disabled,
select.searchable-select:not(.select2-hidden-accessible):disabled {
  background-color: #f3f6f8;
  color: var(--fesarea-select-muted);
  cursor: not-allowed;
  opacity: 1;
}

select.form-control.is-invalid,
select.form-select.is-invalid,
select.custom-select.is-invalid,
select.searchable-select.is-invalid {
  border-color: #dc3545 !important;
}

select.form-control[multiple],
select.form-control[size],
select.form-select[multiple],
select.form-select[size],
select.custom-select[multiple],
select.custom-select[size],
select.searchable-select[multiple],
select.searchable-select[size] {
  background: #fff;
  border: 1px solid var(--fesarea-select-border);
  border-radius: 8px;
  color: var(--fesarea-select-text);
  line-height: 1.5;
  min-height: 120px;
  padding: 0.65rem 0.75rem;
  width: 100%;
}

select.form-control-sm:not([multiple]):not([size]),
select.custom-select-sm:not([multiple]):not([size]),
select.form-select-sm:not([multiple]):not([size]) {
  background-position: right 0.65rem center;
  height: 38px !important;
  min-height: 38px;
  padding-bottom: 0.35rem;
  padding-right: 2.25rem;
  padding-top: 0.35rem;
}

html[dir="rtl"] select.form-control-sm:not([multiple]):not([size]),
html[dir="rtl"] select.custom-select-sm:not([multiple]):not([size]),
html[dir="rtl"] select.form-select-sm:not([multiple]):not([size]) {
  background-position: left 0.65rem center;
  padding-left: 2.25rem;
  padding-right: 0.75rem;
}

.select2-container {
  max-width: 100%;
}

.select2-container .select2-selection--single,
.select2-container .select2-selection--multiple {
  background-color: #fff;
  border: 1px solid var(--fesarea-select-border) !important;
  border-radius: 8px !important;
  min-height: 48px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.select2-container .select2-selection--single .select2-selection__rendered {
  color: var(--fesarea-select-text);
  line-height: 46px;
  padding-left: 1rem;
  padding-right: 2.75rem;
}

.select2-container .select2-selection--single .select2-selection__arrow {
  height: 46px;
  right: 0.75rem;
}

html[dir="rtl"] .select2-container .select2-selection--single .select2-selection__rendered {
  padding-left: 2.75rem;
  padding-right: 1rem;
}

html[dir="rtl"] .select2-container .select2-selection--single .select2-selection__arrow {
  left: 0.75rem;
  right: auto;
}

.select2-container .select2-selection--multiple {
  padding: 0.25rem 0.5rem;
}

.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default.select2-container--open .select2-selection,
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
  border-color: var(--fesarea-select-focus) !important;
  box-shadow: 0 0 0 0.2rem rgba(14, 162, 189, 0.14) !important;
}

.select2-dropdown {
  border-color: var(--fesarea-select-border) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--fesarea-select-focus) !important;
}
