/* Searchable Select Component */

.searchable-select {
  position: relative;
  display: inline-block;
  min-width: 200px;
}

.searchable-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text);
  transition: all 0.2s;
}

.searchable-select-trigger:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.searchable-select-trigger:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha-10);
}

.searchable-select-value {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select-arrow {
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 10px;
}

.searchable-select-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
              0 2px 4px -1px rgba(0, 0, 0, 0.06);
  z-index: 50;
  max-height: 300px;
  display: flex;
  flex-direction: column;
}

.searchable-select-search {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: var(--font-size-sm);
  color: var(--text);
  background: var(--surface);
}

.searchable-select-search:focus {
  outline: none;
  background: var(--surface-hover);
}

.searchable-select-search::placeholder {
  color: var(--text-muted);
}

.searchable-select-options {
  overflow-y: auto;
  max-height: 250px;
}

.searchable-select-option {
  padding: 8px 12px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text);
  transition: background-color 0.15s;
}

.searchable-select-option:hover {
  background: var(--surface-hover);
}

.searchable-select-option.selected {
  background: var(--primary-alpha-10);
  color: var(--primary);
  font-weight: 500;
}

/* Scrollbar styling */
.searchable-select-options::-webkit-scrollbar {
  width: 6px;
}

.searchable-select-options::-webkit-scrollbar-track {
  background: var(--surface);
}

.searchable-select-options::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.searchable-select-options::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
