/* Library Page Styles */

.library-header {
    padding: 40px 40px 20px;
    border-bottom: 1px solid var(--border-color);
}

.library-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.library-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.document-card {
    background-color: var(--bg-sidebar);
    /* Or a slightly lighter card bg */
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Softer border */
    border-radius: 12px;
    padding: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    cursor: pointer;
}

.document-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.document-card .delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    border-radius: 6px;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
}

.document-card:hover .delete-btn {
    opacity: 1;
}

.document-card .delete-btn:hover {
    background: #ef4444;
    color: white;
}

.document-card .delete-btn svg {
    width: 18px;
    height: 18px;
}

/* Thumbnail Styles */
.document-thumbnail {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
    position: relative;
}

.document-thumbnail svg {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.document-thumbnail .thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    /* Force grayscale for thumbnails if desired, or keep as is */
}

.document-thumbnail .file-type-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: var(--bg-dark);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.document-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.document-size {
    display: flex;
    align-items: center;
    gap: 4px;
}

.document-date {
    font-size: 12px;
}

/* Empty State */
.empty-state-library {
    text-align: center;
    padding: 80px 20px;
}

.empty-state-library .empty-icon {
    width: 64px;
    height: 64px;
    color: var(--text-secondary);
    margin: 0 auto 24px;
    opacity: 0.5;
}

.empty-state-library h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-library p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.upload-first-btn {
    padding: 12px 24px;
    background: var(--text-primary);
    border: none;
    border-radius: 8px;
    color: var(--bg-dark);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.upload-first-btn:hover {
    opacity: 0.9;
}

.upload-first-btn svg {
    width: 20px;
    height: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .documents-grid {
        grid-template-columns: 1fr;
    }

    .library-header {
        padding: 24px 20px 16px;
    }

    .library-content {
        padding: 24px 20px;
    }
}

/* Documents Grid Layout */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    padding: 40px;
}

/* Search Bar Styles */
.library-search-bar {
    position: relative;
    max-width: 400px;
    margin-top: 16px;
}

.library-search-bar input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--input-bg);
    border: 1px solid transparent;
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.library-search-bar input:focus {
    outline: none;
    background: var(--bg-hover);
    border-color: var(--border-color);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.library-search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    pointer-events: none;
}