/* ==========================================================================
   lyrics.css - YouTube Music & Spotify Style Synchronized Karaoke Lyrics
   ========================================================================== */

.lyrics-container {
  display: flex;
  flex-direction: column;
  height: 640px;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 992px) {
  .lyrics-container {
    height: 460px;
  }
}

@media (max-width: 480px) {
  .lyrics-container {
    height: 440px;
  }
  body[data-view="lyrics"] .lyrics-container {
    height: calc(100vh - 290px);
    min-height: 440px;
  }
}

/* Lyrics Header */
.lyrics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.lyrics-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.3);
  color: var(--accent-cyan);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulseDot 1.5s infinite alternate;
}

@keyframes pulseDot {
  0% { transform: scale(0.85); opacity: 0.5; }
  100% { transform: scale(1.25); opacity: 1; }
}

.btn-sync-lock {
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-sync-lock:hover {
  background: var(--bg-glass-hover);
  color: #fff;
  border-color: var(--accent-pink);
}

.btn-sync-lock.active {
  background: rgba(255, 94, 142, 0.2);
  border-color: var(--accent-pink);
  color: #fff;
}

/* Lyrics Scroll Area */
.lyrics-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding: 2.5rem 0.5rem 3.5rem;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
}

/* Custom Scrollbar */
.lyrics-viewport::-webkit-scrollbar {
  width: 5px;
}

.lyrics-viewport::-webkit-scrollbar-track {
  background: transparent;
}

.lyrics-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.lyrics-viewport::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Individual Lyric Lines */
.lyric-line {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  border-radius: 14px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  line-height: 1.45;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.lyric-line .lyric-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}

.lyric-line .lyric-time {
  font-size: 0.76rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-variant-numeric: tabular-nums;
  margin-left: 0.75rem;
  flex-shrink: 0;
}

.lyric-line:hover .lyric-time {
  opacity: 0.8;
  transform: translateX(0);
}

.lyric-line:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.04);
}

/* Active Line (YouTube Music Spotlight) */
.lyric-line.active {
  color: #ffffff;
  font-size: 1.55rem;
  font-weight: 800;
  padding: 1rem 1.15rem;
  background: linear-gradient(90deg, rgba(255, 94, 142, 0.18) 0%, rgba(255, 190, 11, 0.08) 100%);
  border-left: 4px solid var(--accent-gold);
  border-radius: 4px 18px 18px 4px;
  box-shadow: 0 4px 20px rgba(255, 94, 142, 0.15);
  text-shadow: 0 0 25px rgba(255, 190, 11, 0.45);
}

.lyric-line.active .lyric-text {
  background: linear-gradient(100deg, #ffffff 40%, var(--accent-gold-light) 80%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lyric-line.active .lyric-time {
  opacity: 1;
  color: var(--accent-gold);
  font-weight: 700;
}

/* Passed Lines */
.lyric-line.passed {
  color: rgba(255, 255, 255, 0.48);
}

/* Instrumental Solos / Interludes */
.lyric-line.instrumental {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--accent-rose);
  opacity: 0.85;
}

.lyric-line.instrumental.active {
  font-size: 1.25rem;
  color: var(--accent-gold);
  background: rgba(155, 93, 229, 0.15);
  border-left-color: var(--accent-purple);
}

/* Jump to Active Button (Floats when user scrolled away) */
.btn-jump-active {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  opacity: 0;
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-gold));
  color: #12091c;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-jump-active.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.btn-jump-active:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 94, 142, 0.5);
}

/* Mobile Responsiveness for Lyric Lines */
@media (max-width: 480px) {
  .lyrics-viewport {
    padding: 1.5rem 0.35rem 2.5rem;
  }

  .lyric-line {
    font-size: 1.05rem;
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.4rem;
  }

  .lyric-line.active {
    font-size: 1.26rem;
    padding: 0.85rem 1rem;
    border-left-width: 3px;
  }

  .lyric-line.instrumental {
    font-size: 0.95rem;
  }

  .lyric-line.instrumental.active {
    font-size: 1.15rem;
  }

  .sync-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
  }

  .btn-sync-lock {
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
  }
}

