/* Sonora Player Styles: Mini-Player & Cinematic Full Player */

/* ---------------- MINI-PLAYER ---------------- */
.mini-player {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--mini-player-height);
  background: rgba(15, 15, 23, 0.88);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: var(--z-mini-player);
  transition: bottom var(--transition-normal), left var(--transition-normal);
}

.mini-player-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.mini-player-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dynamic), #ec4899);
  transition: width 0.1s linear;
  position: relative;
}

.mini-player-progress-bar:hover {
  height: 6px;
}

.mini-player-progress-bar:hover .mini-player-progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.mini-track-info {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 300px;
  cursor: pointer;
}

.mini-artwork {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-elevated);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

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

.mini-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-artist {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Center Controls */
.mini-controls-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 540px;
}

.mini-control-buttons {
  display: flex;
  align-items: center;
  gap: 18px;
}

.control-btn {
  color: var(--text-secondary);
  padding: 8px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.control-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.control-btn:hover {
  color: #ffffff;
  background: var(--bg-surface-hover);
}

.control-btn.active {
  color: var(--accent-dynamic);
}

.play-pause-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: #0a0a0f !important;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.play-pause-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  stroke: none;
}

.play-pause-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 22px rgba(255, 255, 255, 0.4);
}

.mini-scrubber-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.time-stamp {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}

.scrubber-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
  transition: height 0.15s;
}

.scrubber-slider:hover {
  height: 6px;
}

.scrubber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Right utilities */
.mini-utilities-right {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 280px;
  justify-content: flex-end;
}

.visualizer-preview-canvas {
  width: 64px;
  height: 28px;
  border-radius: var(--radius-xs);
  opacity: 0.85;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  width: 80px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
}

/* ---------------- FULL-SCREEN CINEMATIC PLAYER ---------------- */
.full-player-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #09090f;
  z-index: var(--z-full-player);
  display: flex;
  flex-direction: column;
  padding: 36px 48px;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.full-player-overlay.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.full-player-backdrop-blur {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-size: cover;
  background-position: center;
  filter: blur(80px) saturate(180%) brightness(0.35);
  transform: translate3d(0, 0, 0);
  z-index: 1;
}

.full-player-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.player-close-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.player-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.05);
}

.player-source-badge {
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.full-player-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 64px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.artwork-container {
  flex: 1;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.large-artwork {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: var(--shadow-artwork);
  transition: transform 0.5s ease;
}

.large-artwork.playing {
  transform: scale(1.02);
}

.full-player-info-column {
  flex: 1;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.track-headline {
  margin-bottom: 24px;
}

.full-track-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.15;
}

.full-track-artist {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.full-track-album {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Frequency Visualizer Canvas */
.full-visualizer-canvas {
  width: 100%;
  height: 80px;
  border-radius: var(--radius-md);
  margin: 16px 0 24px 0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
}

/* Full player scrubber */
.full-scrubber-container {
  margin-bottom: 32px;
}

.full-time-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Full player large buttons */
.full-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.full-play-btn {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: #09090f;
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.full-play-btn svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.full-play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(255, 255, 255, 0.5);
}

/* Queue Drawer */
.queue-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100%;
  background: rgba(18, 18, 28, 0.95);
  backdrop-filter: blur(30px);
  border-left: 1px solid var(--border-subtle);
  z-index: var(--z-modal);
  transition: right var(--transition-smooth);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.queue-drawer.open {
  right: 0;
}

.queue-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.queue-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--transition-fast);
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.queue-item.active {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid var(--border-glow);
}

.queue-item-meta {
  flex: 1;
  overflow: hidden;
}

.queue-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .mini-player {
    left: 0;
    bottom: var(--mobile-nav-height);
    padding: 0 16px;
  }
  .mini-track-info {
    width: auto;
    max-width: 180px;
  }
  .mini-utilities-right {
    display: none;
  }
  .full-player-body {
    flex-direction: column;
    gap: 24px;
    padding-bottom: 24px;
  }
  .large-artwork {
    max-width: 260px;
  }
  .full-track-title {
    font-size: 1.5rem;
  }
  .queue-drawer {
    width: 100%;
    right: -100%;
  }
}

/* ---------------- YOUTUBE EMBEDDED PLAYER PANEL ---------------- */
.yt-embedded-panel {
  position: fixed;
  bottom: calc(var(--mini-player-height) + 16px);
  right: 24px;
  width: 440px;
  background: rgba(14, 14, 22, 0.96);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(139, 92, 246, 0.15);
  z-index: calc(var(--z-mini-player) + 5);
  overflow: hidden;
  animation: slideInUp 0.25s ease forwards;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.yt-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  gap: 8px;
}

.yt-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex: 1;
}

.yt-panel-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yt-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.yt-action-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-fast);
}

.yt-action-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.yt-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.yt-close-btn:hover {
  color: #ffffff;
}

.yt-iframe-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.yt-iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.yt-panel-footer {
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

@media (max-width: 640px) {
  .yt-embedded-panel {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: calc(var(--mini-player-height) + 8px);
  }
}
