/* Basic Fade Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Page Entrance Animation (for initial load) */
body {
    animation: fadeIn 0.5s ease-out;
}

/* 
   View Transitions API Customization 
   This works when document.startViewTransition is called
*/
::view-transition-old(root) {
    animation: 90ms cubic-bezier(0.4, 0, 1, 1) both fadeOut;
}

::view-transition-new(root) {
    animation: 210ms cubic-bezier(0, 0, 0.2, 1) 90ms both fadeIn;
}

/* Utility to animate elements sequentially */
.animate-enter {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

/* Micro-interactions */
button,
.btn,
.card,
.nav-item {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

button:active,
.btn:active {
    transform: scale(0.95);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ClassMaster Revamp Animations */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(1.05);
    }

    20%,
    40% {
        transform: scale(1);
    }
}

.streak-pulse {
    animation: heartbeat 7s ease-in-out infinite;
}

/* Accessibility: Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {

    .fade-up,
    .streak-pulse,
    body {
        animation: none !important;
        transition: none !important;
    }
}