/* ============================================
   COLLECTION SIDEBAR HEADER
   Shows when viewing songs inside a collection
   ============================================ */

.collection-sidebar-header {
    /* Stick to the top of the song-list scroll container */
    position: sticky;
    top: -8px;           /* offset the 8px padding on .song-list so it seals flush */
    z-index: 2;

    /* Bleed edge-to-edge, compensating for song-list's 8px side padding */
    margin: -8px -8px 0 -8px;
    padding: 10px 12px;

    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--border) 25%, transparent);
}

/* Actions row — back+title group left, plus button right */
.collection-sidebar-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Groups the back arrow and collection title together on the left */
.collection-back-group {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

/* Collection name shown next to the back arrow */
.collection-header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Back button — left side (just the arrow icon) */
.collection-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.collection-back-btn i {
    font-size: 13px;
}

.collection-back-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.collection-back-btn:active {
    background: var(--border-light);
}

/* Add Songs button — solid accent, matches the main + button in the search header */
.collection-add-song-btn {
    height: 28px;
    padding: 0 10px;
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.collection-add-song-btn i {
    font-size: 10px;
}

.collection-add-song-btn:hover {
    background: var(--accent-dark);
}

.collection-add-song-btn:active {
    opacity: 0.85;
}

/* "New Collection" button in the list header — keeps the subtle tinted style */
.new-collection-inline-btn {
    height: 26px;
    padding: 0 10px;
    border: none;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.new-collection-inline-btn i {
    font-size: 10px;
}

.new-collection-inline-btn:hover {
    background: color-mix(in srgb, var(--accent) 24%, transparent);
}

.new-collection-inline-btn:active {
    background: color-mix(in srgb, var(--accent) 32%, transparent);
}

/* Mobile: .song-list has padding-top: 4px (not 8px), so correct the sticky offset */
@media (max-width: 550px) {
    .collection-sidebar-header {
        top: -4px;
        margin-top: -4px;
    }
}
