/* ── LANGUAGE BAR ─────────────────────────────────────── */

.language-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  height: var(--bar-height);
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  gap: 0.5rem;
  background: white;
  border-bottom: 1px solid var(--clr-bar-border);
  box-shadow:
    0 1px 0 0 #c1272d44,
    0 2px 0 0 #e8a02044,
    0 3px 0 0 #1b6b3044,
    0 6px 18px rgba(0, 0, 0, 0.45);
}

/* ── All bar buttons share these base styles ── */
.language-bar button {
  flex: 0 0 auto;
  height: 2.25rem;
  padding: 0 1rem;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: black;
  background: transparent;
  border: 1px solid rgba(232, 160, 32, 0.35);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.12s ease,
    box-shadow 0.2s ease;
}

/* ── Menu button ── */
#menuBtn {
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.1rem;
  border-radius: 0.45rem;
  padding: 0;
  margin-right: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Language container ── */
#middle {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding-left: 0.5rem;
  padding-right: clamp(7rem, 16vw, 14rem);
  scrollbar-width: none;
}

#middle::-webkit-scrollbar { display: none; }

/* ── Search area ── */
.last {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

/* ── Search box ── */
#searchInput {
  width: 10rem;
  height: 2.1rem;
  box-sizing: border-box;
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  color: black;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(232, 160, 32, 0.40);
  border-radius: var(--r-pill);
  padding: 0 2.4rem 0 0.85rem;
  outline: none;
  transition: width 0.35s ease, border-color 0.2s, box-shadow 0.2s;
}

#searchInput::placeholder {
  color: rgba(0, 0, 0, 0.45);
  font-size: 0.875rem;
}

#searchInput:focus {
  width: clamp(11rem, 20vw, 18rem);
  border-color: rgba(232, 160, 32, 0.75);
  box-shadow: 0 0 0 3px rgba(232, 160, 32, 0.20);
}

/* ── Close search button ── */
#closeSearch {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: black;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}

#closeSearch:hover {
  color: #0d0c0c;
  background: rgba(193, 39, 45, 0.45);
  border-color: rgba(193, 39, 45, 0.55);
  transform: translateY(-50%) rotate(90deg);
}

#closeSearch.hidden { display: none; }


/* ── Button states ── */
.language-bar button:hover {
  color: var(--clr-gold-light);
  background: var(--clr-gold-dim);
  border-color: rgba(32, 35, 232, 0.3);
  box-shadow: 0 0 12px rgba(232, 160, 32, 0.15);
}

.language-bar button:active {
  transform: scale(0.96);
  color: var(--clr-gold-light);
  background: rgba(32, 232, 92, 0.18);
  border-color: rgba(232, 160, 32, 0.45);
}

.language-bar button.active,
.language-bar button:focus-visible {
  color: var(--clr-active-text);
  background: var(--clr-gold);
  border-color: var(--clr-gold);
  box-shadow:
    0 0 0 3px rgba(232, 160, 32, 0.25),
    0 2px 8px rgba(232, 160, 32, 0.35);
  outline: none;
}


/* ═══════════════════════════════════════════════════════
   GENRE BAR  (#langPanel used as a second fixed bar)
═══════════════════════════════════════════════════════ */

#langPanel {
  position: fixed;
  top: var(--bar-height);       /* sits flush below the language bar */
  left: 0;
  right: 0;
  z-index: 880;
  height: var(--genre-bar-height, 2.75rem);
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: white;
  border-bottom: 1px solid var(--clr-bar-border);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  gap: 0.5rem;

  /* override any popup-panel positioning */
  transform: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

#langPanel::-webkit-scrollbar { display: none; }

#langPanel.hidden { display: none; }

/* hide the title — active language is already shown in the bar above */
#langPanelTitle { display: none; }

/* genre button list */
#genreList {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

#genreList button {
  flex: 0 0 auto;
  height: 2rem;
  padding: 0 0.9rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: black;
  background: transparent;
  border: 1px solid rgba(232, 160, 32, 0.35);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.12s ease,
    box-shadow 0.2s ease;
}

#genreList button:hover {
  color: var(--clr-gold-light);
  background: var(--clr-gold-dim);
  border-color: rgba(232, 160, 32, 0.30);
}

#genreList button:active {
  transform: scale(0.96);
}

#genreList button.active {
  color: var(--clr-active-text);
  background: var(--clr-gold);
  border-color: var(--clr-gold);
  box-shadow:
    0 0 0 3px rgba(232, 160, 32, 0.25),
    0 2px 8px rgba(232, 160, 32, 0.35);
}
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 850;   /* above hymns, below bars */
  background: transparent;
}

.search-overlay.hidden { display: none; }

/* ── MOBILE ───────────────────────────────────────────── */
@media (max-width: 600px) {

    .language-bar {
    padding: 0 0.5rem;
    gap: 0.3rem;
    height: 60px;
    overflow: hidden;
  }

  .language-bar button {
    font-size: 0.875rem;
    padding: 0 0.65rem;
    height: 2rem;
  }

  #middle {
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    padding-right: 90px;
  }

  #middle::-webkit-scrollbar { display: none; }

 

  .last { right: 0.5rem; }

  #searchInput {
    width: 25.5rem;
    font-size: 16px;
    color: rgb(23, 26, 23);
  }

  #searchInput:focus {
    outline: none;
    border: 1px solid green;
    background: #fff;
  }

  /* ── Genre bar mobile fix ── */
  #langPanel {
    top: 60px;           /* match the hardcoded mobile language bar height exactly */
    height: 3rem;        /* tall enough to be tappable and readable */
    padding: 0 0.75rem;
  }

  #genreList button {
    font-size: 0.875rem;
    padding: 0 0.85rem;
    height: 2.1rem;
  }

}
 /* search expands to cover language buttons when focused */
  .language-bar:has(#searchQuery:focus) #middle {
    opacity: 0;
    pointer-events: none;
  }

  .language-bar:has(#searchQuery:focus) .last {
    left: 3rem;        /* clears the menu button */
    right: 0.5rem;
  }

  .language-bar:has(#searchQuery:focus) .search-box {
    width: 100%;
  }

  .language-bar:has(#searchQuery:focus) #searchQuery {
    width: 100%;
  }

