/* 播放列表面板样式 */
@import url('./variables.css');
@import url('./common.css');

/* 播放列表按钮 */
.nav-item.playlist-toggle {
    cursor: pointer;
}

/* 播放列表面板 */
.playlist-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background-color: var(--surface);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 998;
    transform: translateX(100%);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-light);
}

.playlist-panel.show {
    transform: translateX(0);
}

/* 播放列表头部 */
.playlist-panel-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-light);
}

.playlist-panel-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.playlist-panel-title i {
    color: var(--primary);
}

.playlist-panel-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.playlist-panel-close:hover {
    background-color: var(--bg-gray);
    color: var(--primary-dark);
}

/* 播放列表操作栏 */
.playlist-panel-actions {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
}

.playlist-panel-action-btn {
    flex: 1;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background-color: var(--secondary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.playlist-panel-action-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary);
}

.playlist-panel-action-btn.danger {
    color: var(--danger);
    border-color: var(--danger);
}

.playlist-panel-action-btn.danger:hover {
    background-color: var(--danger);
    color: var(--light);
}

/* 播放列表内容 */
.playlist-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.playlist-panel-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
    gap: 12px;
}

.playlist-panel-item:hover {
    background-color: var(--primary-light);
}

.playlist-panel-item.playing,
.playlist-panel-item.active {
    background-color: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.playlist-panel-item.active .playlist-panel-item-title {
    color: var(--primary-dark);
    font-weight: 600;
}

.playlist-panel-item-cover {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: var(--bg-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-disabled);
}

.playlist-panel-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.playlist-panel-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-panel-item-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.playlist-panel-item-artist {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-panel-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.playlist-panel-item-playing-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.playlist-panel-item-locate {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.playlist-panel-item-locate:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.playlist-panel-item:not(.active):not(.playing) .playlist-panel-item-locate {
    display: none;
}

.playlist-panel-item-delete {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlist-panel-item-delete:hover {
    background-color: var(--danger);
    color: var(--light);
}

/* 空状态 */
.playlist-panel-empty {
    text-align: center;
    padding: 60px 24px;
}

.playlist-panel-empty-icon {
    font-size: 64px;
    color: var(--text-disabled);
    margin-bottom: 16px;
}

.playlist-panel-empty-text {
    font-size: 16px;
    color: var(--text-secondary);
}

/* 遮罩层 */
.playlist-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 997;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.playlist-panel-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .playlist-panel {
        width: 100%;
        max-width: 400px;
    }
}

