@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Poppins', sans-serif; background: #000; color: #fff; overflow: hidden; height: 100dvh; }

.container {
  display: flex;
  height: 100dvh;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a0b2e 100%);
  position: relative;
}

/* Player Side */
.player-controls {
  flex: 1;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 15, 15, 0.7);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}

.player-controls::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, #ff006e, #8338ec, #06ffa5);
  opacity: 0.15;
  z-index: -1;
}

h1 {
  font-size: 2.8rem;
  background: linear-gradient(90deg, #ff006e, #06ffa5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
  margin-bottom: 20px;
  font-weight: 700;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 24px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
}

.artwork {
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, #ff006e, #8338ec);
  border-radius: 16px;
  flex-shrink: 0;
  animation: pulse 4s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 20px #ff006e60; }
  50% { box-shadow: 0 0 40px #8338ec80; }
}

.track-info { flex: 1; overflow: hidden; }
.marquee {
  font-size: 1.4rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
  animation: marquee 15s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.progress-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0;
}

.progress-bar-bg {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 50px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff006e, #06ffa5);
  border-radius: 50px;
  transition: width 0.3s ease;
  box-shadow: 0 0 20px #ff006e80;
}

.timeline-tooltip {
  position: absolute;
  top: -30px;
  background: rgba(0,0,0,0.8);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  display: none;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.ctrl-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 1.4rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
  cursor: pointer;
}

.ctrl-btn:hover { transform: scale(1.1); background: rgba(255,255,255,0.2); }

.play-btn {
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, #ff006e, #8338ec);
  font-size: 2.2rem;
  box-shadow: 0 0 30px #ff006e80;
}

.play-btn:hover { transform: scale(1.1); }

.stats {
  display: flex;
  gap: 20px;
  font-size: 1rem;
  opacity: 0.8;
}

.error {
  color: #ff006e;
  font-size: 0.9rem;
  margin: 10px 0;
  display: none;
}

#footerCredit {
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
}

#footerCredit a {
  color: #06ffa5;
  text-decoration: none;
}

/* Song List */
#musicListContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(20px);
}

.header-list {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0,0,0,0.4);
}

.header-list h2 {
  font-size: 1.8rem;
}

.header-list input, .header-list select {
  padding: 14px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(45deg, #ff006e, #8338ec);
  color:rgba(0, 0, 0, 0.4);
  font-size: 1rem;
}

#musicList {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 20px;
}

.music-item {
  padding: 16px 18px;
  margin: 10px 0;
  background: rgba(40, 40, 70, 0.85);
  border-radius: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 600;
  backdrop-filter: blur(12px);
  min-height: 60px;
  cursor: pointer;
}

.music-item:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 0, 110, 0.4);
}

.music-item.active {
  background: linear-gradient(90deg, #ff006e, #8338ec);
  color: white;
  font-weight: 700;
  box-shadow: 0 0 30px #ff006e80;
  border: none;
}

.marquee-container {
  flex: 1;
  overflow: hidden;
}

.marquee-text {
  white-space: nowrap;
  display: inline-block;
  animation: marquee 15s linear infinite;
}

.no-songs {
  text-align: center;
  padding: 20px;
  opacity: 0.7;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0; right: 0;
  width: 100%;
  max-width: 380px;
  height: 100%;
  background: rgba(15, 15, 30, 0.95);
  backdrop-filter: blur(20px);
  padding: 30px;
  transform: translateX(100%);
  transition: 0.4s cubic-bezier(0.22, 0.68, 0.26, 1);
  z-index: 1000;
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar h2 {
  margin-bottom: 20px;
}

.sidebar input, .sidebar select, .sidebar button {
  width: 100%;
  padding: 16px;
  margin: 10px 0;
  border-radius: 16px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
}

.sidebar button {
  background: linear-gradient(45deg, #06ffa5, #00ff88);
  font-weight: 600;
  color: black;
  cursor: pointer;
}

#sidebarClose {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, #ff006e, #8338ec);
  border: none;
  border-radius: 50%;
  font-size: 1.8rem;
  color: white;
  box-shadow: 0 10px 30px rgba(255,0,110,0.5);
  z-index: 999;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: 100dvh;
  }

  .player-controls {
    flex: 0 0 auto;
    padding: 20px 15px 80px 15px;
    border-right: none;
    min-height: 45dvh;
  }

  #musicListContainer {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .header-list {
    padding: 15px;
  }

  #musicList {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 100px;
  }

  h1 {
    font-size: 2rem;
  }

  .now-playing {
    padding: 14px;
  }

  .artwork {
    width: 60px;
    height: 60px;
  }

  .play-btn {
    width: 78px;
    height: 78px;
    background: linear-gradient(135deg, #ff006e, #8338ec);
    border: none;
    border-radius: 50%;
    font-size: 2.4rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(255, 0, 110, 0.6),
                0 0 30px rgba(131, 56, 236, 0.5);
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
  }

  .play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(255, 0, 110, 0.8);
  }

  .play-btn:active {
    transform: scale(0.95);
  }

  #playPauseIcon {
    margin-left: 4px;
  }

  .fab {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    font-size: 1.6rem;
  }

  .sidebar {
    max-width: 100%;
  }
}