.autocomplete-wrapper {
  position: relative;
}

.autocomplete-results {
  position: absolute;
  top: 0; /* overridden by JS to align with input bottom */
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: 280px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.07),
    0 10px 20px -4px rgba(0, 0, 0, 0.1);
  animation: autocomplete-appear 0.12s ease-out;
  transform-origin: top center;

  /* Scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.autocomplete-results::-webkit-scrollbar {
  width: 5px;
}

.autocomplete-results::-webkit-scrollbar-track {
  background: transparent;
}

.autocomplete-results::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 9999px;
}

.autocomplete-results.hidden {
  display: none;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  color: #1e293b;
  line-height: 1.4;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background-color 0.1s ease, color 0.1s ease;
  user-select: none;
}

.autocomplete-item:first-child {
  border-radius: 0.5rem 0.5rem 0 0;
}

.autocomplete-item:last-child {
  border-bottom: none;
  border-radius: 0 0 0.5rem 0.5rem;
}

.autocomplete-item:only-child {
  border-radius: 0.5rem;
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
  background-color: #f0f7ff;
  color: #1d4ed8;
}

@keyframes autocomplete-appear {
  from {
    opacity: 0;
    transform: scaleY(0.95) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scaleY(1) translateY(0);
  }
}
