/* ════════════════════════════════════════
   OJ — Featured Songs Player Dock
   ════════════════════════════════════════ */

#player-dock {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 250;
  font-family: var(--font-body);
  width: 360px;
  max-width: calc(100vw - 3rem);
  transition: transform 0.5s cubic-bezier(.2,.9,.25,1);
}

#player-yt-target {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ── Collapsed core bar ── */
.player-core {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 0.7rem;
  background: linear-gradient(135deg, rgba(10, 10, 15, 0.96) 0%, rgba(18, 18, 26, 0.96) 100%);
  border: 1px solid var(--gold);
  border-radius: 56px;
  backdrop-filter: blur(14px);
  box-shadow:
    0 15px 50px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(212, 165, 116, 0.12),
    inset 0 1px 0 rgba(212, 165, 116, 0.15);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.4s cubic-bezier(.2,.9,.25,1);
  text-align: left;
}

.player-core:hover {
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(212, 165, 116, 0.25);
  transform: translateY(-2px);
}

.player-orb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright) 0%, var(--gold) 55%, #8a6a3f 100%);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(212, 165, 116, 0.5), inset 0 0 10px rgba(255, 230, 180, 0.2);
  transition: all 0.4s;
}

.player-core:hover .player-orb {
  box-shadow: 0 0 28px rgba(212, 165, 116, 0.8), inset 0 0 12px rgba(255, 230, 180, 0.35);
}

.player-play-icon,
.player-pause-icon {
  color: #0A0A0F;
  font-size: 0.85rem;
  line-height: 1;
  transition: opacity 0.3s;
  position: absolute;
}

.player-play-icon { padding-left: 2px; }

#player-dock .player-pause-icon {
  display: flex;
  gap: 3px;
  opacity: 0;
}

#player-dock .player-pause-icon span {
  display: block;
  width: 3px;
  height: 13px;
  background: #0A0A0F;
  border-radius: 1px;
}

#player-dock.playing .player-play-icon { opacity: 0; }
#player-dock.playing .player-pause-icon { opacity: 1; }

/* Pulse when playing */
#player-dock.playing .player-orb::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  animation: orbPulse 1.6s ease-out infinite;
  pointer-events: none;
}

@keyframes orbPulse {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

.player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-expand {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 0.9rem;
  opacity: 0.6;
  transition: all 0.4s;
}

.player-core:hover .player-expand {
  opacity: 1;
  transform: rotate(45deg);
}

#player-dock.expanded .player-expand {
  transform: rotate(45deg);
  opacity: 1;
}

/* ── Progress bar ── */
.player-progress {
  position: relative;
  height: 3px;
  margin-top: 0.5rem;
  background: rgba(212, 165, 116, 0.15);
  border-radius: 2px;
  cursor: pointer;
  overflow: hidden;
}

.player-progress-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 100%);
  box-shadow: 0 0 10px var(--gold);
  transition: width 0.4s linear;
}

/* ── Expanded panel ── */
.player-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.55s cubic-bezier(.2,.9,.25,1), opacity 0.4s;
}

#player-dock.expanded .player-panel {
  max-height: 500px;
  opacity: 1;
  margin-top: 0.5rem;
}

.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0;
  margin-top: 0.5rem;
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.pc-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.3s;
}

.pc-btn:hover {
  color: var(--gold);
  border-color: var(--line-strong);
  background: rgba(212, 165, 116, 0.06);
}

.pc-play {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  color: var(--gold);
}

.pc-play-icon,
.pc-pause-icon {
  position: absolute;
  transition: opacity 0.3s;
}

.pc-play { position: relative; }

.pc-play .pc-play-icon { opacity: 1; }
.pc-play .pc-pause-icon { opacity: 0; }

#player-dock.playing .pc-play .pc-play-icon { opacity: 0; }
#player-dock.playing .pc-play .pc-pause-icon { opacity: 1; }

/* ── Queue ── */
.player-queue {
  margin-top: 0.7rem;
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.7rem;
}

.player-queue-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed rgba(212, 165, 116, 0.15);
}

.player-queue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
}

.player-queue-list::-webkit-scrollbar { width: 6px; }
.player-queue-list::-webkit-scrollbar-thumb {
  background: rgba(212, 165, 116, 0.3);
  border-radius: 3px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.5rem;
  cursor: pointer;
  transition: all 0.25s;
  border-radius: 2px;
  position: relative;
}

.queue-item:hover {
  background: rgba(212, 165, 116, 0.06);
}

.queue-item.active {
  background: rgba(212, 165, 116, 0.1);
  border-left: 2px solid var(--gold);
  padding-left: 0.35rem;
}

.queue-idx {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  width: 26px;
  flex-shrink: 0;
}

.queue-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.queue-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-sub {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-pin {
  color: var(--gold);
  font-size: 0.7rem;
  text-shadow: 0 0 8px var(--gold);
}

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

/* ── Responsive: solid background on mobile (no transparency mess) ── */
@media (max-width: 768px) {
  #player-dock {
    right: 0.6rem;
    bottom: 0.6rem;
    left: 0.6rem;
    width: auto;
    margin: 0 auto;
  }

  .player-core {
    padding: 0.6rem 0.9rem 0.6rem 0.6rem;
    justify-content: center;
    /* Kill transparency — solid dark background */
    background: #0A0A0F;
    border-color: rgba(212, 165, 116, 0.35);
    backdrop-filter: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.8);
  }

  .player-controls {
    background: #0D0D14;
    backdrop-filter: none;
  }

  .player-queue {
    background: #0D0D14;
    backdrop-filter: none;
  }

  #player-dock.expanded .player-panel {
    background: #0A0A0F;
    border-top: 1px solid var(--line);
  }

  .player-title { font-size: 0.9rem; }
  .player-sub { font-size: 0.58rem; letter-spacing: 0.18em; }

  .queue-item {
    background: transparent;
  }

  .queue-item.active {
    background: rgba(212, 165, 116, 0.08);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #player-dock.playing .player-orb::after { animation: none; }
}
