/* =========================================================
   SpotiBai — Spotify Authentic Music Player & Lyrics CSS
   Exact Spotify player controls, scrubbers, queue, and lyrics
   ========================================================= */

/* Desktop Bottom Music Player */
.bottom-player {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: var(--player-height);
  background-color: #000000;
  border-top: 1px solid #282828;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 20px;
  z-index: 50;
  user-select: none;
}

/* Left Column: Track Info & Like */
.player-left {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 300px;
  min-width: 180px;
}

.player-artwork {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  background-color: #282828;
  flex-shrink: 0;
}

.player-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.player-song-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-song-title:hover {
  text-decoration: underline;
}

.player-song-artist {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-song-artist:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Heart Favorite Button */
.player-fav-btn {
  color: var(--text-secondary);
  padding: 6px;
  margin-left: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  transition: transform 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275), color 150ms ease;
}

.player-fav-btn svg {
  fill: transparent;
  stroke: currentColor;
  transition: fill 200ms ease, stroke 200ms ease, transform 200ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.player-fav-btn:hover {
  color: #ffffff;
  transform: scale(1.1);
}

.player-fav-btn.active {
  color: #e91429 !important;
}

.player-fav-btn.active svg,
.player-fav-btn.active svg path {
  fill: #e91429 !important;
  stroke: #e91429 !important;
  animation: heartPulse 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Center Column: Controls & Scrubber */
.player-center {
  flex: 1;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.player-btn {
  color: var(--text-secondary);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.player-btn:hover {
  color: #ffffff;
}

.player-btn.active {
  color: var(--spotify-green);
  position: relative;
}

.player-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--spotify-green);
}

/* Spotify Authentic Circular Play Button */
.player-btn-play {
  width: 34px;
  height: 34px;
  background-color: #ffffff;
  color: #000000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.player-btn-play:hover {
  transform: scale(1.08);
}

.player-btn-play:active {
  transform: scale(0.96);
}

/* Timeline Scrubber */
.player-timeline {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.progress-container {
  flex: 1;
  height: 12px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.progress-bar-bg {
  width: 100%;
  height: 4px;
  background-color: #4d4d4d;
  border-radius: var(--radius-full);
  position: relative;
  transition: height var(--transition-fast);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: #ffffff;
  border-radius: var(--radius-full);
  position: relative;
  transition: width 100ms linear;
}

.progress-handle {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.progress-container:hover .progress-bar-bg {
  height: 4px;
}

.progress-container:hover .progress-bar-fill {
  background-color: var(--spotify-green);
}

.progress-container:hover .progress-handle {
  opacity: 1;
}

/* Right Column: Volume, Queue, Lyrics */
.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: 300px;
  min-width: 160px;
}

.volume-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider-container {
  width: 96px;
  height: 12px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.volume-bar-bg {
  width: 100%;
  height: 4px;
  background-color: #4d4d4d;
  border-radius: var(--radius-full);
  position: relative;
}

.volume-bar-fill {
  height: 100%;
  width: 80%;
  background-color: #ffffff;
  border-radius: var(--radius-full);
  position: relative;
}

.volume-handle {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.volume-slider-container:hover .volume-bar-fill {
  background-color: var(--spotify-green);
}

.volume-slider-container:hover .volume-handle {
  opacity: 1;
}

/* Queue Drawer */
.queue-drawer {
  position: fixed;
  top: 8px;
  right: -380px;
  width: 360px;
  height: calc(100vh - var(--player-height) - 16px);
  background-color: var(--bg-base);
  border-radius: var(--radius-md);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  z-index: 60;
  display: flex;
  flex-direction: column;
  transition: right var(--transition-base);
  border: 1px solid var(--border-subtle);
}

.queue-drawer.open {
  right: 8px;
}

.queue-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.queue-clear-btn {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.queue-clear-btn:hover {
  color: #ffffff;
  text-decoration: underline;
}

.queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-xs);
  transition: background var(--transition-fast);
}

.queue-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.queue-item.active {
  background-color: rgba(255, 255, 255, 0.08);
}

.queue-item.active .queue-item-title {
  color: var(--spotify-green);
}

.queue-item-artwork {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  object-fit: cover;
}

.queue-item-meta {
  flex: 1;
  overflow: hidden;
  cursor: pointer;
}

.queue-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-artist {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-remove {
  color: var(--text-secondary);
  padding: 4px 8px;
  font-size: 1.1rem;
}

.queue-item-remove:hover {
  color: #ffffff;
}

/* =========================================================
   Spotify Dynamic Color Lyrics Overlay
   ========================================================= */
.lyrics-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #1b3a2a 0%, #0c1a13 50%, #000000 100%);
  z-index: 100;
  display: none;
  flex-direction: column;
}

.lyrics-overlay.open {
  display: flex;
}

.lyrics-topbar {
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lyrics-song-heading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lyrics-song-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.lyrics-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.lyrics-close-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.lyrics-body {
  flex: 1;
  overflow-y: auto;
  padding: 40px 24px 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-behavior: smooth;
}

.lyrics-container {
  max-width: 820px;
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lyric-line {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: rgba(255, 255, 255, 0.35);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  cursor: pointer;
  line-height: 1.35;
}

.lyric-line:hover {
  color: rgba(255, 255, 255, 0.7);
}

.lyric-line.active {
  color: #ffffff;
  transform: scale(1.02);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.lyric-line.past {
  color: rgba(255, 255, 255, 0.85);
}

.btn-jump-lyric {
  position: fixed;
  bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  padding: 10px 24px;
  border-radius: var(--radius-full);
  background-color: #ffffff;
  color: #000000;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  z-index: 105;
  display: none;
}

.btn-jump-lyric:hover {
  transform: scale(1.05);
}

/* =========================================================
   Spotify Authentic On-Page Real-Time Synchronized Lyrics Box
   ========================================================= */
.inline-lyrics-card {
  background: linear-gradient(145deg, #183827 0%, #0d1e15 60%, #08120c 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  margin-top: 10px;
}

.inline-lyrics-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.inline-lyrics-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-lyrics-sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--spotify-green);
  background: rgba(30, 215, 96, 0.15);
  border: 1px solid rgba(30, 215, 96, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.inline-lyrics-sync-indicator .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--spotify-green);
  box-shadow: 0 0 8px var(--spotify-green);
  animation: greenPulse 2s infinite;
}

.btn-fullscreen-lyrics {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-fullscreen-lyrics:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.04);
}

.inline-lyrics-scroll-box {
  height: 380px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 24px 24px 140px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.inline-lyrics-scroll-box::-webkit-scrollbar {
  width: 8px;
}

.inline-lyrics-scroll-box::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
}

.inline-lyrics-scroll-box::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.35);
}

.inline-lyric-line {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.5;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 200ms ease, transform 200ms ease, text-shadow 200ms ease;
  user-select: none;
}

.inline-lyric-line:hover {
  color: rgba(255, 255, 255, 0.75);
  background-color: rgba(255, 255, 255, 0.05);
}

.inline-lyric-line.past {
  color: rgba(255, 255, 255, 0.65);
}

.inline-lyric-line.active {
  color: #ffffff;
  transform: scale(1.025);
  transform-origin: left center;
  text-shadow: 0 0 28px rgba(255, 255, 255, 0.6);
}

.inline-lyrics-footer {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .inline-lyrics-scroll-box {
    height: 320px;
    padding: 16px 16px 120px;
  }
  .inline-lyric-line {
    font-size: 1.25rem;
    padding: 6px 8px;
  }
  .inline-lyrics-header {
    padding: 14px 16px;
  }
  .inline-lyrics-footer {
    padding: 10px 16px;
  }
}

/* =========================================================
   Mobile Fullscreen Now Playing Modal
   ========================================================= */
.mobile-now-playing-modal {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #333333 0%, #121212 50%, #000000 100%);
  z-index: 120;
  display: none;
  flex-direction: column;
  padding: calc(20px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-right, 0px)) calc(36px + env(safe-area-inset-bottom, 0px)) calc(24px + env(safe-area-inset-left, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.mobile-now-playing-modal.open {
  display: flex;
}

.mnp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

.mnp-close-btn {
  padding: 8px;
  color: #ffffff;
}

.mnp-header-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.mnp-artwork-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  margin-bottom: 32px;
}

.mnp-artwork {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mnp-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.mnp-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.mnp-artist {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.mnp-timeline {
  margin-bottom: 24px;
}

.mnp-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.mnp-play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mnp-lyrics-preview-box {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
}

.mnp-lyrics-preview-box:hover {
  background: rgba(255, 255, 255, 0.15);
}
