/* SM-824 -- styles for THE shared exercise search (static/tools/shared/exercise-search.js).
   The .exbr-search-* rules are the Exercise Feed's SM-532 search-field CSS, MOVED here
   verbatim out of templates/_exercise_browser.html so the Fretboard Tool's search
   pop-over wears the same field, chip and dropdown instead of a copy. theme.css tokens
   only; no hex literals. */

/* The field row. Positioned relative so the dropdown can anchor under it. */
.exbr-search-wrap { position: relative; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.exbr-search-input {
  flex: 1 1 220px; min-width: 0;
  font-family: 'Open Sans', sans-serif; font-size: 12.5px; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 20px;
  padding: 7px 16px; transition: border-color .15s;
}
.exbr-search-input:focus { outline: none; border-color: var(--accent); }
.exbr-search-clear {
  font-family: 'Open Sans', sans-serif; font-size: 11px; color: var(--text-mid);
  background: transparent; border: none; cursor: pointer; padding: 4px 6px;
  flex: 0 0 auto;
}
.exbr-search-clear:hover { color: var(--text); }
/* Active tag-quick-filter chip -- same active pill treatment as
   .exbr-filter-btn.exbr-active (copy, not new hex). */
.exbr-search-tagchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Open Sans', sans-serif; font-size: 11.5px; letter-spacing: .03em;
  background: var(--accent-dim, rgba(212,80,15,0.10)); border: 1px solid var(--accent);
  color: var(--accent-light); border-radius: 20px; padding: 6px 8px 6px 14px;
  flex: 0 0 auto;
}
/* SM-532 FIX ROUND (Jason: chip's own X wouldn't dismiss it) -- an author
   `display` declaration on an element overrides the browser's UA default
   `[hidden] { display: none }` regardless of specificity (author beats UA
   for equal-importance rules), so setting the `hidden` PROPERTY from JS
   never actually hid this chip once shown. This is the ONLY rule in this
   file's search-field CSS that sets `display` unconditionally on an
   element also toggled via `.hidden` (the clear button and dropdown never
   set `display`, so they were never affected). */
.exbr-search-tagchip[hidden] { display: none; }
.exbr-search-tagchip button {
  font-size: 11px; color: var(--accent-light); background: transparent; border: none; cursor: pointer;
  padding: 0 4px; line-height: 1;
}
.exbr-search-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 6;
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 8px;
  max-height: 320px; overflow-y: auto; padding: 4px 0;
}
.exbr-search-group-label {
  font-family: 'Open Sans', sans-serif; font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-dim); padding: 6px 14px 3px;
}
.exbr-search-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none; cursor: pointer;
  font-family: 'Open Sans', sans-serif; font-size: 12.5px; color: var(--text-mid);
  padding: 7px 14px; transition: background .1s, color .1s;
}
/* Same accent-dim-background + highlighted-text treatment as the feed's
   own .exbr-tab-active/.exbr-active precedent (var(--accent-dim)/
   var(--accent-light)), not an invented hover style. */
.exbr-search-item:hover, .exbr-search-item.exbr-search-item-active {
  background: var(--accent-dim, rgba(212,80,15,0.10)); color: var(--accent-light);
}
.exbr-search-item-tag-name { color: var(--accent-light); }
.exbr-search-empty { font-family: 'Open Sans', sans-serif; font-size: 12px; color: var(--text-mid); padding: 8px 14px; }

/* SM-824 -- the close glyph for this search's clear / remove-tag buttons: the
   site's close.svg, mask-painted so it takes the button's text colour (no raw
   character as a UI element). */
.exs-icon-close {
  display: inline-block; width: 10px; height: 10px; vertical-align: middle;
  background-color: currentColor;
  -webkit-mask: url("/app/static/icons/close.svg") center / contain no-repeat;
  mask: url("/app/static/icons/close.svg") center / contain no-repeat;
}

/* SM-824 -- compact result rows (SMExerciseSearch.resultRow). The feed's
   .module-row, shrunk for a pop-over: same thumbnail-left / title-over-meta
   layout, a 32px thumbnail instead of 64px. */
.exs-results { display: flex; flex-direction: column; }
.exs-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0;
  padding: 6px 8px; background: transparent; border: none; border-bottom: 1px solid var(--card-border);
  text-align: left; cursor: pointer; color: var(--text); transition: background .1s, color .1s;
}
.exs-row:hover:not(:disabled) { background: var(--accent-dim, rgba(212,80,15,0.10)); }
.exs-row:hover:not(:disabled) .exs-row-title { color: var(--accent-light); }
.exs-row:disabled { cursor: not-allowed; opacity: .45; }
.exs-row-thumb { flex: 0 0 auto; height: 32px; display: flex; align-items: center; }
.exs-row-thumb img { height: 32px; width: auto; max-width: 57px; object-fit: contain; border-radius: 2px; display: block; }
.exs-row-thumb-placeholder { width: 57px; background: var(--card-border); border-radius: 2px; }
.exs-row-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* SM-831 (Jason, 2026-09-28): "make the damn text WRAP, not get cut off!" -- a name
   this long is exactly the reason the pop-over widened to 650px; the row grows with
   it rather than truncating. overflow-wrap: anywhere covers an unbroken long name
   too (a single unbroken word still wraps instead of overflowing the row). */
.exs-row-title {
  font-family: 'Open Sans', sans-serif; font-weight: bold; font-size: 13px; line-height: 1.2;
  overflow-wrap: anywhere;
}
.exs-row-meta {
  font-family: 'Open Sans', sans-serif; font-size: 10.5px; color: var(--text-dim);
  overflow-wrap: anywhere;
}
