.lib-list-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: transparent;
}

.lib-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.theme-unicorn .lib-list-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.lib-list-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.theme-unicorn .lib-list-title {
    color: rgba(255, 255, 255, 0.6);
}

.create-lib-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--accent);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(35, 131, 226, 0.3);
}

.create-lib-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(35, 131, 226, 0.4);
}

.lib-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

.lib-item {
    margin-bottom: 8px;
}

.lib-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 3px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    background: rgba(0, 0, 0, 0.03);
}

.lib-header:hover {
    background: rgba(0, 0, 0, 0.06);
}

.lib-header.expanded {
    background: rgba(35, 131, 226, 0.1);
}

.theme-unicorn .lib-header {
    background: rgba(255, 255, 255, 0.05);
}

.theme-unicorn .lib-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-unicorn .lib-header.expanded {
    background: rgba(255, 255, 255, 0.15);
}

.lib-expand-icon {
    font-size: 0.65rem;
    color: var(--text-secondary);
    width: 14px;
    transition: transform 0.2s;
}

.theme-unicorn .lib-expand-icon {
    color: rgba(255, 255, 255, 0.6);
}

.lib-icon {
    font-size: 0.9rem;
}

.lib-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-unicorn .lib-name {
    color: white;
}

.lib-actions {
    display: none;
    gap: 4px;
}

.lib-header:hover .lib-actions {
    display: flex;
}

.lib-action-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.lib-action-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--accent);
}

.theme-unicorn .lib-action-btn {
    color: rgba(255, 255, 255, 0.6);
}

.theme-unicorn .lib-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.lib-documents {
    padding-left: 24px;
    margin-top: 6px;
    margin-bottom: 4px;
}

.no-docs-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 8px 14px;
    font-style: italic;
}

.theme-unicorn .no-docs-message {
    color: rgba(255, 255, 255, 0.5);
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    margin-bottom: 2px;
}

.doc-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.doc-item.active {
    background: rgba(35, 131, 226, 0.12);
}

.theme-unicorn .doc-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.theme-unicorn .doc-item.active {
    background: rgba(255, 255, 255, 0.15);
}

.doc-item .doc-icon {
    font-size: 0.9rem;
}

.doc-item .doc-title {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-unicorn .doc-item .doc-title {
    color: rgba(255, 255, 255, 0.9);
}

.doc-item .delete-doc-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    transition: all 0.15s;
}

.doc-item:hover .delete-doc-btn {
    display: block;
}

.doc-item .delete-doc-btn:hover {
    color: #f87171;
}

/* Drag and drop styles */
.doc-item[draggable="true"] {
    cursor: grab;
}

.doc-item[draggable="true"]:active {
    cursor: grabbing;
}

.lib-header.drag-over {
    background: rgba(35, 131, 226, 0.2);
    border: 2px dashed var(--accent);
}

.theme-unicorn .lib-header.drag-over {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

/* Disabled state styles - when WebSocket is disconnected */
.create-lib-btn.disabled,
.create-lib-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.create-lib-btn.disabled:hover,
.create-lib-btn:disabled:hover {
    transform: none;
    background: var(--accent);
    box-shadow: 0 2px 6px rgba(35, 131, 226, 0.3);
}

.lib-action-btn.disabled,
.lib-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.lib-action-btn.disabled:hover,
.lib-action-btn:disabled:hover {
    background: transparent;
    color: var(--text-secondary);
}

.delete-doc-btn.disabled,
.delete-doc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    display: none !important;
}

.doc-item:hover .delete-doc-btn.disabled,
.doc-item:hover .delete-doc-btn:disabled {
    display: none !important;
}

/* Disable drag when offline */
.doc-item[draggable="false"] {
    cursor: default;
}

.theme-unicorn .create-lib-btn.disabled,
.theme-unicorn .create-lib-btn:disabled,
.theme-unicorn .lib-action-btn.disabled,
.theme-unicorn .lib-action-btn:disabled,
.theme-unicorn .delete-doc-btn.disabled,
.theme-unicorn .delete-doc-btn:disabled {
    opacity: 0.4;
}