/* elysiamusic.css - Elysia Liquid Glass Player (Apple Music Style & Fixed Alignment) */

/* =========================================
   1. 基础容器
   ========================================= */
.elysia-player {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: 332px; 
  height: 50px; 
  perspective: 1000px;
  background: transparent;
  animation: elysiaFloat 6s ease-in-out infinite;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* =========================================
   2. 3D 骨架
   ========================================= */
.player-glass-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.elysia-player.flipped .player-glass-card {
  transform: rotateX(180deg);
}

.elysia-player:active .player-glass-card {
  transform: scale(0.98);
}
.elysia-player.flipped:active .player-glass-card {
  transform: rotateX(180deg) scale(0.98);
}

/* =========================================
   3. 前后两面 (Face Layout)
   ========================================= */
.player-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  /* 前后两面使用相同的 gap 和 padding，确保完美重合 */
  gap: 14px;
  padding: 8px 20px;
  
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(150,110,240,0.25), inset 0 1px 0 rgba(255,255,255,0.08);

  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  z-index: 1; 
}

/* --- 正面 (Front) --- */
.face-front {
  transform: rotateX(0deg);
  justify-content: flex-start; 
  pointer-events: auto;
}

/* --- 背面 (Back) --- */
.face-back {
  transform: rotateX(180deg);
  justify-content: flex-start; /* 与正面保持一致，靠左 */
  pointer-events: auto;
}

.elysia-player.flipped .face-front { pointer-events: none !important; }
.elysia-player.flipped .face-back { pointer-events: auto !important; }

/* 内部流动的液态光斑 */
.player-glass-card::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(40% 40% at 10% 30%, rgba(156,107,255,0.35), transparent 20%),
    radial-gradient(30% 30% at 70% 20%, rgba(180,120,255,0.25), transparent 18%),
    radial-gradient(35% 35% at 40% 70%, rgba(140,200,255,0.18), transparent 22%);
  filter: blur(36px);
  opacity: 0.9;
  animation: moveBlobs 14s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
  transform: translateZ(-10px); 
  z-index: -1; 
}

/* =========================================
   4. 控件按钮 (Apple Music Style)
   ========================================= */
.elysia-controls { 
  display: flex; 
  gap: 12px; /* 稍微增加间距 */
  flex-shrink: 0; 
  align-items: center;
}

.elysia-controls button,
.control-btn {
  width: 34px; 
  height: 34px; 
  border-radius: 50%;
  
  /* 磨砂玻璃风格，去掉实线边框，改用内发光 */
  background: rgba(255, 255, 255, 0.1); 
  border: none; 
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
  
  color: #fff; 
  cursor: pointer; 
  transition: all .2s cubic-bezier(0.25, 0.8, 0.25, 1); 
  backdrop-filter: blur(8px);
  
  /* Flex 居中 SVG */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  -webkit-appearance: none;
  outline: none;
}

/* SVG 图标通用样式 */
.elysia-controls button svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
  fill: currentColor; /* 跟随文字颜色 */
  transition: transform 0.2s;
}

/* 播放按钮视觉修正：Play 三角形通常视觉重心偏左，需要向右移一点点 */
#playPauseBtn:not(.playing) svg {
  margin-left: 2px;
}

/* 悬停效果 */
.elysia-controls button:hover,
.control-btn:hover { 
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05); 
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}

/* 点击按压效果 */
.elysia-controls button:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.08);
}

/* --- 爱心激活样式 --- */
#heartBtn.liked {
  color: #ff6b81; /* 粉色 */
  background: rgba(255, 107, 129, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 129, 0.3);
  animation: heartPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1.05); }
}

/* --- 统一标题样式 (位置完美重合) --- */
#songTitle,
#playlistTitleBtn {
  color: #f2eaff; 
  font-weight: 600; 
  width: 200px; 
  font-size: 0.95rem;
  
  /* 统一左对齐 */
  text-align: left; 
  
  text-shadow: 0 0 10px rgba(160,120,255,0.45);
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  cursor: pointer;
  transition: color 0.3s ease;
}

#playlistTitleBtn:hover, #songTitle:hover {
  color: #fff;
  text-shadow: 0 0 15px rgba(180,140,255,0.8);
}


/* =========================================
   5. 播放列表 & 歌单菜单
   ========================================= */
.elysia-playlist {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%) scale(0.98);
  transform-origin: 50% 100%;
  width: 260px;
  max-height: 260px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255,240,255,0.25);
  border: 1px solid rgba(255,210,255,0.35);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 8px 24px rgba(200,160,255,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
  opacity: 0; 
  pointer-events: none;
  z-index: 9998;
  scrollbar-width: thin;
  will-change: transform, opacity;
}

.playlist-item {
  padding: 6px 10px;
  color: #cdbaff; 
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item:hover {
  background: rgba(160, 120, 255, 0.15);
  color: #ffffff;
}

.playlist-item.active {
  background: rgba(160, 120, 255, 0.25);
  color: #fff;
  box-shadow: 0 0 12px rgba(160, 120, 255, 0.6);
  animation: softPulse 3s ease-in-out infinite;
}

.elysia-playlist::after {
  content: ""; 
  position: absolute; 
  inset: 0; 
  border-radius: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(220,190,255,0.45), rgba(200,160,255,0.18) 45%, transparent 65%);
  opacity: 0; 
  transform: scale(0.8); 
  pointer-events: none; 
  transition: opacity .6s ease, transform .6s ease;
  z-index: -1;
}

.elysia-playlist.show::after { opacity: 1; transform: scale(1.35); }
.elysia-playlist.hide::after { opacity: 0; transform: scale(0.6); }

/* =========================================
   6. 动画
   ========================================= */
.elysia-playlist.show {
  opacity: 1; 
  pointer-events: auto;
  animation: dockBounceOpen 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  transform-origin: 50% 100%;
}
.elysia-playlist.hide {
  animation: dockBounceClose 0.4s cubic-bezier(0.3, 0, 0.7, 0.3) both;
  transform-origin: 50% 100%;
}
@keyframes dockBounceOpen {
  0%   { transform: translateX(-50%) scale(0.9) translateY(10px); opacity: 0; }
  60%  { transform: translateX(-50%) scale(1.02) translateY(-2px); opacity: 1; }
  100% { transform: translateX(-50%) scale(1) translateY(0); }
}
@keyframes dockBounceClose {
  0%   { transform: translateX(-50%) scale(1); opacity: 1; }
  35%  { transform: translateX(-50%) scale(1.02); }
  100% { transform: translateX(-50%) scale(0.8) translateY(10px); opacity: 0; }
}
@keyframes moveBlobs { 
  0%,100%{transform:translate3d(0,0,0) scale(1.03);} 
  50%{transform:translate3d(4%,-3%,0) scale(1.05);} 
}
@keyframes softPulse { 
  0%,100%{box-shadow:0 0 10px rgba(160,120,255,0.4);} 
  50%{box-shadow:0 0 18px rgba(160,120,255,0.8);} 
}
@keyframes elysiaFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-6px); }
}
