/**
 * @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;
  left: var(--fd-search-padding-x);
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--fd-search-icon-color);
  pointer-events: none;
}

.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);
  font-family: inherit;
  font-size: var(--fd-text-sm);
  color: var(--fd-search-text-color);
  background-color: var(--fd-search-bg);
  border: var(--fd-border-width) solid var(--fd-search-border);
  border-radius: var(--fd-search-radius);
  transition: border-color var(--fd-transition-fast),
    box-shadow var(--fd-transition-fast);
}

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

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

/* Clear button for search (browser native) */
.fd-search-toolbar__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 1rem;
  height: 1rem;
  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;
  cursor: pointer;
}

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

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

.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 {
  background-color: var(--fd-muted);
  color: var(--fd-foreground);
}

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

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

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