/* Book Maniac - Animations */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes badgeEarn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.books-table tbody tr {
    animation: slideUp 0.3s ease-out;
}

.books-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.books-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.books-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.books-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.books-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.books-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.books-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.books-table tbody tr:nth-child(8) { animation-delay: 0.4s; }
.books-table tbody tr:nth-child(9) { animation-delay: 0.45s; }
.books-table tbody tr:nth-child(10) { animation-delay: 0.5s; }

.modal-overlay.open .modal {
    animation: slideUp 0.3s ease-out;
}

.modal-overlay {
    animation: fadeIn 0.2s ease-out;
}

.notifications-dropdown.open {
    animation: slideDown 0.2s ease-out;
}

.btn:hover {
    transition: background 0.2s, color 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.achievement-item.earned {
    animation: badgeEarn 0.5s ease-out;
}

.badge-count {
    animation: pulse 2s infinite;
}

@media (prefers-reduced-motion: reduce) {
    .books-table tbody tr,
    .modal-overlay.open .modal,
    .notifications-dropdown.open,
    .achievement-item.earned {
        animation: none;
    }
}
