/* --- Карточка книги --- */
.book-card {
    max-width: 900px;
    background-color: #ffffff;
    border-radius: 20px;
    padding: 2rem;
    margin: 0 auto;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.12);
}

/* --- Анимация появления --- */
.fade-in {
    animation: fadeInUp 0.4s ease forwards;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Обложка книги --- */
.book-cover {
    max-height: 350px;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s ease;
}
.book-cover:hover {
    transform: scale(1.02);
}

/* --- Описание книги --- */
.book-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #333333;
    margin-top: 1rem;
}

/* --- Жанр и возрастной рейтинг --- */
.info-text {
    font-weight: 600;
    color: #333333;
    margin-top: 0.5rem;
}
.age-rating {
    font-weight: 600;
    color: #333333;
    cursor: help;
    border-bottom: 1px dashed #32cd32;
    position: relative;
}
.age-rating:hover {
    color: #28b428;
}

/* Tooltip для возраста */
.age-rating::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: pre-line;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    width: max-content;
    max-width: 220px;
    text-align: left;
    z-index: 100;
}
.age-rating:hover::after {
    opacity: 1;
}

/* --- Кнопка скачать --- */
.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #32cd32;
    color: #fff;
    font-weight: 500;
    padding: 0.55rem 1.7rem;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 180px;
}
.download-btn i {
    margin-right: 0.5rem;
}
.download-btn:hover {
    background-color: #28b428;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

/* --- Кнопка избранного с лайками --- */
.favorite-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background-color: #e6ffe6;
    border: 1px solid #c0ffc0;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    color: #333;
    transition: background 0.2s, transform 0.2s;
}
.favorite-btn:hover {
    background-color: #d4ffd4;
}
.favorite-btn i {
    font-size: 1.2rem;
    color: #32cd32;
}

/* Анимация пульса сердечка */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}
.favorite-btn.likes-bump i {
    animation: pulse 0.3s ease;
}

.likes-number {
    min-width: 20px;
    text-align: center;
    font-weight: 500;
}

/* --- Ссылка на пользователя --- */
.uploader-link {
    font-weight: 600;
    color: #32cd32;
    text-decoration: none;
    transition: all 0.3s ease;
}
.uploader-link:hover {
    text-decoration: underline;
    color: #28b428;
}

/* --- Кнопка редактирования на карточке --- */
.edit-btn-card {
    position: absolute;
    bottom: 15px;
    right: 15px;
    padding: 0.4rem 0.7rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    background-color: #e0dcbf;
    color: #212529;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}
.edit-btn-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    background-color: #d6d0a3;
}

/* --- Адаптивность --- */
@media (max-width: 768px) {
    .book-card {
        padding: 1.5rem;
    }
    .book-cover {
        max-height: 300px;
    }
    .download-btn {
        min-width: 160px;
    }
}
@media (max-width: 576px) {
    .book-card {
        padding: 1rem;
    }
    .book-cover {
        max-height: 250px;
    }
    .download-btn {
        width: 100%;
        justify-content: center;
    }
}
