/* Canonical autocomplete/typeahead results. One implementation, used by every
   typeahead Stimulus controller. Rules are independent and single-class;
   rendering is altered by ADDING classes (never nested/compound selectors).
   Visibility is also forced inline by lib/autocomplete_results.js, so it does
   not depend on this file's load order. */

.autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: var(--surface-white);
  border: 1px solid var(--medium-gray);
  border-top: none;
  border-radius: 0 0 0.25rem 0.25rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: none;
}

.autocomplete-results-visible {
  display: block;
}

/* Escapes ancestor `overflow` clipping (e.g. inside a modal). The controller
   sets top/left/width from the input's bounding rect when showing. */
.autocomplete-results-fixed {
  position: fixed;
  z-index: 9999;
}

.autocomplete-result {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--light-gray);
}

.autocomplete-result:hover,
.autocomplete-result-active {
  background-color: var(--primary-color);
  color: white;
}

.autocomplete-result-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.autocomplete-result-preview {
  font-size: 0.875rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--medium-gray);
  font-style: italic;
}
