/* ============================================
   MUSIC PLAYER — Minimalist Pill (v0.5)
   Dark-mode · glass · canvas glow · hover-expand
   ============================================ */

.music-player {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 6px;
  border-radius: 999px;
  background: rgba(8, 10, 8, 0.55);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 0 0 1px rgba(57, 255, 20, 0.0),
    0 12px 40px -8px rgba(0, 0, 0, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.4);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  letter-spacing: 0.5px;
  isolation: isolate;
  overflow: hidden;
  transition:
    box-shadow 420ms cubic-bezier(.2,.8,.2,1),
    border-color 420ms cubic-bezier(.2,.8,.2,1),
    background 420ms cubic-bezier(.2,.8,.2,1),
    transform 320ms cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}

.music-player:hover,
.music-player.is-playing {
  border-color: rgba(57, 255, 20, 0.25);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 0 0 1px rgba(57, 255, 20, 0.08),
    0 18px 56px -8px rgba(0, 0, 0, 0.7),
    0 0 36px rgba(57, 255, 20, 0.18);
}

/* === Canvas glow layer, sitzt hinter Content === */
.player-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.9;
}

/* === Play-Button (Primary) === */
.player-play {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #000;
  flex-shrink: 0;
  cursor: pointer;
  transition:
    transform 260ms cubic-bezier(.2,.8,.2,1),
    box-shadow 260ms cubic-bezier(.2,.8,.2,1),
    background 260ms ease;
  box-shadow:
    0 0 0 0 rgba(57, 255, 20, 0.45),
    0 0 14px rgba(57, 255, 20, 0.5),
    inset 0 -2px 6px rgba(0, 0, 0, 0.25);
}
.player-play:hover {
  box-shadow:
    0 0 0 4px rgba(57, 255, 20, 0.15),
    0 0 24px rgba(57, 255, 20, 0.75),
    inset 0 -2px 6px rgba(0, 0, 0, 0.25);
}
.player-play:active { transform: scale(0.94); }
.player-play[disabled] {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  box-shadow: none;
  cursor: not-allowed;
}
.player-play-icon svg { display: block; }
.player-play-icon .icon-pause { display: none; }
.music-player.is-playing .player-play-icon .icon-play  { display: none; }
.music-player.is-playing .player-play-icon .icon-pause { display: block; }

/* === Body (Title + Bar) === */
.player-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  max-width: 220px;
}
.player-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
}
.player-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
  color: rgba(234, 255, 224, 0.9);
}
.music-player.is-playing .player-title { color: #fff; }

/* Mini-EQ rechts neben Titel */
.player-eq {
  display: inline-flex;
  align-items: end;
  gap: 2px;
  height: 10px;
  opacity: 0;
  transition: opacity 240ms ease;
}
.music-player.is-playing .player-eq { opacity: 1; }
.player-eq i {
  display: block;
  width: 2px;
  height: 4px;
  background: var(--green);
  border-radius: 1px;
  box-shadow: 0 0 4px var(--green);
  animation: eq-bounce 900ms ease-in-out infinite;
  transform-origin: bottom;
}
.player-eq i:nth-child(2) { animation-delay: 120ms; }
.player-eq i:nth-child(3) { animation-delay: 240ms; }
@keyframes eq-bounce {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1.6); }
}

.player-bar {
  position: relative;
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1px;
  overflow: hidden;
}
.player-bar > span {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--green-soft), var(--green));
  transform-origin: left;
  transform: scaleX(0);
  box-shadow: 0 0 6px var(--green);
  transition: transform 200ms linear;
}

/* === Actions: prev/next + volume === */
.player-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 6px;
  margin-left: 2px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}
.player-actions button {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: rgba(234, 255, 224, 0.55);
  cursor: pointer;
  transition:
    color 200ms ease,
    background 200ms ease,
    transform 200ms cubic-bezier(.2,.8,.2,1);
}
.player-actions button:hover {
  color: var(--green);
  background: rgba(57, 255, 20, 0.08);
  transform: scale(1.08);
}
.player-actions button:active { transform: scale(0.92); }
.player-actions button[disabled] { opacity: 0.25; cursor: not-allowed; pointer-events: none; }

/* === Volume Hover-Expand === */
.player-volume {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 999px;
  position: relative;
}
.player-vol-icon {
  color: rgba(234, 255, 224, 0.55);
  border: 0;
  background: transparent;
  cursor: pointer;
  transition:
    color 240ms ease,
    transform 360ms cubic-bezier(.2,.8,.2,1);
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-volume:hover .player-vol-icon,
.player-volume:focus-within .player-vol-icon {
  color: var(--green);
  transform: rotate(90deg);
}

.player-vol {
  width: 0;
  opacity: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  transition:
    width 420ms cubic-bezier(.2,.8,.2,1),
    opacity 240ms ease 80ms,
    margin 420ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
  height: 22px;
  margin: 0;
}
.player-volume:hover .player-vol,
.player-volume:focus-within .player-vol {
  width: 58px;
  opacity: 1;
  pointer-events: auto;
  margin-right: 4px;
}
.player-vol::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--green) 0%, rgba(57,255,20,0.2) 100%);
}
.player-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  background: #fff;
  border-radius: 50%;
  margin-top: -4px;
  box-shadow: 0 0 6px rgba(57, 255, 20, 0.8);
  cursor: pointer;
}
.player-vol::-moz-range-track {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--green) 0%, rgba(57,255,20,0.2) 100%);
}
.player-vol::-moz-range-thumb {
  width: 10px; height: 10px; border: 0;
  background: #fff; border-radius: 50%;
  box-shadow: 0 0 6px rgba(57, 255, 20, 0.8);
}

/* === SFX-Toggle (older module attaches one — keep compatible) === */
.sfx-toggle {
  color: rgba(234, 255, 224, 0.55);
  font-size: 12px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  transition: color 200ms ease, transform 200ms cubic-bezier(.2,.8,.2,1);
  border-radius: 50%;
}
.sfx-toggle:hover { color: var(--green); transform: scale(1.08); }

@media (max-width: 720px) {
  .music-player {
    bottom: 10px;
    right: 10px;
    gap: 6px;
    padding: 4px 6px 4px 4px;
  }
  .player-body { min-width: 84px; max-width: 120px; }
  .player-volume, .player-eq { display: none; }
  .player-actions { padding-left: 4px; }
  .player-play { width: 30px; height: 30px; }
}
