/* ReferencePicker component styles.
   Uses Omnis semantic tokens only — no hard-coded colors.

   Host must include this file:
     <link rel="stylesheet" href="_content/Omnis.Shared.UI/components/reference-picker.css" /> */

/* ── Field (chip rail + input wrapper) ──────────────────── */

.omnis-reference-picker__field:focus-within {
  outline: 2px solid var(--focus-ring);
  outline-offset: 0;
  border-color: var(--border-strong);
}

/* Suppress native outline on the inner input (field wrapper carries it) */
.omnis-reference-picker__input:focus {
  outline: none;
}

/* ── Dirty state field border ────────────────────────────── */

.omnis-reference-picker--dirty .omnis-reference-picker__field {
  border-color: var(--state-active-border);
}

/* ── Chip remove button hover / focus ────────────────────── */

.omnis-reference-picker__chip-remove:hover {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-full);
}

.omnis-reference-picker__chip-remove:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-radius: var(--radius-full);
}

/* ── Toolbar buttons hover / focus ───────────────────────── */

.omnis-reference-picker__select-all:hover:not(:disabled),
.omnis-reference-picker__unselect-all:hover:not(:disabled) {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.omnis-reference-picker__select-all:focus-visible,
.omnis-reference-picker__unselect-all:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

/* ── Lookup option hover ─────────────────────────────────── */

.omnis-reference-picker__option:not(.omnis-reference-picker__option--highlighted):not(.omnis-reference-picker__option--disabled):hover {
  background: var(--accent-bg);
  cursor: pointer;
}

/* ── Busy spinner animation ──────────────────────────────── */

@keyframes omnis-refpick-spin {
  to { stroke-dashoffset: -31; }
}

.omnis-reference-picker__busy-icon {
  animation: omnis-refpick-spin 0.9s linear infinite;
  transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
  .omnis-reference-picker__busy-icon {
    animation: none;
  }
}

/* ── Large chip sets: wrapping containment ───────────────── */

/* Field wraps chips into multiple rows and clips any chip that
   would otherwise exceed the field's inline boundary.            */
.omnis-reference-picker__field {
  overflow: hidden;
  min-width: 0;
}

/* Chips do not shrink below their natural size; they wrap to
   the next row instead. The max-width cap in the inline style
   ensures no single chip can exceed 200px.                       */
.omnis-reference-picker__chip {
  flex-shrink: 0;
  max-width: 100%;
}

/* ── Forced colors (high-contrast) ───────────────────────── */

@media (forced-colors: active) {
  .omnis-reference-picker__option--highlighted {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
  }

  .omnis-reference-picker__option--selected .omnis-reference-picker__option-check {
    forced-color-adjust: none;
    border: 2px solid Highlight;
  }

  .omnis-reference-picker__chip {
    forced-color-adjust: none;
    border: 1px solid Highlight;
  }

  .omnis-reference-picker__busy-icon circle {
    stroke: ButtonText;
  }

  .omnis-reference-picker__dirty-badge {
    forced-color-adjust: none;
    border: 1px solid Highlight;
  }
}
