/* CyberUniversity Select, adapted from Select.module.css for Jinja/vanilla JS.
   Source hashes and the unchanged shared tokens are recorded in design/. */
.select-field {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.indeal-select,
.indeal-select-panel {
  --select-body-size: 15px;
  --select-body-lh: 1.5;
}

.indeal-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.indeal-select.is-disabled {
  opacity: 0.5;
}

/* Author display rules for native controls must not override [hidden]. */
select.indeal-select-native[hidden] {
  display: none;
}

.indeal-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  min-block-size: var(--paired-control-height, var(--control-h-md));
  padding: var(--paired-control-pad-y, var(--space-2)) var(--space-4);
  font-family: inherit;
  font-weight: 600;
  font-size: var(--select-body-size);
  line-height: var(--select-body-lh);
  color: var(--color-text);
  background: var(--field-fill);
  border: 1.5px solid var(--field-border);
  border-radius: var(--r-md);
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease-out-soft),
    background-color var(--dur-fast) var(--ease-out-soft);
}

.indeal-select-trigger:disabled {
  cursor: not-allowed;
}

.indeal-select-trigger:hover:not(:disabled),
.indeal-select-trigger.is-open {
  border-color: var(--color-primary);
}

.indeal-select-trigger:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: var(--focus-ring-shadow);
}

.indeal-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.indeal-select-chevron {
  flex: none;
  color: var(--color-text-muted);
  transition: transform var(--dur-fast) var(--ease-out-soft);
}

.indeal-select-trigger.is-open .indeal-select-chevron {
  transform: rotate(180deg);
}

.indeal-select-panel {
  position: fixed;
  z-index: var(--z-select-panel);
  width: max-content;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  background: var(--glass-popover-fill);
  box-shadow: var(--shadow-popover);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  overflow: hidden;
}

.indeal-select-panel[data-positioned="false"] {
  opacity: 0;
  pointer-events: none;
}

.indeal-select-panel[data-positioned="true"] {
  animation: indeal-select-unfold var(--dur-fast) var(--ease-out-soft);
}

@keyframes indeal-select-unfold {
  from { opacity: 0; transform: scaleY(0.7); }
  to { opacity: 1; transform: scaleY(1); }
}

.indeal-select-list {
  max-height: 240px;
  padding: var(--space-1);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.indeal-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2);
  font: inherit;
  font-size: var(--select-body-size);
  line-height: var(--select-body-lh);
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out-soft);
}

.indeal-select-option[aria-selected="true"] {
  background: var(--accent-plane);
  border-color: var(--accent-hairline);
}

.indeal-select-option:disabled {
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.indeal-select-option:focus-visible,
.indeal-select-option:hover:not(:disabled) {
  background: var(--field-fill);
  outline: none;
  box-shadow: none;
}

.indeal-select-option-label {
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.indeal-select-check {
  flex: none;
  color: var(--color-primary-text);
}

@media (max-width: 640px) {
  .indeal-select-trigger { font-size: max(16px, var(--select-body-size)); }
  .indeal-select-option { padding: var(--space-3) var(--space-2); }
}

@media (prefers-reduced-transparency: reduce) {
  .indeal-select-panel {
    backdrop-filter: none;
    background: var(--color-surface);
  }
}

@media (prefers-contrast: more) {
  .indeal-select-panel {
    backdrop-filter: none;
    background: var(--color-surface);
    border-color: var(--color-border);
  }
}

@supports not (backdrop-filter: blur(1px)) {
  .indeal-select-panel { background: var(--color-surface); }
}

@media (prefers-reduced-motion: reduce) {
  .indeal-select-panel[data-positioned="true"] { animation: none; }
  .indeal-select-chevron,
  .indeal-select-trigger,
  .indeal-select-option { transition: none; }
}

@media (forced-colors: active) {
  .indeal-select-trigger,
  .indeal-select-panel {
    background: Field;
    color: FieldText;
    border-color: FieldText;
    backdrop-filter: none;
    box-shadow: none;
  }
  .indeal-select-option[aria-selected="true"] { border-color: Highlight; }
  .indeal-select-option:focus-visible,
  .indeal-select-option:hover:not(:disabled) {
    background: Highlight;
    color: HighlightText;
  }
  .indeal-select-option:disabled { color: GrayText; }
  .indeal-select-chevron,
  .indeal-select-check { color: inherit; }
  .indeal-select-trigger:focus-visible { outline-color: Highlight; }
}
