/**
 * File Browser — Search Box
 * Ported verbatim from scitex-cloud stx-app-file-tree/search.css
 */

.stx-app-file-tree__search-box {
  background: var(--workspace-bg-default, #1e1e1e);
  border-top: 1px solid
    var(--workspace-border-default, rgba(110, 118, 129, 0.3));
  padding: 6px 8px;
  flex-shrink: 0;
}

.stx-app-file-tree__search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--workspace-bg-input, #1e1e1e);
  border: 1px solid var(--workspace-border-default, rgba(110, 118, 129, 0.3));
  border-radius: 4px;
  padding: 3px 8px;
  gap: 6px;
}

.stx-app-file-tree__search-input-wrapper:focus-within {
  border-color: var(--color-accent-fg, #58a6ff);
  box-shadow: 0 0 0 1px var(--color-accent-fg, #58a6ff);
}

.stx-app-file-tree__search-icon {
  color: var(--color-fg-muted, #768390);
  font-size: 11px;
  flex-shrink: 0;
}

.stx-app-file-tree__search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-fg-default, #e6edf3) !important;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  min-width: 0;
  padding: 2px 0;
  -webkit-text-fill-color: var(--color-fg-default, #e6edf3);
}

.stx-app-file-tree__search-input::placeholder {
  color: var(--color-fg-muted, #768390) !important;
  opacity: 1;
}

.stx-app-file-tree__search-clear {
  background: transparent;
  border: none;
  color: var(--color-fg-muted, #768390);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  font-size: 11px;
  flex-shrink: 0;
}

.stx-app-file-tree__search-clear:hover {
  color: var(--color-fg-default, #e6edf3);
  background: var(--workspace-bg-hover, rgba(127, 127, 127, 0.1));
}

/* Search highlighting: matching items stay white */
.stx-app-file-tree__item.stx-app-file-tree__search-match .stx-app-file-tree__name {
  color: var(--color-fg-default, #e6edf3);
}

/* Ancestor directories of matching items stay white */
.stx-app-file-tree__item.stx-app-file-tree__search-ancestor .stx-app-file-tree__name {
  color: var(--color-fg-default, #e6edf3);
}

/* Non-matching items heavily dimmed */
.stx-app-file-tree__item.stx-app-file-tree__search-dim {
  opacity: 0.25;
}
