/* =================================================
   GOALAI WEBSITE - ANIMATIONS
   All keyframe animations and animated effects
   ================================================= */

/* =================================================
   1. SCROLL INDICATOR ANIMATION
   ================================================= */
@keyframes scroll {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    50% {
        opacity: 0.5;
        transform: translateY(12px);
    }
    100% {
        opacity: 0;
        transform: translateY(18px);
    }
}

/* =================================================
   2. FLOATING ANIMATION
   ================================================= */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* =================================================
   3. FLOATING PARTICLES (Bottom to Top)
   ================================================= */
@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(100vh) rotate(0deg) scale(0.8);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) rotate(360deg) scale(1.2);
    }
}

.particle {
    position: absolute;
    pointer-events: none;
    animation: float-up 8s linear forwards;
    will-change: transform, opacity;
}

/* =================================================
   4. GLOW PULSE ANIMATION
   ================================================= */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.6),
                    0 0 60px rgba(255, 215, 0, 0.4);
    }
}

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

/* =================================================
   5. NEURAL NETWORK ANIMATION
   ================================================= */
@keyframes neural-flow {
    0% {
        stroke-dashoffset: 100;
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0.3;
    }
}

.neural-svg .connection {
    stroke-dasharray: 100;
    animation: neural-flow 3s ease-in-out infinite;
}

.neural-svg .connection:nth-child(odd) {
    animation-delay: 0.5s;
}

.neural-svg .connection:nth-child(even) {
    animation-delay: 1s;
}

@keyframes node-pulse {
    0%, 100% {
        r: 8;
        opacity: 1;
    }
    50% {
        r: 10;
        opacity: 0.7;
    }
}

.neural-svg .node {
    animation: node-pulse 2s ease-in-out infinite;
}

.neural-svg .node:nth-child(2) {
    animation-delay: 0.3s;
}

.neural-svg .node:nth-child(3) {
    animation-delay: 0.6s;
}

/* =================================================
   6. TOKEN DIAGRAM ROTATION
   ================================================= */
@keyframes rotate-slow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.token-circle.outer {
    animation: rotate-slow 20s linear infinite;
    transform-origin: center;
}

.token-circle.middle {
    animation: rotate-slow 15s linear infinite reverse;
    transform-origin: center;
}

.token-circle.inner {
    animation: rotate-slow 10s linear infinite;
    transform-origin: center;
}

/* =================================================
   7. SHIMMER EFFECT (Gold Shine)
   ================================================= */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 215, 0, 0.3) 50%,
        transparent 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* Apply shimmer to titles */
.hero-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 215, 0, 0.4) 50%,
        transparent 100%
    );
    animation: shimmer-sweep 4s ease-in-out infinite;
}

@keyframes shimmer-sweep {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 200%;
    }
}

/* =================================================
   8. FADE IN ANIMATIONS
   ================================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =================================================
   9. SCALE ANIMATIONS
   ================================================= */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* =================================================
   10. ROTATE ANIMATIONS
   ================================================= */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotate3d {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

/* NFT Card 3D Rotation on Hover */
.nft-card-image {
    perspective: 1000px;
}

.nft-card:hover .nft-card-image img {
    animation: subtle-rotate 0.6s ease-out;
}

@keyframes subtle-rotate {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(10deg);
    }
}

/* =================================================
   11. BOUNCE ANIMATIONS
   ================================================= */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(0);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

/* =================================================
   12. MORPHING TEXT ANIMATION
   ================================================= */
@keyframes text-morph {
    0%, 100% {
        transform: scale(1);
        filter: blur(0px);
    }
    50% {
        transform: scale(1.02);
        filter: blur(2px);
    }
}

.morphing-text {
    animation: text-morph 0.5s ease-in-out;
}

/* =================================================
   13. SPARKLE ANIMATIONS
   ================================================= */
@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.sparkle {
    animation: sparkle 1.5s ease-in-out infinite;
}

/* =================================================
   14. SLIDE ANIMATIONS
   ================================================= */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* =================================================
   15. GRADIENT ANIMATION
   ================================================= */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(
        270deg,
        var(--color-gold-primary),
        var(--color-green-primary),
        var(--color-gold-dark)
    );
    background-size: 400% 400%;
    animation: gradient-shift 5s ease infinite;
}

/* =================================================
   16. LOADING SPINNER
   ================================================= */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: var(--color-gold-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* =================================================
   17. TYPEWRITER EFFECT
   ================================================= */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--color-gold-primary);
    }
}

.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--color-gold-primary);
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s 1 normal both,
               blink-caret 0.75s step-end infinite;
}

/* =================================================
   18. HEARTBEAT ANIMATION
   ================================================= */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(1);
    }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* =================================================
   19. SHAKE ANIMATION
   ================================================= */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* =================================================
   20. NUMBER COUNTER ANIMATION
   ================================================= */
@keyframes count-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.count-up {
    animation: count-up 0.6s ease-out;
}

/* =================================================
   21. RIPPLE EFFECT
   ================================================= */
@keyframes ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7),
                    0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    40% {
        box-shadow: 0 0 0 20px rgba(255, 215, 0, 0),
                    0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    80% {
        box-shadow: 0 0 0 20px rgba(255, 215, 0, 0),
                    0 0 0 40px rgba(255, 215, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0),
                    0 0 0 40px rgba(255, 215, 0, 0);
    }
}

.ripple {
    animation: ripple 2s ease-out infinite;
}

/* =================================================
   22. BACKGROUND PARTICLE MOVEMENT
   ================================================= */
@keyframes particle-float {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(10px, -10px);
    }
    50% {
        transform: translate(-5px, 5px);
    }
    75% {
        transform: translate(-10px, -5px);
    }
}

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

/* =================================================
   23. PERFORMANCE OPTIMIZATIONS
   ================================================= */
/* Use will-change for animations that will definitely occur */
.hero-title,
.morphing-text,
.token-circle,
.neural-svg,
.particle {
    will-change: transform, opacity;
}

/* Remove will-change after animation completes */
.reveal.active {
    will-change: auto;
}

/* =================================================
   24. REDUCED MOTION SUPPORT
   ================================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .particle,
    .sparkle,
    .neural-svg .connection,
    .token-circle {
        animation: none !important;
    }
}
