/* playlist.css
   Playlist drawer styled consistently with nav.css drawers
   ------------------------------------------------ */

/* Force MapleStory font + subtle glow text shadow */
.playlist-drawer,
.playlist-drawer *,
.playlist-chooser,
.playlist-chooser *,
#playlistChooserBackdrop {
  font-family: 'MapleStory', 'Segoe UI', sans-serif;
  text-shadow: 0 0 4px rgba(0,255,255,0.4);
}

/* Wide playlist drawer (slides in from right like nav drawers) */
.playlist-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 80%;
  max-width: 1000px;
  background: rgba(25, 25, 40, 0.95);
  box-shadow: -2px 0 12px #00ffff55;
  backdrop-filter: blur(10px);
  color: #00ffff;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}
.playlist-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Playlist Drawer Header */
.playlist-drawer .map-title {
  width: 100%;
  padding: 1em;
  font-size: 1.1em;
  font-weight: bold;
  color: #00ffff;
  text-align: center;
  background: rgba(15, 15, 25, 0.95);
  text-shadow: 0 0 6px #00ffff88;
  flex-shrink: 0;
  border-bottom: none;
  box-shadow: 0 2px 6px rgba(0,255,255,0.2);
}

/* Body holds sidebar + content side by side */
.playlist-drawer .playlist-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* Sidebar */
.playlist-drawer .playlist-sidebar {
  width: 240px;
  background: rgba(10, 10, 20, 0.95);
  overflow-y: auto;
  padding: 1em 0;
  flex-shrink: 0;
  border-right: none;
  box-shadow: inset -2px 0 8px rgba(0,255,255,0.15);
}
.playlist-drawer .playlist-name {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75em 1em;
  border: none;
  background: #1a1a1a;
  color: #00ffffcc;
  font-size: 0.9em;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.playlist-drawer .playlist-name:hover {
  background-color: #00ffff22;
  color: #fff;
}
.playlist-drawer .playlist-name.active {
  background-color: transparent;
  border-left: 4px solid #00ffff;
  color: #fff;
  box-shadow: 0 0 12px #00ffffaa;
  font-weight: bold;
  animation: activePulse 2s infinite;
}
.playlist-drawer .playlist-name.default-playlist {
  font-weight: bold;
  color: #00ffff;
  text-shadow: 0 0 6px #00ffffaa;
}
.playlist-drawer .playlist-name.default-playlist.active {
  border-left: 4px solid #00ffff;
  box-shadow: 0 0 14px #00ffffcc;
}

/* Main content area */
.playlist-drawer .playlist-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.5em;
}
.playlist-drawer .playlist-title {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 1em;
  color: #00ffff;
  text-shadow: 0 0 6px #00ffff88;
}
.playlist-drawer .playlist-tracklist {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
}

/* === Column headers row (# | Title | Duration) === */
.playlist-header-row {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.4em 0.8em;
  font-size: 0.8em;
  font-weight: bold;
  color: #00ffffaa;
  border-bottom: 1px solid rgba(0,255,255,0.2);
  margin-bottom: 0.5em;
}
.col-number {
  width: 2em;
  text-align: right;
  flex-shrink: 0;
}
.col-title {
  flex: 1;
}
.col-duration {
  margin-left: auto;
  min-width: 3em;
  text-align: right;
}
/* === Track rows with numbering and duration === */
.playlist-item {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: 0.6em 0.8em;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.3s ease;
  }
  .playlist-item:not(.active) {
    background-color: #1a1a1a;
    color: #00ffffcc;
  }
  .playlist-item:hover {
    background-color: #00ffff22;
    color: #fff;
  }
  .playlist-item.active {
    background-color: transparent;
    border-left: 4px solid #00ffff;
    color: #fff;
    box-shadow: 0 0 12px #00ffffaa;
    font-weight: bold;
    animation: activePulse 2s infinite;
  }
  .track-number {
    width: 2em;
    text-align: right;
    color: #aaa;
    flex-shrink: 0;
  }
  .playlist-item:hover .track-number {
    color: #fff;
  }
  .playlist-item.active .track-number {
    color: #00ffff;
  }
  .track-title {
    flex: 1;
  }
  
  /* Duration column */
  .track-duration {
    margin-left: auto;
    color: #888;
    font-size: 0.85em;
    flex-shrink: 0;
    min-width: 3em;
    text-align: right;
  }
  .playlist-item:hover .track-duration {
    color: #fff;
  }
  .playlist-item.active .track-duration {
    color: #00ffff;
  }
  
  /* Scrollbars */
  .playlist-drawer .playlist-sidebar::-webkit-scrollbar,
  .playlist-drawer .playlist-content::-webkit-scrollbar {
    width: 6px;
  }
  .playlist-drawer .playlist-sidebar::-webkit-scrollbar-thumb,
  .playlist-drawer .playlist-content::-webkit-scrollbar-thumb {
    background-color: #00ffff55;
    border-radius: 4px;
  }
  .playlist-drawer .playlist-sidebar::-webkit-scrollbar-thumb:hover,
  .playlist-drawer .playlist-content::-webkit-scrollbar-thumb:hover {
    background-color: #00ffffaa;
  }
  
  /* Playlist Chooser Backdrop */
  #playlistChooserBackdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 20, 0.6);
    z-index: 1999;
  }
  
  /* Playlist Chooser */
  .playlist-chooser {
    position: absolute;
    background: rgba(25, 25, 40, 0.95);
    color: #00ffff;
    padding: 0.5em;
    border: 1px solid #00ffff55;
    border-radius: 6px;
    z-index: 2000;
    min-width: 180px;
    box-shadow: 0 0 12px #00ffff55;
  }
  .playlist-chooser button {
    display: block;
    width: 100%;
    background: #1a1a1a;
    border: none;
    color: #00ffffcc;
    text-align: left;
    padding: 0.5em;
    font-size: 0.85em;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-family: 'MapleStory', 'Segoe UI', sans-serif;
  }
  .playlist-chooser button:hover {
    background-color: #00ffff22;
    color: #fff;
  }
  
  /* === Playback State Styling === */
  .music-panel.playing,
  .playlist-drawer.playing {
    box-shadow: 0 0 16px #00ffffaa, inset 0 0 12px #00ffff33;
  }
  .music-panel.paused,
  .playlist-drawer.paused {
    opacity: 0.85;
    box-shadow: 0 0 8px #00ffff44, inset 0 0 6px #00ffff22;
  }
  