/* ==========================================================================
   playlist.css — WINAMP 2026
   Dark playlist with readable 12px monospace tracks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Playlist Container
   -------------------------------------------------------------------------- */
.playlist-panel {
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   Playlist Header
   -------------------------------------------------------------------------- */
.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}

.playlist-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow-wide);
}

.playlist-actions {
  display: flex;
  gap: 4px;
}

.playlist-action-btn {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 2px 10px;
  cursor: pointer;
  line-height: 1;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.playlist-action-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.03);
}

.playlist-action-btn:active {
  background: rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   Scrollable Track List
   -------------------------------------------------------------------------- */
.playlist-tracks {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 220px;
  padding: 4px 0;
}

/* Scrollbar — accent themed */
.playlist-tracks::-webkit-scrollbar {
  width: 6px;
}

.playlist-tracks::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.playlist-tracks::-webkit-scrollbar-thumb {
  background: var(--accent-glow-wide);
  border-radius: 3px;
}

.playlist-tracks::-webkit-scrollbar-thumb:hover {
  background: var(--accent-glow);
}

/* Firefox scrollbar */
.playlist-tracks {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-glow-wide) rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
   Track Item
   -------------------------------------------------------------------------- */
.playlist-track {
  display: flex;
  align-items: center;
  padding: 5px 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition:
    background var(--transition-fast);
  position: relative;
}

/* Alternating rows */
.playlist-track:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

/* Hover */
.playlist-track:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Currently playing — accent green highlight */
.playlist-track.is-playing {
  background: var(--playlist-playing);
}

/* Green left edge bar for playing track */
.playlist-track.is-playing::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  box-shadow:
    0 0 6px var(--accent-glow),
    0 0 12px var(--accent-glow-wide);
  animation: playlist-pulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes playlist-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow:
      0 0 6px var(--accent-glow),
      0 0 12px var(--accent-glow-wide);
  }
  50% {
    opacity: 0.6;
    box-shadow:
      0 0 3px var(--accent-glow),
      0 0 6px var(--accent-glow-wide);
  }
}

.playlist-track.is-playing .track-title {
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow-wide);
}

/* --------------------------------------------------------------------------
   Track Number
   -------------------------------------------------------------------------- */
.track-number {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--playlist-number);
  min-width: 28px;
  text-align: right;
  padding-right: 10px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Track Title — 12px monospace, clearly readable
   -------------------------------------------------------------------------- */
.track-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--playlist-text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Track Duration
   -------------------------------------------------------------------------- */
.track-duration {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--playlist-number);
  flex-shrink: 0;
  padding-left: 10px;
}

/* Drag states */
.playlist-track.is-dragging {
  opacity: 0.5;
}

.playlist-track.drag-above {
  box-shadow: inset 0 2px 0 var(--accent);
}

.playlist-track.drag-below {
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.playlist-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  text-align: center;
  min-height: 110px;
}
