.custom-select-wrapper {
  position: relative;
  display: inline-block;
  min-width: 140px;
  font-family: inherit;
}

/* Trigger Button */
.custom-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.custom-select-wrapper[data-custom-select-lg] .custom-select__trigger {
  height: 48px;
  font-size: 1rem;
}

.custom-select-wrapper.is-open .custom-select__trigger {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
}

.custom-select__value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 0.5rem;
}

.custom-select__icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.custom-select-wrapper.is-open .custom-select__icon {
  transform: rotate(180deg);
}

.custom-select__left-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.custom-select__left-icon svg {
  width: 16px;
  height: 16px;
}

/* Dropdown Menu */
.custom-select__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  min-width: max-content;
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.custom-select-wrapper.is-open .custom-select__dropdown {
  display: flex;
}

/* Search Bar */
.custom-select__search {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.custom-select__search input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}

.custom-select__search input:focus {
  border-color: var(--brand);
}

/* Options List */
.custom-select__options {
  max-height: 150px;
  overflow-y: auto;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
}

/* Option Item */
.custom-select__option {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 0.875rem;
  color: var(--text);
}

.custom-select__option:hover {
  background-color: var(--surface-2);
}

.custom-select__option.is-hidden {
  display: none !important;
}

/* Custom Checkbox */
.custom-select__checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  margin-right: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-color: var(--surface);
  transition: all 0.2s ease;
}

.custom-select__checkbox svg {
  width: 12px;
  height: 12px;
  color: white;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.custom-select__option.is-selected .custom-select__checkbox {
  background-color: var(--brand);
  border-color: var(--brand);
}

.custom-select__option.is-selected .custom-select__checkbox svg {
  opacity: 1;
  transform: scale(1);
}

.custom-select__option-text {
  flex-grow: 1;
}

/* Actions Footer (Clear / Done) */
.custom-select__actions {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  background-color: var(--surface-2);
}

.custom-select__btn {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.675rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  line-height: normal;
}

.custom-select__btn--clear {
  background-color: var(--surface-3);
  color: var(--text-muted);
}

.custom-select__btn--clear:hover {
  color: var(--text);
  background-color: var(--surface-3);
}

.custom-select__btn--done {
  background-color: var(--brand);
  color: white;
}

.custom-select__btn--done:hover {
  background-color: var(--brand-hover);
}
