/* Playlist Panel */
.playlist-panel {
    position: fixed;
    bottom: 72px;
    left: 20px;
    width: 360px;
    max-width: calc(100vw - 420px);
    height: 420px;
    max-height: calc(100vh - 160px);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    flex-direction: column;
    z-index: 199;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
    animation: fadeIn 0.2s;
}

.playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.playlist-clear, .playlist-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.playlist-clear:hover, .playlist-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.mode-btn {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.mode-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}
.mode-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.playlist-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.playlist-item:hover {
    background: var(--bg-hover);
}
.playlist-item.active {
    background: rgba(99, 102, 241, 0.12);
}
.playlist-item.active .playlist-item-name {
    color: var(--accent);
    font-weight: 600;
}

.playlist-item-cover {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: none;
}
.playlist-item-cover-ph {
    background: var(--bg-card);
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}
.playlist-item-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.playlist-item-artist {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.playlist-item-remove {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.playlist-item-remove:hover {
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
}

.playlist-fav-indicator {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
    flex-shrink: 0;
    transition: color 0.2s;
    line-height: 1;
}
.playlist-fav-indicator:hover { color: var(--text-primary); }
.playlist-fav-indicator.active { color: #ef4444; }

.favorites-item-remove.active {
    color: #ef4444;
    font-size: 14px;
}
.favorites-item-remove.active:hover {
    color: var(--text-secondary);
    background: rgba(142, 142, 155, 0.1);
}

.playlist-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-size: 14px;
}

