/* ==========================================================================
   AuraSound Cloud - 擬態玻璃播放器、黑膠、書籍封面與控制元件
   (Player Glass, Vinyl & 3D Book Art, Equalizer & Mini Player)
   ========================================================================== */

/* 迷你底層懸浮播放條 (Mini Player Bar) */
.mini-player {
  position: fixed;
  bottom: calc(var(--nav-bar-height) + var(--safe-bottom) + 8px);
  left: 12px;
  right: 12px;
  height: var(--mini-player-height);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: rgba(22, 29, 46, 0.88);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 45;
  cursor: pointer;
  transition: transform 0.3s var(--bounce), opacity 0.2s ease;
  overflow: hidden;
}

.mini-player.hidden {
  transform: translateY(120px);
  opacity: 0;
  pointer-events: none;
}

/* 迷你播放條頂部微細進度線 */
.mini-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.mini-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  transition: width 0.1s linear;
}

.mini-player-left {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  flex: 1;
}

.mini-cover {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: #111;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

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

.mini-vinyl-art {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #181818, #2a2a2a, #181818, #353535, #181818);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-vinyl-art.spinning {
  animation: spin 10s linear infinite;
}

.mini-track-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mini-track-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.mini-track-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.mini-ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mini-ctrl-btn.play-btn {
  background: var(--primary-gradient);
  box-shadow: 0 2px 10px rgba(0, 242, 254, 0.4);
}

/* ==========================================================================
   全螢幕沉浸式播放介面 (Full-Screen Player View)
   ========================================================================== */
.player-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 12px 20px 24px 20px;
  position: relative;
  justify-content: space-between;
}

/* 頂部模式切換器 (有聲書模式 vs 音樂模式) */
.mode-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.mode-toggle-pill {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-full);
  background: var(--bg-glass-pill);
  border: 1px solid var(--glass-border);
}

.mode-btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 242, 254, 0.35);
}

.mode-btn.audiobook.active {
  background: var(--audiobook-gradient);
  box-shadow: 0 2px 10px rgba(230, 92, 0, 0.4);
}

/* 核心藝術視覺展示區 (黑膠唱片 / 3D 書籍卡片) */
.art-stage-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 250px;
  margin: 8px 0;
}

/* 1. 音樂模式：動態擬態黑膠唱片 (Vinyl Record) */
.vinyl-wrap {
  width: 230px;
  height: 230px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.vinyl-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #0d0d0d 0%, #171717 65%, #050505 100%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 0 4px rgba(255, 255, 255, 0.05), inset 0 0 30px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.vinyl-disc.playing {
  animation: spin 12s linear infinite;
}

.vinyl-grooves-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ring-1 { width: 85%; height: 85%; }
.ring-2 { width: 70%; height: 70%; }
.ring-3 { width: 55%; height: 55%; }

.vinyl-disc-center {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
  color: #fff;
  position: relative;
}

.vinyl-center-hole {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0a0e17;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* 2. 有聲書模式：3D 立體書籍卡片 (3D Audiobook Cover) */
.book-card-wrap {
  width: 200px;
  height: 240px;
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.book-card-3d {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(245, 175, 25, 0.3);
  box-shadow: -8px 12px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(245, 175, 25, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: rotateY(-8deg) rotateX(4deg);
  transition: transform 0.4s ease;
}

.book-card-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 12px;
  background: linear-gradient(90deg, rgba(245, 175, 25, 0.5) 0%, rgba(245, 175, 25, 0.1) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.book-icon-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--audiobook-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(230, 92, 0, 0.5);
}

.book-title-display {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-chapter-tag {
  font-size: 11px;
  color: var(--audiobook-gold);
  background: rgba(245, 175, 25, 0.15);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* 頻譜跳動視覺化畫布 (Visualizer Canvas) */
.visualizer-box {
  width: 100%;
  max-width: 300px;
  height: 48px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visualizer-canvas {
  width: 100%;
  height: 100%;
}

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

/* 歌曲與章節資訊區塊 */
.meta-info-container {
  text-align: center;
  padding: 4px 10px;
}

.meta-badges-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.cloud-source-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 242, 254, 0.15);
  color: var(--primary-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.format-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  text-transform: uppercase;
}

.meta-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   進度條與大熱區時間滑軌 (Progress & Seek Bar)
   ========================================================================== */
.seek-bar-container {
  width: 100%;
  padding: 10px 0;
}

.seek-track-wrapper {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.seek-track-bg {
  position: absolute;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.seek-buffer-fill {
  position: absolute;
  left: 0;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  width: 0%;
}

.seek-progress-fill {
  position: absolute;
  left: 0;
  height: 6px;
  border-radius: 3px;
  background: var(--primary-gradient);
  width: 0%;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

.seek-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 242, 254, 0.8);
  transform: translateX(-50%);
  left: 0%;
  transition: transform 0.1s ease;
}

.seek-track-wrapper:active .seek-thumb {
  transform: translateX(-50%) scale(1.25);
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-family-mono);
  font-weight: 500;
  margin-top: 2px;
}

/* ==========================================================================
   核心控制按鍵區 (Main Controls)
   ========================================================================== */
.main-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.ctrl-btn:active {
  transform: scale(0.9);
}

.ctrl-btn.skip-btn {
  width: 48px;
  height: 48px;
  background: var(--bg-glass-pill);
  border: 1px solid var(--glass-border-subtle);
  position: relative;
}

.skip-tag {
  font-size: 9px;
  font-weight: 700;
  position: absolute;
  bottom: 8px;
  color: var(--audiobook-gold);
}

.ctrl-btn.chapter-btn {
  width: 44px;
  height: 44px;
  color: var(--text-secondary);
}

.ctrl-btn.play-pause-hero {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--primary-gradient);
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.45);
  color: #fff;
}

.ctrl-btn.play-pause-hero.audiobook-mode {
  background: var(--audiobook-gradient);
  box-shadow: 0 8px 24px rgba(230, 92, 0, 0.45);
}

/* ==========================================================================
   有聲書專屬功能條 (Audiobook Action Bar: Speed, Timer, Bookmarks)
   ========================================================================== */
.audiobook-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 6px;
  margin-top: 8px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass-card-nested);
  border: 1px solid var(--glass-border-subtle);
}

.tool-chip-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-glass-pill);
  border: 1px solid var(--glass-border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tool-chip-btn.active {
  background: rgba(245, 175, 25, 0.2);
  border-color: var(--audiobook-gold);
  color: var(--audiobook-gold);
}

.tool-chip-btn:active {
  transform: scale(0.94);
}

/* 彈出抽屜面板 (Bottom Sheet Modal) */
.glass-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: var(--glass-blur-sm);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.glass-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.glass-sheet {
  background: rgba(20, 27, 44, 0.95);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  padding: 20px 20px calc(24px + var(--safe-bottom)) 20px;
  transform: translateY(100%);
  transition: transform 0.3s var(--bounce);
  max-height: 80vh;
  overflow-y: auto;
}

.glass-modal-overlay.active .glass-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 auto 16px auto;
}

.sheet-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
