/* Advanced Animations & Effects */

/* Gradient animation for backgrounds */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* Floating animation */
@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float-slow {
    animation: floatSlow 6s ease-in-out infinite;
}

/* Rotate animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate-slow {
    animation: rotate 20s linear infinite;
}

/* Bounce in animation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(-50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Slide in from sides */
@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);
    }
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

/* Zoom in animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.6s ease-out;
}

/* Flip animation */
@keyframes flipIn {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0);
        opacity: 1;
    }
}

.flip-in {
    animation: flipIn 0.8s ease-out;
}

/* Text reveal animation */
@keyframes textReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.text-reveal {
    animation: textReveal 1s ease-out;
}

/* Blur in animation */
@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

.blur-in {
    animation: blurIn 0.8s ease-out;
}

/* Neon glow pulse */
@keyframes neonPulse {
    0%, 100% {
        text-shadow: 
            0 0 5px rgba(93, 228, 199, 0.5),
            0 0 10px rgba(93, 228, 199, 0.3),
            0 0 20px rgba(93, 228, 199, 0.2);
    }
    50% {
        text-shadow: 
            0 0 10px rgba(93, 228, 199, 0.8),
            0 0 20px rgba(93, 228, 199, 0.5),
            0 0 40px rgba(93, 228, 199, 0.3);
    }
}

.neon-pulse {
    animation: neonPulse 2s ease-in-out infinite;
}

/* Border animation */
@keyframes borderFlow {
    0% {
        border-image-source: linear-gradient(90deg, 
            var(--primary) 0%, 
            var(--secondary) 25%, 
            var(--accent) 50%, 
            var(--secondary) 75%, 
            var(--primary) 100%);
    }
    100% {
        border-image-source: linear-gradient(90deg, 
            var(--primary) 100%, 
            var(--secondary) 125%, 
            var(--accent) 150%, 
            var(--secondary) 175%, 
            var(--primary) 200%);
    }
}

.border-flow {
    border-image-slice: 1;
    animation: borderFlow 3s linear infinite;
}

/* 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;
}

/* 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;
}

/* Wave animation */
@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(20deg);
    }
    75% {
        transform: rotate(-20deg);
    }
}

.wave {
    animation: wave 2s ease-in-out infinite;
    transform-origin: 70% 70%;
    display: inline-block;
}

/* Scan line effect */
@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

.scanline-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(93, 228, 199, 0.8), 
        transparent);
    animation: scanline 2s linear infinite;
    pointer-events: none;
}

/* Matrix rain effect */
@keyframes matrixRain {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.matrix-rain {
    position: fixed;
    top: 0;
    width: 2px;
    height: 100px;
    background: linear-gradient(180deg, 
        transparent, 
        var(--accent), 
        transparent);
    animation: matrixRain 3s linear infinite;
}

/* Hover lift effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(92, 124, 250, 0.4);
}

/* Hover glow effect */
.hover-glow {
    transition: all 0.3s ease;
    position: relative;
}

.hover-glow::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(120deg, var(--primary), var(--secondary), var(--accent));
    opacity: 0;
    z-index: -1;
    filter: blur(20px);
    transition: opacity 0.3s ease;
}

.hover-glow:hover::after {
    opacity: 0.7;
}

/* Magnetic effect */
.magnetic {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tilt effect */
.tilt-effect {
    transform-style: preserve-3d;
    transition: transform 0.2s ease;
}

/* Loading dots */
@keyframes loadingDots {
    0%, 20% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin: 0 4px;
    animation: loadingDots 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

/* Progress bar animation */
@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

.progress-animate {
    animation: progressFill 2s ease-out forwards;
}

/* Count up animation */
@keyframes countUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.count-up {
    animation: countUp 0.5s ease-out;
}

/* Perspective flip */
@keyframes perspectiveFlip {
    0% {
        transform: perspective(800px) rotateY(0deg);
    }
    100% {
        transform: perspective(800px) rotateY(180deg);
    }
}

.perspective-flip {
    animation: perspectiveFlip 0.6s ease-out;
}

/* Glitch effect */
@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

.glitch {
    animation: glitch 0.3s ease-in-out;
}

/* Utility classes */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }
.duration-slower { animation-duration: 2s; }

.ease-in { animation-timing-function: ease-in; }
.ease-out { animation-timing-function: ease-out; }
.ease-in-out { animation-timing-function: ease-in-out; }
.linear { animation-timing-function: linear; }
