/* ═══════════════════════════════════════════════════════════
   BOUYON SEARCH — overlay modal accessible from any Bouyon page
   ═══════════════════════════════════════════════════════════ */

.bouyon-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.bouyon-search-trigger:hover,
.bouyon-search-trigger:focus-visible {
  border-color: #ff6b6b;
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.06);
  outline: none;
}

.bouyon-search-trigger__icon {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.bouyon-search-trigger__hint {
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0.6;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 3px;
}

/* Mobile compact <480px: drop "Rechercher" label + ⌘K hint, keep only icon
   to prevent topbar overflow on small viewports (390px, 320px). */
@media (max-width: 480px) {
  .bouyon-search-trigger {
    padding: 6px 8px;
    gap: 0;
    min-width: 36px;
    justify-content: center;
  }
  /* Hide all child spans except keep the icon SVG visible
     (le label "Rechercher" est un <span> sans classe — on cible tous les spans
     pour les cacher en mobile). */
  .bouyon-search-trigger > span {
    display: none;
  }
}

/* Overlay */
.bouyon-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 24px;
  overflow-y: auto;
  animation: bouyon-search-fade 0.2s ease-out;
}

.bouyon-search-overlay.is-open {
  display: flex;
}

@keyframes bouyon-search-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.bouyon-search-modal {
  width: 100%;
  max-width: 720px;
  background: #0a0c12;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 107, 107, 0.08);
}

/* Search input row */
.bouyon-search-input-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bouyon-search-input-row__icon {
  width: 18px;
  height: 18px;
  fill: #ff6b6b;
}

.bouyon-search-input {
  background: transparent;
  border: 0;
  outline: 0;
  padding: 4px 0;
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  color: #f2f2f2;
  width: 100%;
}

.bouyon-search-input::placeholder {
  color: rgba(242, 242, 242, 0.42);
}

.bouyon-search-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
  padding: 4px 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.18s;
}

.bouyon-search-close:hover {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

/* Results list */
.bouyon-search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px 0;
}

.bouyon-search-results__empty {
  padding: 24px 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.52);
  font-family: "Manrope", sans-serif;
  font-size: 14px;
}

.bouyon-search-results__category {
  padding: 12px 18px 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ff6b6b;
}

.bouyon-search-result {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-left: 2px solid transparent;
}

.bouyon-search-result:hover,
.bouyon-search-result.is-active {
  background: rgba(255, 107, 107, 0.06);
  border-left-color: #ff6b6b;
}

.bouyon-search-result__badge {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 107, 107, 0.14);
  color: #ff6b6b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 700;
}

.bouyon-search-result__body {
  min-width: 0;
}

.bouyon-search-result__name {
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #f2f2f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bouyon-search-result__meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(242, 242, 242, 0.52);
  margin-top: 2px;
  text-transform: uppercase;
}

.bouyon-search-result__arrow {
  color: rgba(255, 255, 255, 0.32);
  font-size: 12px;
}

.bouyon-search-result:hover .bouyon-search-result__arrow,
.bouyon-search-result.is-active .bouyon-search-result__arrow {
  color: #ff6b6b;
}

/* Highlight matched substring */
.bouyon-search-result mark {
  background: rgba(255, 107, 107, 0.22);
  color: #ff6b6b;
  padding: 0 2px;
  border-radius: 2px;
}

/* Footer hints */
.bouyon-search-footer {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.bouyon-search-footer kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  font-family: inherit;
  font-size: 9px;
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 640px) {
  .bouyon-search-overlay {
    padding: 50px 12px 12px;
  }
  .bouyon-search-input {
    font-size: 15px;
  }
  .bouyon-search-trigger__hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bouyon-search-overlay {
    animation: none;
  }
}
