/* Select Component Styles — WAI-ARIA 1.2 combobox widget */

.dhcs-select {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.dhcs-select-label {
  display: block;
  font-family: var(--dhcs-font-family-heading, "Public Sans", sans-serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dhcs-color-text-primary, #1b1b1b);
  margin-bottom: 4px;
}

.dhcs-select-helper {
  display: block;
  font-family: var(--dhcs-font-family-default, "Source Sans 3", sans-serif);
  font-size: 0.8rem;
  color: var(--dhcs-color-text-secondary, #474646);
}

.dhcs-select-readonly-value {
  display: block;
  font-family: var(--dhcs-font-family-default, "Source Sans 3", sans-serif);
  font-size: 0.9rem;
  color: var(--dhcs-color-text-primary, #1b1b1b);
  padding: 8px 0;
  border-radius: 2px;
}

.dhcs-select-readonly-value:focus-visible {
  outline: 2px solid var(--dhcs-color-secondary, #2d6e8d);
  outline-offset: 2px;
}

.dhcs-combobox-wrapper {
  position: relative;
  width: 100%;
}

.dhcs-combobox-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font-family: var(--dhcs-font-family-default, "Source Sans 3", sans-serif);
  font-size: 0.9rem;
  color: var(--dhcs-color-text-primary, #1b1b1b);
  background: var(--dhcs-color-bg-white, #ffffff);
  border: 1px solid var(--dhcs-color-border-medium, #adabaa);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease;
}

.dhcs-combobox-wrapper:not(.dhcs-combobox-disabled) .dhcs-combobox-trigger:hover {
  border-color: var(--dhcs-color-secondary, #2d6e8d);
}

.dhcs-combobox-trigger:focus-visible {
  outline: 2px solid var(--dhcs-color-secondary, #2d6e8d);
  outline-offset: 2px;
  border-color: var(--dhcs-color-secondary, #2d6e8d);
}

.dhcs-combobox-disabled .dhcs-combobox-trigger {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--dhcs-color-bg-gray2, #f6f6f6);
}

.dhcs-combobox-value {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dhcs-combobox-icon {
  flex-shrink: 0;
  margin-left: 8px;
  color: var(--dhcs-color-text-secondary, #474646);
  transition: transform 0.15s ease;
}

.dhcs-combobox-icon-open {
  transform: rotate(180deg);
}

.dhcs-combobox-listbox {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: var(--dhcs-color-bg-white, #ffffff);
  border: 1px solid var(--dhcs-color-border-medium, #adabaa);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  max-height: 260px;
  overflow-y: auto;
}

.dhcs-combobox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: var(--dhcs-font-family-default, "Source Sans 3", sans-serif);
  font-size: 0.9rem;
  color: var(--dhcs-color-text-primary, #1b1b1b);
  cursor: pointer;
  user-select: none;
  min-height: 44px;
}

.dhcs-combobox-option:hover,
.dhcs-combobox-option-active {
  background: var(--dhcs-color-bg-hover, #d9e0e7);
}

.dhcs-combobox-option-selected {
  font-weight: 600;
  color: var(--dhcs-color-primary, #17315a);
}

.dhcs-combobox-option-selected.dhcs-combobox-option-active {
  background: var(--dhcs-color-bg-hover, #d9e0e7);
}

.dhcs-multiselect-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid var(--dhcs-color-border-medium, #adabaa);
  border-radius: 2px;
  font-size: 11px;
  line-height: 1;
  color: var(--dhcs-color-primary, #17315a);
}

.dhcs-combobox-option-selected .dhcs-multiselect-checkbox {
  background: var(--dhcs-color-primary, #17315a);
  border-color: var(--dhcs-color-primary, #17315a);
  color: #ffffff;
}

@media (max-width: 600px) {
  .dhcs-select {
    width: 100%;
  }
}
