/* --- LIBRARY MODAL --- */
.library-modal {
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.library-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.library-modal .close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.library-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 1rem;
}

/* Library Sidebar (Folders) */
.library-sidebar {
    width: 250px;
    border-right: 1px solid var(--border);
    padding-right: 1rem;
    display: flex;
    flex-direction: column;
}

.library-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.library-actions input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.small-btn {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
}

.folder-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}

.folder-list li {
    padding: 0.8rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.folder-list li:hover {
    background: var(--bg-light);
}

.folder-list li.active {
    background: var(--primary);
    color: var(--white);
}

/* Library Content (Files) */
.library-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.library-content h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.file-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    background: var(--bg-light);
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.file-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.file-item i {
    font-size: 2rem;
    color: #ef4444;
    /* PDF color */
    margin-bottom: 0.5rem;
}

.file-item .filename {
    font-size: 0.9rem;
    font-weight: 500;
    word-break: break-word;
    display: block;
    margin-bottom: 0.3rem;
}

.file-item .date {
    font-size: 0.75rem;
    color: var(--text-muted);
}/* ... */

.folder-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--primary);
    color: var(--white);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.9;
    z-index: 2;
}

.file-item {
    /* Need relative positioning for the badge */
    position: relative;
}

/* Specific styling for the folder view when displaying the folder badge */
.folder-badge i {
    font-size: 0.65rem;
    color: var(--white);
    margin-right: 2px;
    margin-bottom: 0;
}
