/* =========================================================================
 * Super Live Music Lyrics — site-wide type-ahead search overlay
 * Uses niyal-modern-ui premium tokens (--nmui-*) with safe fallbacks.
 * ========================================================================= */

html.niyal-search-lock { overflow: hidden; }

.niyal-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483400;                 /* above the bottom nav + floating player */
  display: none;
  padding: 0 16px;
  background: rgba(6, 8, 14, .55);
  backdrop-filter: blur(6px) saturate(140%);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
}
.niyal-search-overlay.is-open { display: block; }

.niyal-search-panel {
  width: 100%;
  max-width: 640px;
  margin: max(48px, 8vh) auto 0;
  background: var(--nmui-surface, #fff);
  color: var(--nmui-text, #1a1c22);
  border-radius: var(--nmui-r-lg, 20px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
  overflow: hidden;
  animation: niyal-sr-in .18s ease;
}
@keyframes niyal-sr-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.niyal-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--nmui-border, rgba(0, 0, 0, .08));
}
.niyal-search-bar > .fa { font-size: 17px; opacity: .55; }
.niyal-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 17px;
  color: inherit;
  padding: 6px 2px;
}
.niyal-search-input::placeholder { color: var(--nmui-text-dim, #8a9099); }
.niyal-search-close {
  border: none;
  background: var(--nmui-elev, rgba(0, 0, 0, .06));
  color: inherit;
  width: 32px; height: 32px;
  border-radius: 999px;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  opacity: .8;
}
.niyal-search-close:hover { opacity: 1; color: var(--nmui-accent, #e4422e); }

.niyal-search-body { position: relative; }
.niyal-search-results {
  max-height: min(60vh, 460px);
  overflow-y: auto;
  padding: 6px;
}
.niyal-search-body.is-loading::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--nmui-accent, #e4422e), transparent);
  animation: niyal-sr-load 1s linear infinite;
}
@keyframes niyal-sr-load { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.niyal-sr-group { padding: 4px 0 8px; }
.niyal-sr-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--nmui-text-dim, #8a9099);
  padding: 8px 12px 4px;
}
.niyal-sr-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--nmui-r-md, 12px);
  text-decoration: none;
  color: inherit;
}
.niyal-sr-item.is-active,
.niyal-sr-item:hover { background: var(--nmui-elev, rgba(0, 0, 0, .05)); }
.niyal-sr-thumb {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 10px;
  background: #d9dce2 center/cover no-repeat;
}
.niyal-sr-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--nmui-accent, #e4422e), #b52d5e);
}
.niyal-sr-meta { display: flex; flex-direction: column; min-width: 0; }
.niyal-sr-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.niyal-sr-sub { font-size: 12px; color: var(--nmui-text-dim, #8a9099); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.niyal-sr-empty { padding: 26px 16px; text-align: center; color: var(--nmui-text-dim, #8a9099); font-size: 14px; }

.niyal-search-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--nmui-border, rgba(0, 0, 0, .08));
  background: var(--nmui-bg, #fafafa);
}
.niyal-search-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nmui-accent, #e4422e);
  text-decoration: none;
}
.niyal-search-all::before { content: "\f002"; font-family: FontAwesome; opacity: .8; }

@media (max-width: 600px) {
  .niyal-search-overlay { padding: 0; }
  .niyal-search-panel { margin-top: 0; border-radius: 0; min-height: 100%; max-width: none; }
  .niyal-search-results { max-height: calc(100vh - 132px); }
}