/* ============================================
   ENHANCED ANIMATIONS & EFFECTS
   ============================================ */

/* Page entrance animations */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.page-enter {
    animation: pageEnter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Staggered card animations */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

.lesson-card {
    animation: cardSlideIn 0.6s ease-out backwards;
}

/* Floating particles background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(0, 212, 170, 0.3);
    border-radius: 50%;
    animation: float-particle 20s linear infinite;
}

@keyframes float-particle {
    from {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    to {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced button ripple effect */
.ripple-button {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Subtle hero title highlight (replaces heavy glow) */
.glow-text {
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    animation: hero-fade-in 0.8s ease-out both;
}

@keyframes hero-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress bar fill animation */
@keyframes progressFill {
    from {
        width: 0%;
        background-position: -200% 0;
    }
    to {
        background-position: 200% 0;
    }
}

/* Morphing shapes */
.morphing-shape {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
    0% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    50% {
        border-radius: 50% 60% 30% 60% / 60% 40% 60% 40%;
    }
    75% {
        border-radius: 60% 40% 60% 40% / 30% 60% 40% 70%;
    }
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
}

/* Typing cursor effect */
.typing::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Enhanced hover states */
.enhanced-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.enhanced-hover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.enhanced-hover:hover::before {
    transform: translateX(100%);
}

/* Accordion expand animation */
@keyframes accordionExpand {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 1000px;
        opacity: 1;
    }
}

.accordion-content {
    animation: accordionExpand 0.3s ease-out;
    overflow: hidden;
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 212, 170, 0.1);
    border-left: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success checkmark animation */
.checkmark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: var(--success);
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px var(--success);
    animation: fill 0.4s ease-in-out 0.4s forwards, scale 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: var(--success);
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px var(--success);
    }
}

/* Parallax scrolling effect */
.parallax {
    transform: translateZ(0);
    transition: transform 0.1s;
}

/* Smooth reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Interactive card tilt */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease-out;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Color transition animations */
.color-shift {
    animation: colorShift 5s ease-in-out infinite;
}

@keyframes colorShift {
    0% { filter: hue-rotate(0deg); }
    25% { filter: hue-rotate(90deg); }
    50% { filter: hue-rotate(180deg); }
    75% { filter: hue-rotate(270deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Text reveal animation */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    animation: slideUp 0.6s ease-out backwards;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Glassmorphism container */
.glass-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Neon glow effect */
.neon-glow {
    box-shadow: 0 0 5px var(--accent),
                0 0 10px var(--accent),
                0 0 15px var(--accent),
                0 0 20px var(--accent);
    animation: neonPulse 2s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    from {
        box-shadow: 0 0 5px var(--accent),
                    0 0 10px var(--accent),
                    0 0 15px var(--accent),
                    0 0 20px var(--accent);
    }
    to {
        box-shadow: 0 0 10px var(--accent),
                    0 0 20px var(--accent),
                    0 0 30px var(--accent),
                    0 0 40px var(--accent);
    }
}
