/* WORKSPACE */
.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* LOOP LIBRARY (FAR LEFT) */
.loop-library {
    width: 140px; /* Reduced drastically */
    background: #111;
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    z-index: 10;
    height: 100%;
    overflow: hidden; /* Forces child flex scrolling */
    transition: width 0.3s, opacity 0.3s;
}

.loop-library.hidden {
    width: 0;
    opacity: 0;
    border-right: none;
    pointer-events: none;
}

.library-header {
    padding: 10px 8px; /* Increased padding, removed fixed height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    background: var(--bg-dark);
}

.library-header h3 {
    font-size: 0.85rem;
    margin: 0 0 8px 0; /* More spacing below title */
    color: var(--primary);
}

.library-header input {
    width: 100%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    outline: none;
}

.library-content {
    flex: 1 1 auto;
    overflow-y: scroll; /* Force scrollbar to be visible */
    padding: 8px;
    height: 0; /* Forces flexbox to respect constraints */
    min-height: 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
}

.loop-category {
    margin-bottom: 12px;
}

.loop-category-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 4px;
}

.loop-item {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    padding: 4px 6px;
    margin-bottom: 4px;
    cursor: grab;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.loop-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.1);
}

.loop-item.dragging {
    opacity: 0.5;
}

.loop-play-btn {
    background: var(--primary);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 6px;
    font-size: 0.55rem;
    flex-shrink: 0;
}

.loop-play-btn.playing {
    background: var(--accent);
}

.loop-name {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}



