/* =========================================================
   search.css — AJAX Live Search dropdown component
   ---------------------------------------------------------
   Fixed dark theme per spec (independent of the site's own
   light/dark mode toggle - this dropdown is always dark,
   matching the reference screenshot exactly):
     Background:      #1f2430
     Hover:            #2b3242
     Text:             #ffffff
     Secondary text:   #9ca3af
     Border radius:    12px
   ========================================================= */

/* The search forms need to be a positioning anchor for the
   absolutely-positioned dropdown below them. */
.search-form,
.search-form-mobile {
  position: relative;
}

.live-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #1f2430;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  max-height: 420px;
  overflow-y: auto;
  z-index: 1052;
  /* Fade + slide entrance. This is a small, absolutely-positioned
     overlay (removed from normal document flow) - animating it can
     never shift or shake the surrounding page layout. */
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.live-search-dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- Result item ---------- */
.live-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}
.live-search-item:last-child { border-bottom: none; }
.live-search-item:hover,
.live-search-item.active {
  background: #2b3242;
  color: #ffffff;
}

.live-search-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: #2b3242;
}

.live-search-info {
  min-width: 0;
  flex-grow: 1;
}

.live-search-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-search-name mark {
  background: rgba(22, 163, 74, 0.4);
  color: #ffffff;
  border-radius: 3px;
  padding: 0 2px;
}

.live-search-meta {
  font-size: 0.8rem;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.live-search-meta .dot { margin: 0 4px; }

/* ---------- Loading / empty / error states ---------- */
.live-search-state {
  padding: 28px 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
}
.live-search-state i { font-size: 1.4rem; margin-bottom: 8px; display: block; }

.live-search-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #16a34a;
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: liveSearchSpin 0.7s linear infinite;
}
@keyframes liveSearchSpin {
  to { transform: rotate(360deg); }
}

/* ---------- Scrollbar (webkit) - subtle, matches dark theme ---------- */
.live-search-dropdown::-webkit-scrollbar { width: 6px; }
.live-search-dropdown::-webkit-scrollbar-track { background: transparent; }
.live-search-dropdown::-webkit-scrollbar-thumb { background: #2b3242; border-radius: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
  .live-search-dropdown { max-height: 360px; }
  .live-search-icon { width: 50px; height: 50px; }
  .live-search-name { font-size: 0.9rem; }
}
