/* lyrics-view.css — Lyrics overlay panel for The Listening Room.
 *
 * Slides up from the now-playing bar, blurs the background, scrolls
 * independently. Closeable via X button, click-outside, Escape key,
 * or "hide lyrics" voice command.
 *
 * Mobile: full-screen sheet style.
 * Desktop: centered card with max-width.
 */

#lyricsOverlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 6, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

#lyricsOverlay.open {
  opacity: 1;
  pointer-events: auto;
}

.lyrics-panel {
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 110px); /* leave room for now-playing bar */
  background: linear-gradient(180deg, rgba(28, 22, 18, 0.98), rgba(20, 14, 10, 0.98));
  border-top: 1px solid rgba(255, 158, 66, 0.35);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  transform: translateY(40px);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  margin-bottom: 100px; /* clear the now-playing bar */
}

#lyricsOverlay.open .lyrics-panel {
  transform: translateY(0);
}

.lyrics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
  border-bottom: 1px solid rgba(255, 158, 66, 0.15);
  flex-shrink: 0;
}

.lyrics-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #FFD365;
  font-family: 'TAN-NIMBUS', -apple-system, BlinkMacSystemFont, sans-serif;
  text-shadow: 0 0 12px rgba(255, 158, 66, 0.35);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lyrics-close {
  background: rgba(255, 158, 66, 0.12);
  border: 1px solid rgba(255, 158, 66, 0.3);
  color: #FFD365;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  margin-left: 12px;
}
.lyrics-close:hover {
  background: rgba(255, 158, 66, 0.25);
  transform: scale(1.05);
}

.lyrics-body {
  padding: 18px 26px 28px;
  overflow-y: auto;
  flex: 1;
  color: rgba(255, 255, 255, 0.92);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  -webkit-overflow-scrolling: touch;
}

.lyrics-stanza {
  margin: 0 0 1.4em 0;
}
.lyrics-stanza:last-child {
  margin-bottom: 0;
}

.lyrics-body strong {
  display: block;
  margin-top: 0.4em;
  margin-bottom: 0.2em;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #FF9E42;
  font-weight: 700;
  opacity: 0.85;
}

.lyrics-body em {
  color: rgba(255, 211, 101, 0.75);
  font-style: italic;
  font-size: 14px;
}

.lyrics-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.55);
}
.lyrics-empty small {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.7;
}

/* Lyrics toggle button in the now-playing bar */
.lyrics-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lyrics-btn:hover {
  color: #FFD365;
  background: rgba(255, 158, 66, 0.12);
}
.lyrics-btn.active {
  color: #FFD365;
  background: rgba(255, 158, 66, 0.2);
  text-shadow: 0 0 8px rgba(255, 158, 66, 0.5);
}

/* Mobile tweaks */
@media (max-width: 768px) {
  /* The whole .track-info-section is hidden on mobile, which would also
     hide our in-bar lyrics button. Pull it out and float it bottom-left
     above the now-playing bar so it's still reachable. */
  .lyrics-btn {
    position: fixed !important;
    bottom: max(96px, calc(96px + env(safe-area-inset-bottom, 0px)));
    left: 16px;
    z-index: 10001;
    width: 48px;
    height: 48px;
    background: rgba(20, 14, 10, 0.85);
    border: 1px solid rgba(255, 158, 66, 0.35);
    color: #FFD365;
    font-size: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .lyrics-btn.active {
    background: rgba(255, 158, 66, 0.92);
    color: #1a1a1a;
    border-color: #FFD365;
  }

  .lyrics-panel {
    max-width: 100%;
    margin-bottom: 88px;
    max-height: calc(100vh - 96px);
    border-radius: 18px 18px 0 0;
  }
  .lyrics-header {
    padding: 14px 18px 10px;
  }
  .lyrics-title {
    font-size: 17px;
  }
  .lyrics-body {
    font-size: 15px;
    padding: 14px 20px 22px;
    line-height: 1.6;
  }
}

/* Lock background scroll while open */
body.lyrics-open {
  overflow: hidden;
}
