/*!
 * FYAI Search — styling. Alles gescoped onder .fyai-search-root / .fyai-search
 * (geen site-brede selectors). Vervangt de drie .fyai-search-bar* classes uit
 * Code-Snippet #41. Behoudt de pill-look (centered, wit, rond, soft shadow).
 */

.fyai-search-root {
  display: block;
  position: relative;
  max-width: 620px;
  margin: 0 auto;
}

.fyai-search {
  position: relative;
}

/* ── input-veld (de pill, was .fyai-search-bar) ───────────────────────────── */
.fyai-search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.fyai-search-field:focus-within {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.14);
}

.fyai-search-icon {
  flex-shrink: 0;
  color: #9ca3af;
}

.fyai-search-input {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.2;
  color: #111827;
  padding: 0;
  margin: 0;
  appearance: none;
}

.fyai-search-input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* kruisje van type=search wegnemen (consistent ogen) */
.fyai-search-input::-webkit-search-decoration,
.fyai-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Blauwe stippel-focusring weg op ALLE search-velden (homepage + navbar). Het theme zet
   `:focus-visible { outline: 2px dotted #0076DF }` globaal — die verschijnt bij toetsenbord-
   focus (typen). Onze selector heeft hogere specificiteit (0,2,0 > 0,1,0) en wint zonder
   !important. Focus-indicatie blijft via .fyai-search-field:focus-within (box-shadow). */
.fyai-search-input:focus,
.fyai-search-input:focus-visible {
  outline: none;
}

/* ── dropdown-panel ───────────────────────────────────────────────────────── */
.fyai-search-panel {
  position: absolute;
  z-index: 50;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  max-height: 380px;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  padding: 6px;
}

.fyai-search-panel[hidden] {
  display: none;
}

.fyai-search-list {
  display: block;
}

/* ── resultaat-rij ────────────────────────────────────────────────────────── */
.fyai-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #111827;
  cursor: pointer;
}

.fyai-result.is-active,
.fyai-result:hover {
  background: #f3f4f6;
}

.fyai-result-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  background: #f9fafb;
}

.fyai-result-icon--empty {
  display: inline-block;
  background: #f3f4f6;
}

.fyai-result-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.fyai-result-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fyai-result-cat {
  font-size: 12px;
  color: #6b7280;
  text-transform: capitalize;
}

.fyai-result-snippet {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── answer-blok (AI-mode, additief — alleen zichtbaar als backend 't stuurt) ─ */
.fyai-search-answer {
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: #eef2ff;
  color: #1f2937;
  font-size: 13px;
  line-height: 1.45;
}

/* ── states ───────────────────────────────────────────────────────────────── */
.fyai-search-msg {
  padding: 14px 16px;
  font-size: 13px;
  color: #6b7280;
}

.fyai-search-loading { color: #6b7280; }
.fyai-search-empty { color: #6b7280; }
.fyai-search-error { color: #b91c1c; }

/* ── navbar-mount — compact + rechts uitgelijnd. Scoped op .fyai-search-nav (mount) +
   .fyai-nav-search-item (uk-navbar-item-wrapper). Homepage (.fyai-search-root zonder
   -nav) blijft ongemoeid.
   Kern van de fix: de input krijgt flex-basis 0 (`flex: 1 1 0`) i.p.v. de basis-
   `flex: 1 1 auto`. Met basis `auto` gebruikt de <input> z'n intrinsieke breedte
   (default size≈20 tekens ≈ ~200px) als startpunt → duwt het pill-veld tot ~250px,
   ondanks max-width/min-width:0. Met basis 0 start de input op 0 en vult 'ie alleen de
   resterende ruimte binnen het op 200px gepinde veld. ── */
.uk-navbar-item.fyai-nav-search-item { flex: 0 0 auto; min-width: 0; margin-left: auto; }
/* Werkelijke DOM: .uk-navbar-left bevat het LOGO, .uk-navbar-center = [menu, search].
   navbar-center heeft een sibling (navbar-left) → het theme centreert 'm absoluut
   (.uk-navbar-center:not(:only-child){position:absolute;left:50%;translate}). We heffen dat
   op voor ALLEEN de navbar-center mét de search en maken 'm een in-flow full-width flex-rij.
   De search blijft IN de flow (regel hierboven: flex:0 0 auto + margin-left:auto) → zichtbaar
   en tegen de rechterrand; het menu staat links (tegen het logo — bewuste eindstaat, menu-
   positie wordt in YOOtheme geregeld). Specificiteit via .tm-header (0,3,0) > theme (0,2,0).
   :has() = moderne browsers. */
.tm-header .uk-navbar-center:has(.fyai-nav-search-item) {
  position: static;
  transform: none;
  flex: 1 1 auto;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
}
.fyai-search-nav.fyai-search-root { width: 200px; max-width: 200px; min-width: 0; margin-left: auto; }
.fyai-search-nav .fyai-search,
.fyai-search-nav .fyai-search-field { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
.fyai-search-nav .fyai-search-field { padding: 6px 14px; }
.fyai-search-nav .fyai-search-input { flex: 1 1 0; width: 100%; min-width: 0; padding: 0 !important; font-size: 13px !important; }
