/* Fixed Bottom Player */
.music-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(31, 126, 205, 0.15) 0%, rgba(31, 126, 205, 0.05) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  /* box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15); */
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.music-player.active {
  transform: translateY(0);
}

.player-container {
  max-width: 850px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: center;
}

/* Track Info */
.player-track-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 200px;
  max-width: 280px;
  width: 200px;
}

.player-cover {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: #2a2a2a;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-cover-placeholder {
  color: #555;
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-title {
  font-size: 1.4rem;
  font-weight: 500;
  /* color: #fff; */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-style {
  font-size: 1.2rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Controls */
.player-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-btn {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.player-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.player-btn.active {
  color: var(--fb-primary-color);
}

.player-play {
  width: 48px;
  height: 48px;
  background: var(--fb-primary-color);
  color: #fff;
}

.player-play:hover {
  background: var(--fb-primary-color-light);
  color: #fff;
  transform: scale(1.05);
}

.player-play .icon-play {
  display: block;
}

.player-play .icon-pause {
  display: none;
}

.music-player.playing .player-play .icon-play {
  display: none;
}

.music-player.playing .player-play .icon-pause {
  display: block;
}

/* Progress Bar */
.player-progress {
  flex: 1;
  min-width: 100px;
  max-width: 600px;
}

.progress-bar {
  position: relative;
  height: 6px;
  background: rgb(121 121 121 / 10%);
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--fb-primary-color);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  left: 0%;
  opacity: 0;
  transition: opacity 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

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

.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  color: #666;
}

/* Extra Controls */
.player-extra {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Volume */
.player-volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-mute .icon-unmute {
  display: block;
}

.player-mute .icon-mute {
  display: none;
}

.player-mute.muted .icon-unmute {
  display: none;
}

.player-mute.muted .icon-mute {
  display: block;
}

.volume-slider-wrap {
  width: 80px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgb(121 121 121 / 30%);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  background: rgb(146 146 146 / 81%);
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Close */
.player-close {
  margin-left: 0.25rem;
}

/* Responsive */
@media only screen and (max-width: 900px) {
  .player-container {
    gap: 1rem;
    padding: 0.75rem 1rem;
  }

  .player-track-info {
    min-width: 150px;
    max-width: 180px;
  }

  .player-cover {
    width: 48px;
    height: 48px;
  }

  .player-progress {
    display: none;
  }

  .volume-slider-wrap {
    display: none;
  }
}

@media only screen and (max-width: 600px) {
  .player-container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .player-track-info {
    order: 1;
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .player-controls {
    order: 2;
  }

  .player-extra {
    order: 3;
  }

  .player-prev,
  .player-next {
    display: none;
  }

  .player-cover {
    width: 44px;
    height: 44px;
  }

  .player-title {
    font-size: 1.3rem;
  }

  .player-style {
    font-size: 1.1rem;
  }
}

/* Share Menu Popup */
.uimodal .track-menu-title {
  text-align: center;
  font-weight: bold;
  margin-bottom: 10px;
}

.uimodal .track-menu-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 30px;
  margin-bottom: 10px;
}

.uimodal .track-menu-cover img {
  width: 280px;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1/1;
  border-radius: 10px;
}

.uimodal .track-menu-share {
  /* padding: 0.75rem 0; */
  /* border-top: 1px solid var(--fb-background-color-high, #eee); */
  text-align: center;
}

.uimodal .track-menu-share .a2a_kit {
  display: flex;
  justify-content: center;
}

/* Track Preview Popup */
.uimodal .track-preview-modal {
  max-width: 420px;
}

.uimodal .track-preview-modal > .content {
  padding: 2rem!important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.uimodal .track-preview-modal > .title {
  display: none;
}

.track-preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.track-preview-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--fb-background-color-invert-10, #e0e0e0);
  border-top-color: var(--fb-primary-color, #1f7ecd);
  border-radius: 50%;
  animation: track-preview-spin 0.7s linear infinite;
}

@keyframes track-preview-spin {
  to { transform: rotate(360deg); }
}

