/* ==========================================================================
   Akadverse Pro — Music Player Widget
   ========================================================================== */

/* ── Entrance slide-in from corner ─────────────────────── */
@keyframes akvMusicSlideBottomRight {
  from {
    opacity: 0;
    transform: translate(30px, 60px) scale(0.88);
  }

  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes akvMusicSlideBottomLeft {
  from {
    opacity: 0;
    transform: translate(-30px, 60px) scale(0.88);
  }

  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes akvMusicSlideTopRight {
  from {
    opacity: 0;
    transform: translate(30px, -60px) scale(0.88);
  }

  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes akvMusicSlideTopLeft {
  from {
    opacity: 0;
    transform: translate(-30px, -60px) scale(0.88);
  }

  to {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

/* ── Base Player ─────────────────────────────────────────── */
.akv-music-player {
  font-family: inherit;
  box-sizing: border-box;
  background: rgba(28, 12, 38, 0.95);
  color: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  width: 230px;
  user-select: none;
  -webkit-user-select: none;
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-radius 0.35s ease,
    opacity 0.3s ease,
    box-shadow 0.25s ease;
  will-change: transform;
}

/* Glassmorphism */
.akv-music-player.akv-player-glass {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px) saturate(200%);
  -webkit-backdrop-filter: blur(22px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Floating mode */
.akv-music-player.akv-player-floating {
  position: fixed;
  z-index: 9990;
  overflow: visible;
}

/* Position + entrance animation */
.akv-float-bottom-right {
  bottom: 16px;
  right: 16px;
  animation: akvMusicSlideBottomRight 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s both;
}

.akv-float-bottom-left {
  bottom: 16px;
  left: 16px;
  animation: akvMusicSlideBottomLeft 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s both;
}

.akv-float-top-right {
  top: 16px;
  right: 16px;
  animation: akvMusicSlideTopRight 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s both;
}

.akv-float-top-left {
  top: 16px;
  left: 16px;
  animation: akvMusicSlideTopLeft 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s both;
}

/* Inline mode */
.akv-music-player.akv-player-inline {
  position: relative;
  width: 100%;
  max-width: 100%;
}

/* ── Art wrap (ring container) ──────────────────────────── */
.akv-art-wrap {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  /* extra space for ring */
}

/* ── Rotating ring ───────────────────────────────────────── */
@keyframes akvRingRotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.akv-art-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.88);
  border-right-color: rgba(255, 255, 255, 0.32);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  border-left-color: rgba(255, 255, 255, 0.32);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.akv-is-playing .akv-art-ring {
  opacity: 1;
  animation: akvRingRotate 1.6s linear infinite;
}

/* ── Album art play/pause overlay icon ───────────────────── */
.akv-art-overlay {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  z-index: 2;
}

/* Full / bar: show overlay on hover only */
.akv-music-art:hover+.akv-art-overlay,
.akv-art-overlay:hover {
  opacity: 1;
}

.akv-art-icon-play,
.akv-art-icon-pause {
  color: #fff;
  display: block;
}

/* Saat stop: tampil ikon play */
.akv-art-icon-pause {
  display: none;
}

/* Saat playing: tampil ikon pause */
.akv-is-playing .akv-art-icon-play {
  display: none;
}

.akv-is-playing .akv-art-icon-pause {
  display: block;
}

/* ── Full player top ─────────────────────────────────────── */
.akv-player-full .akv-player-top {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

/* ── Album Art ───────────────────────────────────────────── */
.akv-music-art {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.akv-music-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.akv-art-note {
  color: rgba(255, 255, 255, 0.65);
}

/* ── Album art vinyl spin animation ─────────────────────── */
@keyframes akvArtSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.akv-music-art.akv-art-spinning {
  animation: akvArtSpin 8s linear infinite;
  transform-origin: center center;
}

/* Klik album art → scale sentuhan (tidak override spinning) */
.akv-music-art:active {
  transform: scale(0.92);
}

.akv-art-overlay:active {
  transform: scale(0.92);
}

/* Mini & Bar: adjust art sizes */
.akv-player-mini .akv-art-wrap {
  padding: 3px;
}

.akv-player-mini .akv-music-art {
  width: 34px;
  height: 34px;
}

.akv-player-mini .akv-art-overlay {
  inset: 3px;
}

.akv-player-mini .akv-art-ring {
  border-width: 2px;
}

/* Hide separate play button in mini — art overlay handles play/pause */
.akv-player-mini .akv-music-play-btn {
  display: none !important;
}

/* ── Song Info ───────────────────────────────────────────── */
.akv-music-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.akv-music-title {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  margin-bottom: 1px;
}

.akv-music-artist {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Click zoom (play btn) ───────────────────────────────── */
@keyframes akvClickZoom {
  0% {
    transform: scale(1);
  }

  38% {
    transform: scale(1.16);
  }

  68% {
    transform: scale(0.96);
  }

  100% {
    transform: scale(1);
  }
}

/* ── Mute button ─────────────────────────────────────────── */
.akv-music-mute-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.6);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.akv-music-mute-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* ── Progress bar ────────────────────────────────────────── */
.akv-music-progress-wrap {
  margin-bottom: 8px;
  cursor: pointer;
  outline: none;
}

.akv-music-progress-track {
  position: relative;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: visible;
}

.akv-music-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: #c0608a;
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s linear;
}

.akv-music-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%) scale(0);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c0608a;
  box-shadow: 0 0 4px rgba(192, 96, 138, 0.7);
  transition: transform 0.15s ease, left 0.1s linear;
}

.akv-music-progress-wrap:hover .akv-music-progress-thumb {
  transform: translate(-50%, -50%) scale(1);
}

/* ── Times ───────────────────────────────────────────────── */
.akv-music-times {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
}

.akv-music-time {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.45);
  font-variant-numeric: tabular-nums;
}

/* ── Controls row ────────────────────────────────────────── */
.akv-player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Play/Pause button ───────────────────────────────────── */
.akv-music-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #c0608a;
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(192, 96, 138, 0.45);
}

.akv-music-play-btn:hover {
  box-shadow: 0 5px 18px rgba(192, 96, 138, 0.55);
}

.akv-music-play-btn:active {
  animation: akvClickZoom 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Volume ──────────────────────────────────────────────── */
.akv-volume-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  color: rgba(255, 255, 255, 0.45);
}

.akv-music-volume-track {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.akv-music-volume-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: #c0608a;
  border-radius: 4px;
  width: 70%;
  pointer-events: none;
}

/* ── Mini player ─────────────────────────────────────────── */
.akv-player-mini {
  width: auto;
  padding: 8px 12px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
}

.akv-mini-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.akv-player-mini .akv-music-art {
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.akv-player-mini .akv-music-play-btn {
  width: 30px;
  height: 30px;
}

/* ── Bar player ──────────────────────────────────────────── */
.akv-player-bar {
  width: 100%;
  padding: 8px 14px;
  border-radius: 50px;
}

.akv-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.akv-player-bar .akv-music-play-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.akv-player-bar .akv-progress-bar {
  flex: 1;
  margin-bottom: 0;
}

.akv-player-bar .akv-music-progress-track {
  height: 3px;
}

.akv-player-bar .akv-music-times {
  display: none;
}

.akv-player-bar .akv-music-mute-btn {
  flex-shrink: 0;
}

.akv-info-bar {
  flex-shrink: 0;
  min-width: 70px;
  max-width: 110px;
}

.akv-info-bar .akv-music-title {
  font-size: 0.72rem;
}

.akv-info-bar .akv-music-artist {
  font-size: 0.62rem;
}

/* ── Equalizer animation ─────────────────────────────────── */
.akv-equalizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  margin-top: 3px;
}

.akv-eq-bar {
  width: 2px;
  height: 3px;
  border-radius: 2px;
  background: #c0608a;
}

@keyframes akvEqBar1 {

  0%,
  100% {
    height: 3px
  }

  50% {
    height: 12px
  }
}

@keyframes akvEqBar2 {

  0%,
  100% {
    height: 6px
  }

  50% {
    height: 3px
  }
}

@keyframes akvEqBar3 {

  0%,
  100% {
    height: 10px
  }

  50% {
    height: 3px
  }
}

@keyframes akvEqBar4 {

  0%,
  100% {
    height: 3px
  }

  50% {
    height: 9px
  }
}

@keyframes akvEqBar5 {

  0%,
  100% {
    height: 5px
  }

  50% {
    height: 12px
  }
}

.akv-eq-playing .akv-eq-bar:nth-child(1) {
  animation: akvEqBar1 0.70s ease-in-out infinite;
}

.akv-eq-playing .akv-eq-bar:nth-child(2) {
  animation: akvEqBar2 0.50s ease-in-out infinite 0.10s;
}

.akv-eq-playing .akv-eq-bar:nth-child(3) {
  animation: akvEqBar3 0.60s ease-in-out infinite 0.20s;
}

.akv-eq-playing .akv-eq-bar:nth-child(4) {
  animation: akvEqBar4 0.80s ease-in-out infinite 0.05s;
}

.akv-eq-playing .akv-eq-bar:nth-child(5) {
  animation: akvEqBar5 0.55s ease-in-out infinite 0.15s;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .akv-music-player:not(.akv-player-mini):not(.akv-player-bar) {
    width: min(230px, calc(100vw - 28px));
  }
}