/* ============================================
   Bottom Player Styles (YouTube Music style)
   ============================================ */

/* Body padding for fixed player */
body.has-player {
  padding-bottom: 64px;
}

/* ===== FIXED BOTTOM PLAYER ===== */
.bottom-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(18, 18, 20, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 10000;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  transition: opacity 0.3s ease;
}

.bottom-player.hidden {
  display: none !important;
}

/* Progress bar at the very top of player */
.bottom-player-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent, #6366f1);
  width: 0%;
  transition: width 0.3s linear;
  z-index: 1;
}

/* Thumbnail / Artwork */
.player-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: 0.3s;
}

.player-thumb.playing {
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.player-thumb svg {
  width: 22px;
  height: 22px;
  color: white;
}

/* Track info */
.player-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.player-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1px;
  color: var(--text-primary, #ffffff);
}

.player-artist {
  font-size: 11px;
  color: var(--text-muted, #737373);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Single play/pause button */
.player-btn-main {
  width: 44px;
  height: 44px;
  background: var(--accent, #6366f1);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.player-btn-main:active {
  background: #4f46e5;
  transform: scale(0.95);
}

.player-btn-main svg {
  width: 22px;
  height: 22px;
}

/* Responsive */
@media (max-width: 480px) {
  body.has-player {
    padding-bottom: 60px;
  }
  
  .bottom-player {
    height: 60px;
    padding: 0 12px;
    gap: 10px;
  }
  
  .player-thumb {
    width: 40px;
    height: 40px;
  }
  
  .player-thumb svg {
    width: 20px;
    height: 20px;
  }
  
  .player-title {
    font-size: 12px;
  }
  
  .player-artist {
    font-size: 10px;
  }
  
  .player-btn-main {
    width: 40px;
    height: 40px;
  }
  
  .player-btn-main svg {
    width: 20px;
    height: 20px;
  }
}

/* ===== EXPANDED PLAYER (Fullscreen) ===== */
body.player-expanded {
  overflow: hidden !important;
}

.player-expanded-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg, #050505);
  z-index: 20000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow-y: auto;
}

/* Twinkling stars background */
.player-expanded-overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 20% 40%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 30% 10%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 40% 60%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 50% 30%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.5px 1.5px at 60% 70%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 70% 15%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 80% 50%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 90% 80%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 15% 75%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 25% 55%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 35% 85%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 45% 5%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 55% 45%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 65% 90%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 75% 35%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 85% 65%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 95% 25%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 5% 50%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 50% 95%, rgba(255,255,255,0.5), transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.player-expanded-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Header */
.player-expanded-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top)) 20px 16px;
}

.player-expanded-header .icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  color: var(--text-secondary, #a3a3a3);
  cursor: pointer;
  transition: 0.2s;
}

.player-expanded-header .icon-btn:active {
  background: rgba(255,255,255,0.1);
  transform: scale(0.95);
}

.player-expanded-header .icon-btn svg {
  width: 18px;
  height: 18px;
}

.player-expanded-header .header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
}

/* Album Art */
.player-expanded-art {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 32px;
}

.album-art-circle {
  width: min(280px, 70vw);
  height: min(280px, 70vw);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

.album-art-circle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), transparent 50%);
}

.album-art-circle svg {
  width: 100px;
  height: 100px;
  color: white;
  position: relative;
  z-index: 1;
}

.album-art-circle.playing {
  animation: spin 64s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Track Info */
.player-expanded-info {
  text-align: center;
  margin-bottom: 28px;
  width: 100%;
}

.player-expanded-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-expanded-artist {
  font-size: 14px;
  color: var(--text-secondary, #a3a3a3);
}

/* Progress Section */
.player-expanded-progress {
  width: 100%;
  margin-bottom: 28px;
}

.progress-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 8px;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent, #6366f1);
  border-radius: 2px;
  transition: width 0.3s linear;
}

.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted, #737373);
}

/* Controls */
.player-expanded-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.player-expanded-controls .ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary, #a3a3a3);
  cursor: pointer;
  transition: 0.2s;
  padding: 8px;
}

.player-expanded-controls .ctrl-btn:active {
  color: var(--text-primary, #ffffff);
  transform: scale(0.9);
}

.player-expanded-controls .ctrl-btn svg {
  width: 28px;
  height: 28px;
}

.player-expanded-controls .ctrl-btn.prev-next svg {
  width: 32px;
  height: 32px;
}

.player-expanded-controls .ctrl-btn.play-pause {
  width: 64px;
  height: 64px;
  background: var(--accent, #6366f1);
  color: white;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.player-expanded-controls .ctrl-btn.play-pause:active {
  background: #4f46e5;
  transform: scale(0.95);
}

.player-expanded-controls .ctrl-btn.play-pause svg {
  width: 28px;
  height: 28px;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.player-expanded-header {
  animation: fadeInUp 0.4s ease-out;
}
.album-art-circle {
  animation: fadeInUp 0.5s ease-out backwards;
  animation-delay: 0.05s;
}
.player-expanded-info {
  animation: fadeInUp 0.5s ease-out backwards;
  animation-delay: 0.1s;
}
.player-expanded-progress {
  animation: fadeInUp 0.5s ease-out backwards;
  animation-delay: 0.15s;
}
.player-expanded-controls {
  animation: fadeInUp 0.5s ease-out backwards;
  animation-delay: 0.2s;
}
