/* ====== CORE ANIMATIONS ====== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ====== GLOW & PULSE ANIMATIONS ====== */

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.6);
    }
}

@keyframes textGlow {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    }

    50% {
        text-shadow: 0 0 30px rgba(139, 92, 246, 0.8), 0 0 50px rgba(139, 92, 246, 0.5);
    }
}

@keyframes borderGlow {

    0%,
    100% {
        border-color: rgba(139, 92, 246, 0.3);
    }

    50% {
        border-color: rgba(139, 92, 246, 0.8);
    }
}

/* ====== FLOATING ANIMATION ====== */

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes floatSlow {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-5px) rotate(1deg);
    }

    50% {
        transform: translateY(-10px) rotate(0deg);
    }

    75% {
        transform: translateY(-5px) rotate(-1deg);
    }
}

/* ====== ROTATION ====== */

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ====== UTILITY CLASSES ====== */

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-up {
    animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

.scale-up {
    animation: scaleUp 0.4s ease-out forwards;
}

.scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

.text-glow {
    animation: textGlow 3s ease-in-out infinite;
}

.border-glow {
    animation: borderGlow 2s ease-in-out infinite;
}

.float {
    animation: float 3s ease-in-out infinite;
}

.float-slow {
    animation: floatSlow 6s ease-in-out infinite;
}

.rotate {
    animation: rotate 1s linear infinite;
}

.rotate-slow {
    animation: rotateSlow 20s linear infinite;
}

/* ====== STAGGER DELAYS ====== */

.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;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

.delay-800 {
    animation-delay: 800ms;
}

/* ====== STAGGER CHILDREN ====== */

.stagger-children>*:nth-child(1) {
    animation-delay: 0ms;
}

.stagger-children>*:nth-child(2) {
    animation-delay: 80ms;
}

.stagger-children>*:nth-child(3) {
    animation-delay: 160ms;
}

.stagger-children>*:nth-child(4) {
    animation-delay: 240ms;
}

.stagger-children>*:nth-child(5) {
    animation-delay: 320ms;
}

.stagger-children>*:nth-child(6) {
    animation-delay: 400ms;
}

.stagger-children>*:nth-child(7) {
    animation-delay: 480ms;
}

.stagger-children>*:nth-child(8) {
    animation-delay: 560ms;
}

/* ====== HOVER ANIMATIONS ====== */

.hover-float {
    transition: transform 0.3s ease;
}

.hover-float:hover {
    transform: translateY(-5px);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ====== ENTRANCE ANIMATION FOR CARDS ====== */

.card-enter {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Apply staggered animation to grade cards */
.grade-grid .grade-card:nth-child(1) {
    animation-delay: 0ms;
}

.grade-grid .grade-card:nth-child(2) {
    animation-delay: 100ms;
}

.grade-grid .grade-card:nth-child(3) {
    animation-delay: 200ms;
}

.grade-grid .grade-card:nth-child(4) {
    animation-delay: 300ms;
}