/**
 * @file
 * FlowDrop Search Toolbar Component Styles
 */

.fd-search-toolbar {
  display: flex;
  align-items: center;
  gap: var(--fd-space-4);
}

/* Search input container */
.fd-search-toolbar__search {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.fd-search-toolbar__icon {
  position: absolute;
  top: 50%;
  left: var(--fd-search-padding-x);
  width: 1.25rem;
  height: 1.25rem;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--fd-search-icon-color);
}

.fd-search-toolbar__input {
  width: 100%;
  padding: var(--fd-search-padding-y) var(--fd-search-padding-x);
  padding-inline-start: calc(var(--fd-search-padding-x) + 1.75rem);
  transition:
    border-color var(--fd-transition-fast),
    box-shadow var(--fd-transition-fast);
  color: var(--fd-search-text-color);
  border: var(--fd-border-width) solid var(--fd-search-border);
  border-radius: var(--fd-search-radius);
  background-color: var(--fd-search-bg);
  font-family: inherit;
  font-size: var(--fd-text-sm);
}

.fd-search-toolbar__input::placeholder {
  color: var(--fd-search-placeholder-color);
}

.fd-search-toolbar__input:focus {
  border-color: var(--fd-search-border-focus);
  outline: none;
  box-shadow: 0 0 0 3px rgb(59, 130, 246, 0.1);
}

/* Clear button for search (browser native) */
.fd-search-toolbar__input::-webkit-search-cancel-button {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath d='M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z'/%3E%3C/svg%3E");
  background-size: contain;
  -webkit-appearance: none;
  appearance: none;
}

/* View toggle buttons */
.fd-search-toolbar__views {
  display: flex;
  overflow: hidden;
  align-items: center;
  border: var(--fd-border-width) solid var(--fd-border);
  border-radius: var(--fd-radius-lg);
}

.fd-search-toolbar__view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  cursor: pointer;
  transition:
    background-color var(--fd-transition-fast),
    color var(--fd-transition-fast);
  color: var(--fd-muted-foreground);
  border: none;
  background-color: var(--fd-card);
}

.fd-search-toolbar__view-btn:not(:last-child) {
  border-inline-end: var(--fd-border-width) solid var(--fd-border);
}

.fd-search-toolbar__view-btn:hover {
  color: var(--fd-foreground);
  background-color: var(--fd-muted);
}

.fd-search-toolbar__view-btn--active {
  color: var(--fd-foreground);
  background-color: var(--fd-subtle);
}

.fd-search-toolbar__view-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Screen reader only text */
.fd-sr-only {
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  white-space: nowrap;
  border: 0;
}
