/* ============================================
   PLAYLISTS – Grid, Cards, Detail, Picker
   ============================================ */

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.playlist-empty {
    grid-column: 1/-1;
    text-align: center;
    padding: 60px 40px;
    color: #94a3b8;
}

/* ── Card ── */
.playlist-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px; overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.2s ease;
    position: relative;
}

.playlist-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.12);
}

.playlist-card-cover {
    width: 100%; height: 160px;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
    position: relative; overflow: hidden;
}

.playlist-card-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s ease;
}

.playlist-card:hover .playlist-card-overlay { opacity: 1; }

.playlist-card-info { padding: 14px 16px 10px; }

.playlist-card-name {
    font-size: 0.9rem; font-weight: 700;
    margin-bottom: 4px; color: #f1f5f9;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.playlist-card-count { font-size: 0.75rem; color: #64748b; }

.playlist-card-actions {
    padding: 0 16px 12px;
    display: flex; gap: 8px;
    opacity: 0; transition: opacity 0.2s ease;
}

.playlist-card:hover .playlist-card-actions { opacity: 1; }

.playlist-action-btn {
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5; padding: 4px 10px;
    border-radius: 8px; cursor: pointer;
    font-size: 0.75rem; transition: all 0.15s ease;
}

.playlist-action-btn:hover { background: rgba(239,68,68,0.3); }

/* ── Detail Modal ── */
.playlist-detail-modal {
    max-width: 620px; max-height: 85vh;
    overflow-y: auto; scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.playlist-track-list { display: flex; flex-direction: column; gap: 4px; }

.playlist-track-item {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 14px; border-radius: 10px;
    cursor: pointer; transition: background 0.15s ease;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
}

.playlist-track-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
}

.playlist-track-num {
    color: #64748b; font-size: 0.8rem;
    min-width: 20px; text-align: center;
}

.playlist-track-info {
    flex: 1; overflow: hidden;
    display: flex; flex-direction: column; gap: 2px;
}

.playlist-track-title {
    font-size: 0.875rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.playlist-track-artist {
    font-size: 0.75rem; color: #94a3b8;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.playlist-track-duration {
    font-size: 0.75rem; color: #64748b;
    font-variant-numeric: tabular-nums; flex-shrink: 0;
}

.playlist-remove-btn {
    background: transparent; border: none;
    color: #64748b; cursor: pointer;
    font-size: 0.85rem; padding: 4px 6px;
    border-radius: 6px; opacity: 0;
    transition: all 0.15s ease;
}

.playlist-track-item:hover .playlist-remove-btn { opacity: 1; }
.playlist-remove-btn:hover { background: rgba(239,68,68,0.2); color: #fca5a5; }

/* ── Playlist Picker Popup (am Button verankert) ── */
.playlist-picker-inner {
    background: #0d1127;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px; padding: 20px;
    width: 280px;
    box-shadow:
        0 25px 60px rgba(0,0,0,0.6),
        0 0 0 1px rgba(59,130,246,0.08),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

@keyframes popupIn {
    from { opacity: 0; transform: scale(0.9) translateY(6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.playlist-picker-inner h4 {
    font-size: 0.95rem; font-weight: 700;
    margin-bottom: 14px; color: #f1f5f9;
}

.playlist-picker-list {
    display: flex; flex-direction: column;
    gap: 6px; max-height: 240px; overflow-y: auto;
}

.playlist-picker-item {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px; padding: 10px 14px;
    cursor: pointer; color: #f1f5f9;
    font-size: 0.875rem; font-family: inherit;
    text-align: left; transition: all 0.15s ease; width: 100%;
}

.playlist-picker-item:hover {
    background: rgba(59,130,246,0.12);
    border-color: rgba(59,130,246,0.3);
}

.playlist-picker-new {
    display: block; width: 100%;
    margin-top: 10px; padding: 10px;
    background: transparent;
    border: 1px dashed rgba(255,255,255,0.15);
    border-radius: 10px; color: #94a3b8;
    font-family: inherit; font-size: 0.875rem;
    cursor: pointer; text-align: center;
    transition: all 0.15s ease;
}

.playlist-picker-new:hover {
    border-color: rgba(59,130,246,0.4);
    color: #3B82F6;
}
