/*
  Typeahead Component
*/

.Typeahead-Container {
  position: relative;
  width: 100%;
}

.Typeahead-Results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--input-background, white);
  border: var(--input-border, 1px solid #d1d5db);
  border-top: none;
  border-radius: 0 0 var(--input-radius, 6px) var(--input-radius, 6px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.Typeahead-Results.isVisible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.Typeahead-Item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--super-dropdown-item-border, #f3f4f6);
  transition: background-color 0.15s ease;
}

.Typeahead-Item:hover,
.Typeahead-Item.isSelected {
  background-color: var(--super-dropdown-item-hover-background, #f9fafb);
}

.Typeahead-Item:last-child {
  border-bottom: none;
}

.Typeahead-ItemContent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.Typeahead-ItemIcon {
  flex-shrink: 0;
  color: var(--super-dropdown-item-meta-color, #6b7280);
  margin-top: 2px;
}

.Typeahead-ItemText {
  flex: 1;
  min-width: 0;
}

.Typeahead-ItemName {
  font-size: var(--super-dropdown-font-size, 14px);
  font-weight: 500;
  color: var(--text-color, #111827);
  line-height: 1.4;
  margin-bottom: 2px;
}

.Typeahead-ItemType {
  font-size: var(--super-dropdown-item-meta-font-size, 12px);
  color: var(--super-dropdown-item-meta-color, #6b7280);
  text-transform: capitalize;
}

.Typeahead-Loading,
.Typeahead-NoResults,
.Typeahead-Error {
  padding: 16px;
  text-align: center;
}

.Typeahead-LoadingContent,
.Typeahead-NoResultsContent,
.Typeahead-ErrorContent {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--super-dropdown-item-meta-font-size, 12px);
  color: var(--super-dropdown-item-meta-color, #6b7280);
}

.Typeahead-Error .Typeahead-ErrorContent {
  color: #dc2626;
}

.Typeahead-Input {
  position: relative;
}

.Typeahead-Input input {
  padding-right: 40px;
}

.Typeahead-ClearButton {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: var(--super-dropdown-item-meta-color, #6b7280);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.Typeahead-ClearButton:hover {
  color: var(--text-color, #111827);
  background-color: var(--super-dropdown-item-hover-background, #f3f4f6);
}

.Typeahead-ClearButton:focus {
  outline: 2px solid var(--focus-ring-color, #3b82f6);
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .Typeahead-Results {
    max-height: 250px;
  }
  
  .Typeahead-Item {
    padding: 10px 12px;
  }
  
  .Typeahead-ItemContent {
    gap: 10px;
  }
}
