/* assets/css/gathr-combobox.css
 * Componente nativo vanilla para Combobox / Select pesquisável do Gathr
 * Totalmente compatível com Bootstrap 5 e identidade visual Roxa (--nx-purple)
 */

.gathr-combobox-wrapper {
  position: relative;
  width: 100%;
  display: block;
}

.gathr-combobox-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.65rem 0.88rem;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #ffffff;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  user-select: none;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.gathr-combobox-toggle:hover {
  border-color: #b0b7c3;
}

.gathr-combobox-toggle:focus,
.gathr-combobox-wrapper.is-open .gathr-combobox-toggle {
  outline: 0;
  border-color: #481389;
  box-shadow: 0 0 0 0.25rem rgba(72, 19, 137, 0.25);
}

.gathr-combobox-selected-text {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.5rem;
  line-height: 1.5;
}

.gathr-combobox-selected-text.is-placeholder {
  color: #6c757d;
  font-weight: 400;
}

.gathr-combobox-icons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  color: #6c757d;
  font-size: 0.75rem;
}

.gathr-combobox-clear {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.gathr-combobox-clear:hover {
  color: #dc3545;
  background: #f8d7da;
}

.gathr-combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1055;
  display: none;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(72, 19, 137, 0.15);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: gathrComboboxFadeIn 0.18s ease-out;
}

@keyframes gathrComboboxFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gathr-combobox-wrapper.is-open .gathr-combobox-dropdown {
  display: flex;
}

.gathr-combobox-search-box {
  padding: 0.5rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.gathr-combobox-search-input {
  width: 100%;
  padding: 0.35rem 0.5rem 0.35rem 1.85rem;
  font-size: 0.875rem;
  border: 1px solid #ced4da;
  border-radius: 6px;
  background-color: #ffffff;
  color: #212529;
  outline: none;
  transition: border-color 0.15s ease;
}

.gathr-combobox-search-input:focus {
  border-color: #481389;
  box-shadow: 0 0 0 2px rgba(72, 19, 137, 0.15);
}

.gathr-combobox-search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 0.8rem;
  pointer-events: none;
}

.gathr-combobox-options-list {
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  padding: 0.25rem 0;
  margin: 0;
}

.gathr-combobox-options-list::-webkit-scrollbar {
  width: 6px;
}
.gathr-combobox-options-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
.gathr-combobox-options-list::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.gathr-combobox-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  color: #374151;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.gathr-combobox-option:hover,
.gathr-combobox-option.is-highlighted {
  background-color: #f4efff;
  color: #481389;
}

.gathr-combobox-option.is-selected {
  font-weight: 600;
  color: #481389;
  background-color: #ede5ff;
}

.gathr-combobox-empty {
  padding: 1.25rem 0.75rem;
  font-size: 0.85rem;
  color: #9ca3af;
  text-align: center;
}

/* Tamanho compacto correspondente ao exato .form-select-sm do Bootstrap 5 (padding: 0.25rem 0.5rem, font-size: 0.875rem) */
.gathr-combobox-wrapper.is-sm .gathr-combobox-toggle {
  min-height: 31px;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
  line-height: 1.5;
}
.gathr-combobox-wrapper.is-sm .gathr-combobox-selected-text {
  font-size: 0.875rem;
}
.gathr-combobox-wrapper.is-sm .gathr-combobox-option {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
}
