/* IDE.FindBar — in-content-editor find bar + CSS Custom Highlight paints.
   Design: a viewer-agnostic find bar (see ide-find-bar.js). */

.ide-findbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
}

.ide-fb-input {
  width: 160px;
  min-width: 90px;
  background: var(--bg-input, #0f0f1e);
  color: var(--text, #e6e6f0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 12px;
  outline: none;
}
.ide-fb-input:focus {
  border-color: var(--accent, #3a78c4);
}

.ide-fb-toggle,
.ide-fb-nav {
  background: var(--bg-input, #0f0f1e);
  color: var(--text-dim, #9a9ab0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}
.ide-fb-nav {
  font-size: 14px;
  padding: 0 7px;
}
.ide-fb-toggle.active {
  background: var(--accent, #3a78c4);
  color: #fff;
  border-color: var(--accent, #3a78c4);
}
.ide-fb-nav:disabled {
  opacity: 0.4;
  cursor: default;
}

.ide-fb-count {
  font-size: 11px;
  color: var(--text-dim, #9a9ab0);
  min-width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ide-fb-count.ide-fb-nomatch {
  color: var(--danger, #e56464);
}

/* The CSS Custom Highlight paints. Highlight names are suffixed with the
   bar id at runtime; ::highlight() can't take a dynamic name, so we paint
   per-bar names by registering a shared rule for the known prefixes via
   attribute-independent ::highlight selectors below. Browsers match
   ::highlight(name) by exact name, so we declare a band of likely ids.
   To keep it simple + robust we instead style by a STABLE name the bar
   also registers (see note). */

/* Every-match highlight (muted) and the active match (strong). The bar
   registers both a per-id name AND these stable aliases. */
::highlight(ide-find-all) {
  background-color: rgba(245, 211, 58, 0.35);
}
::highlight(ide-find-active) {
  background-color: #f5d33a;
  color: #1a1a36;
}
