/* ============================================ */
/* СТИЛІ ДЛЯ БІБЛІОТЕКИ (СПИСОК КНИГ)           */
/* ============================================ */

/* Контейнер бібліотеки */
.library-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 20px 40px 20px;
}

/* Заголовок */
.library-container h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.library-container .subtitle {
    font-size: 16px;
    color: var(--text-secondary, #64748b);
    margin: 0 0 30px 0;
    line-height: 1.5;
}

/* ============================================ */
/* СПИСОК КНИГ                                  */
/* ============================================ */

.book-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.book-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    gap: 12px;
}

.book-item:hover {
    background-color: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
}

.book-item .book-link {
    flex: 1;
    text-decoration: none;
    color: var(--text-primary, #1e293b);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.book-item .book-title {
    font-weight: 500;
    font-size: 16px;
    line-height: 1.4;
    color: var(--text-primary, #1e293b);
    transition: color 0.2s ease;
    word-break: break-word;
}

.book-item .book-link:hover .book-title {
    color: var(--accent-primary, #3b82f6);
}

.book-item .book-author {
    font-size: 14px;
    color: var(--text-secondary, #64748b);
    line-height: 1.4;
}

.book-item .book-arrow {
    flex-shrink: 0;
    color: var(--text-tertiary, #94a3b8);
    display: flex;
    align-items: center;
}

.book-item .book-arrow .material-symbols-outlined {
    font-size: 24px;
}

/* ============================================ */
/* СТАН ЗАВАНТАЖЕННЯ                            */
/* ============================================ */

.library-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #64748b);
}

.library-loading .material-symbols-outlined {
    font-size: 40px;
    display: block;
    margin: 0 auto 16px auto;
    animation: spin 1s linear infinite;
    color: var(--accent-primary, #3b82f6);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================ */
/* ПОРОЖНІЙ СТАН                                */
/* ============================================ */

.library-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #64748b);
}

.library-empty .material-symbols-outlined {
    font-size: 48px;
    display: block;
    margin: 0 auto 16px auto;
    color: var(--text-tertiary, #94a3b8);
}

/* ============================================ */
/* СТАН ПОМИЛКИ                                 */
/* ============================================ */

.library-error {
    text-align: center;
    padding: 40px 20px;
    color: #ef4444;
}

.library-error .material-symbols-outlined {
    font-size: 32px;
    display: block;
    margin: 0 auto 12px auto;
}

/* ============================================ */
/* АДАПТАЦІЯ ДЛЯ МОБІЛЬНИХ                     */
/* ============================================ */

@media (max-width: 768px) {
    .library-container {
        padding: 12px 12px 30px 12px;
    }
    
    .library-container h1 {
        font-size: 22px;
        gap: 8px;
    }
    
    .library-container .subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .book-item {
        padding: 12px 12px;
        gap: 8px;
    }
    
    .book-item .book-title {
        font-size: 15px;
    }
    
    .book-item .book-author {
        font-size: 13px;
    }
    
    .book-item .book-arrow .material-symbols-outlined {
        font-size: 20px;
    }
}

/* Маленькі телефони */
@media (max-width: 480px) {
    .library-container {
        padding: 8px 8px 20px 8px;
    }
    
    .library-container h1 {
        font-size: 20px;
    }
    
    .book-item {
        padding: 10px 10px;
    }
    
    .book-item .book-title {
        font-size: 14px;
    }
    
    .book-item .book-author {
        font-size: 12px;
    }
}