/* ==========================================================================
   PIYUSH AUDIO STUDIO - CLEAN MODERN MUSIC PLAYER
   High-end Dark Mode Audio Suite with Web Audio API Visualizer
   ========================================================================== */

.music-app-body {
  background: var(--bg-main, #090d16);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  font-family: var(--font-body);
}

/* Background Audio Visualizer Canvas */
#visualizer-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
}

/* Top Navigation Bar */
.music-navbar {
  position: relative;
  z-index: 10;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
}

.music-back-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color var(--tr-fast);
}

.music-back-link:hover {
  color: #ffffff;
}

.music-header-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Music Player Layout: Main Stage + Playlist Drawer */
.music-main-stage {
  flex: 1;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100vh - 68px);
  overflow: hidden;
}

/* Left / Center Player Showcase */
.music-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

/* Vinyl / Album Art Container */
.album-visual-container {
  position: relative;
  width: 320px;
  height: 320px;
  margin-bottom: 1.8rem;
}

.vinyl-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid var(--border-subtle);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: box-shadow var(--tr-smooth);
}

.vinyl-disc.playing {
  animation: spin 10s linear infinite;
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.35);
}

.vinyl-art-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #090d16;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

.vinyl-center-hole {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 2px solid var(--border-subtle);
  z-index: 3;
}

/* Equalizer Bars */
.live-equalizer-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 24px;
  margin-bottom: 1rem;
}

.eq-bar {
  width: 4px;
  height: 5px;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: height 0.1s ease;
}

.eq-bar.active {
  animation: eqPulse 0.8s ease infinite alternate;
}

.eq-bar:nth-child(2) { animation-delay: 0.15s; }
.eq-bar:nth-child(3) { animation-delay: 0.3s; }
.eq-bar:nth-child(4) { animation-delay: 0.45s; }
.eq-bar:nth-child(5) { animation-delay: 0.2s; }
.eq-bar:nth-child(6) { animation-delay: 0.5s; }

@keyframes eqPulse {
  0% { height: 4px; }
  100% { height: 22px; }
}

/* Track Showcase Metadata */
.track-showcase-meta {
  text-align: center;
  margin-bottom: 1.5rem;
  max-width: 480px;
}

.track-showcase-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}

.track-showcase-artist {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 500;
}

/* Controls Panel */
.music-controls-panel {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scrub-progress-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.playback-buttons-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
}

.play-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  color: #090d16;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.25);
  transition: transform var(--tr-fast);
}

.play-toggle-btn:hover {
  transform: scale(1.08);
}

.music-tool-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--tr-fast);
}

.music-tool-btn:hover {
  color: #fff;
  transform: scale(1.15);
}

.music-tool-btn.active {
  color: var(--accent-primary);
}

/* Right Side: Playlist Management Drawer */
.playlist-drawer {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.playlist-drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.playlist-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.playlist-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.playlist-search-box {
  width: 100%;
  position: relative;
}

.playlist-search-box input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  background: rgba(9, 13, 22, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.search-icon-pos {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Scrollable Playlist Track Rows */
.playlist-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.playlist-track-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(9, 13, 22, 0.6);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--tr-fast);
}

.playlist-track-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.playlist-track-row.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-primary);
}

.track-row-art {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.track-row-info {
  flex: 1;
  overflow: hidden;
}

.track-row-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-row-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive */
@media (max-width: 900px) {
  .music-main-stage {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
  }

  .playlist-drawer {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    max-height: 420px;
  }

  .album-visual-container {
    width: 250px;
    height: 250px;
  }

  .vinyl-art-img {
    width: 140px;
    height: 140px;
  }
}
