/* Advanced Animations for NEURO UPLINK 5.0 */

/* Floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.float {
    animation: float 6s ease-in-out infinite;
}

.float-fast {
    animation: float 3s ease-in-out infinite;
}

/* Pulse glow */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--accent-cyan, #00F0FF);
    }
    50% {
        box-shadow: 0 0 40px var(--accent-cyan, #00F0FF);
    }
}

.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Gradient shift */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

/* Particle animation */
@keyframes particle-float {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-cyan, #00F0FF);
    border-radius: 50%;
    pointer-events: none;
    animation: particle-float 8s linear infinite;
}

/* Text reveal animation */
@keyframes text-reveal {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

.text-reveal {
    animation: text-reveal 1.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

/* Card hover effects */
.card-3d {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
}

/* Button ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.ripple:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(40, 40);
        opacity: 0;
    }
}

/* Typewriter effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--accent-cyan, #00F0FF);
    animation: typewriter 3.5s steps(40, end),
               blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--accent-cyan, #00F0FF);
    }
}

/* Scroll indicator */
@keyframes scroll-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

.scroll-indicator {
    animation: scroll-bounce 2s ease-in-out infinite;
}

/* Loading spinner */
@keyframes spin-3d {
    0% {
        transform: rotateY(0deg) rotateX(0deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(360deg);
    }
}

.spinner-3d {
    animation: spin-3d 2s linear infinite;
}

/* Background grid animation */
@keyframes grid-move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

.grid-bg {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}

/* Parallax effect */
.parallax {
    transform-style: preserve-3d;
}

.parallax-layer {
    position: absolute;
    will-change: transform;
}

/* Morphing shape */
@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morph {
    animation: morph 8s ease-in-out infinite;
}

/* Neon flicker */
@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 10px currentColor);
    }
    20%, 24%, 55% {
        opacity: 0.8;
        filter: drop-shadow(0 0 5px currentColor);
    }
}

.neon {
    animation: neon-flicker 3s infinite;
}

/* Staggered children animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fade-in-up 0.6s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive animation adjustments */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}