/* Advanced Animation Effects CSS */
/* 3D Transformations and Perspective Effects */

/* 3D Card Flip Effects */
@keyframes flip3D {
    0% { transform: perspective(1000px) rotateY(0deg); }
    50% { transform: perspective(1000px) rotateY(-90deg); }
    100% { transform: perspective(1000px) rotateY(0deg); }
}

@keyframes flipX3D {
    0% { transform: perspective(1000px) rotateX(0deg); }
    50% { transform: perspective(1000px) rotateX(-90deg); }
    100% { transform: perspective(1000px) rotateX(0deg); }
}

@keyframes cube3D {
    0% { transform: perspective(1000px) rotateX(0deg) rotateY(0deg); }
    25% { transform: perspective(1000px) rotateX(90deg) rotateY(0deg); }
    50% { transform: perspective(1000px) rotateX(90deg) rotateY(90deg); }
    75% { transform: perspective(1000px) rotateX(0deg) rotateY(90deg); }
    100% { transform: perspective(1000px) rotateX(0deg) rotateY(0deg); }
}

/* Matrix and Digital Effects */
@keyframes matrix {
    0% { 
        transform: translateY(-100vh) scaleY(0);
        opacity: 0;
    }
    10% {
        transform: translateY(-50vh) scaleY(0.5);
        opacity: 0.3;
    }
    50% {
        transform: translateY(0) scaleY(1);
        opacity: 1;
    }
    90% {
        transform: translateY(50vh) scaleY(0.5);
        opacity: 0.3;
    }
    100% {
        transform: translateY(100vh) scaleY(0);
        opacity: 0;
    }
}

@keyframes glitch {
    0%, 100% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    10% {
        transform: translate(-2px, 2px);
        filter: hue-rotate(90deg);
    }
    20% {
        transform: translate(-4px, -2px);
        filter: hue-rotate(180deg);
    }
    30% {
        transform: translate(4px, 2px);
        filter: hue-rotate(270deg);
    }
    40% {
        transform: translate(-2px, -4px);
        filter: hue-rotate(360deg);
    }
    50% {
        transform: translate(2px, 4px);
        filter: hue-rotate(45deg);
    }
    60% {
        transform: translate(-4px, 2px);
        filter: hue-rotate(135deg);
    }
    70% {
        transform: translate(4px, -2px);
        filter: hue-rotate(225deg);
    }
    80% {
        transform: translate(-2px, 4px);
        filter: hue-rotate(315deg);
    }
    90% {
        transform: translate(2px, -4px);
        filter: hue-rotate(405deg);
    }
}

/* Liquid and Fluid Effects */
@keyframes liquidWave {
    0%, 100% {
        border-radius: 50% 50% 50% 50%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 60% 40% 60% 40%;
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        border-radius: 40% 60% 40% 60%;
        transform: rotate(180deg) scale(0.9);
    }
    75% {
        border-radius: 70% 30% 70% 30%;
        transform: rotate(270deg) scale(1.05);
    }
}

@keyframes liquidBlob {
    0% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        border-radius: 58% 42% 75% 25% / 76% 24% 76% 24%;
        transform: translate(10px, -5px) rotate(90deg);
    }
    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
        transform: translate(-8px, 8px) rotate(180deg);
    }
    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
        transform: translate(-5px, -10px) rotate(270deg);
    }
    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: translate(0, 0) rotate(360deg);
    }
}

/* Neon and Cyberpunk Effects */
@keyframes neonFlicker {
    0%, 100% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor,
            0 0 20px #ff00ff,
            0 0 35px #ff00ff,
            0 0 40px #ff00ff;
        opacity: 1;
    }
    2% {
        text-shadow: none;
        opacity: 0.8;
    }
    8% {
        text-shadow: none;
        opacity: 0.8;
    }
    9% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor,
            0 0 20px #ff00ff,
            0 0 35px #ff00ff,
            0 0 40px #ff00ff;
        opacity: 1;
    }
    12% {
        text-shadow: none;
        opacity: 0.8;
    }
    22% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor,
            0 0 20px #ff00ff,
            0 0 35px #ff00ff,
            0 0 40px #ff00ff;
        opacity: 1;
    }
}

@keyframes cyberpunkGlow {
    0%, 100% {
        box-shadow: 
            0 0 5px #00ffff,
            0 0 10px #00ffff,
            0 0 15px #00ffff,
            0 0 20px #00ffff,
            inset 0 0 5px #00ffff;
        border-color: #00ffff;
    }
    50% {
        box-shadow: 
            0 0 10px #ff00ff,
            0 0 20px #ff00ff,
            0 0 30px #ff00ff,
            0 0 40px #ff00ff,
            inset 0 0 10px #ff00ff;
        border-color: #ff00ff;
    }
}

/* Holographic Effects */
@keyframes hologram {
    0%, 100% {
        opacity: 0.8;
        transform: translateZ(0) rotateY(0deg);
        filter: hue-rotate(0deg) brightness(1);
    }
    25% {
        opacity: 0.6;
        transform: translateZ(10px) rotateY(5deg);
        filter: hue-rotate(90deg) brightness(1.2);
    }
    50% {
        opacity: 0.9;
        transform: translateZ(0) rotateY(0deg);
        filter: hue-rotate(180deg) brightness(0.8);
    }
    75% {
        opacity: 0.7;
        transform: translateZ(-10px) rotateY(-5deg);
        filter: hue-rotate(270deg) brightness(1.1);
    }
}

@keyframes holographicShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Physics-Based Animations */
@keyframes elasticBounce {
    0% {
        transform: scale(1) translateY(0);
    }
    10% {
        transform: scale(1.1, 0.9) translateY(0);
    }
    30% {
        transform: scale(0.9, 1.1) translateY(-50px);
    }
    50% {
        transform: scale(1.05, 0.95) translateY(0);
    }
    57% {
        transform: scale(1, 1) translateY(-7px);
    }
    64% {
        transform: scale(1, 1) translateY(0);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

@keyframes pendulum {
    0%, 100% {
        transform: rotate(0deg);
        transform-origin: top center;
    }
    25% {
        transform: rotate(15deg);
        transform-origin: top center;
    }
    75% {
        transform: rotate(-15deg);
        transform-origin: top center;
    }
}

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

@keyframes sparkle {
    0%, 100% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }
}

/* Utility Classes */
.effect-3d-flip {
    animation: flip3D 2s ease-in-out infinite;
    transform-style: preserve-3d;
}

.effect-3d-cube {
    animation: cube3D 4s linear infinite;
    transform-style: preserve-3d;
}

.effect-matrix {
    animation: matrix 3s linear infinite;
    font-family: 'Courier New', monospace;
    color: #00ff00;
    background: #000;
}

.effect-glitch {
    animation: glitch 0.3s infinite;
    position: relative;
}

.effect-glitch::before,
.effect-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.effect-glitch::before {
    animation: glitch 0.3s infinite;
    color: #ff0000;
    z-index: -1;
}

.effect-glitch::after {
    animation: glitch 0.3s infinite reverse;
    color: #00ffff;
    z-index: -2;
}

.effect-liquid-wave {
    animation: liquidWave 4s ease-in-out infinite;
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.effect-liquid-blob {
    animation: liquidBlob 8s ease-in-out infinite;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
}

.effect-neon-flicker {
    animation: neonFlicker 2s infinite;
    color: #fff;
    font-weight: bold;
}

.effect-cyberpunk-glow {
    animation: cyberpunkGlow 2s ease-in-out infinite alternate;
    border: 2px solid;
    background: rgba(0, 0, 0, 0.8);
}

.effect-hologram {
    animation: hologram 3s ease-in-out infinite;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 200% 100%;
    position: relative;
}

.effect-hologram::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: holographicShimmer 2s linear infinite;
}

.effect-elastic-bounce {
    animation: elasticBounce 2s ease-out;
}

.effect-pendulum {
    animation: pendulum 2s ease-in-out infinite;
}

.effect-particle-float {
    animation: particleFloat 10s linear infinite;
}

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

/* Advanced Hover Effects */
.hover-3d-lift:hover {
    transform: perspective(1000px) rotateX(10deg) translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.hover-liquid:hover {
    animation: liquidBlob 2s ease-in-out;
}

.hover-glitch:hover {
    animation: glitch 0.3s;
}

.hover-neon:hover {
    animation: neonFlicker 1s;
}

/* Responsive Adjustments */
@media (prefers-reduced-motion: reduce) {
    .effect-3d-flip,
    .effect-3d-cube,
    .effect-matrix,
    .effect-glitch,
    .effect-liquid-wave,
    .effect-liquid-blob,
    .effect-neon-flicker,
    .effect-cyberpunk-glow,
    .effect-hologram,
    .effect-elastic-bounce,
    .effect-pendulum,
    .effect-particle-float,
    .effect-sparkle {
        animation: none;
    }
}

@media (max-width: 768px) {
    .effect-3d-flip,
    .effect-3d-cube {
        animation-duration: 3s;
    }
    
    .effect-glitch {
        animation-duration: 0.5s;
    }
}