/* =================================================================
   Advanced Animations & Transitions
   ================================================================= */

/* Neon Pulse Animation */
@keyframes neon-pulse {
    0%, 100% {
        text-shadow: 
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 30px currentColor;
    }
    50% {
        text-shadow: 
            0 0 15px currentColor,
            0 0 30px currentColor,
            0 0 45px currentColor,
            0 0 60px currentColor;
    }
}

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

/* Border Glow Animation */
@keyframes border-glow {
    0%, 100% {
        box-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            inset 0 0 5px currentColor;
    }
    50% {
        box-shadow: 
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 30px currentColor,
            inset 0 0 10px currentColor;
    }
}

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

/* Rotate Gradient */
@keyframes rotate-gradient {
    0% {
        filter: hue-rotate(0deg);
    }
    100% {
        filter: hue-rotate(360deg);
    }
}

.rotating-gradient {
    animation: rotate-gradient 10s linear infinite;
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

/* 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-effect {
    animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

/* Breathing Animation */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.breathe {
    animation: breathe 4s ease-in-out infinite;
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.6s ease-out forwards;
}

/* Particle Drift */
@keyframes particle-drift {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(100px, -100px) rotate(360deg);
        opacity: 0;
    }
}

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

/* Flip In */
@keyframes flipIn {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0deg);
        opacity: 1;
    }
}

.flip-in {
    animation: flipIn 0.6s ease-out forwards;
}

/* Light Speed In */
@keyframes lightSpeedIn {
    from {
        transform: translateX(100%) skewX(-30deg);
        opacity: 0;
    }
    60% {
        transform: skewX(20deg);
        opacity: 1;
    }
    80% {
        transform: skewX(-5deg);
    }
    to {
        transform: translateX(0) skewX(0deg);
    }
}

.light-speed-in {
    animation: lightSpeedIn 0.8s ease-out forwards;
}

/* Jello Animation */
@keyframes jello {
    0%, 100% {
        transform: skewX(0deg) skewY(0deg);
    }
    30% {
        transform: skewX(-12.5deg) skewY(-12.5deg);
    }
    40% {
        transform: skewX(6.25deg) skewY(6.25deg);
    }
    50% {
        transform: skewX(-3.125deg) skewY(-3.125deg);
    }
    65% {
        transform: skewX(1.5625deg) skewY(1.5625deg);
    }
    75% {
        transform: skewX(-0.78125deg) skewY(-0.78125deg);
    }
}

.jello:hover {
    animation: jello 0.8s;
}

/* Wobble */
@keyframes wobble {
    0%, 100% {
        transform: translateX(0);
    }
    15% {
        transform: translateX(-25px) rotate(-5deg);
    }
    30% {
        transform: translateX(20px) rotate(3deg);
    }
    45% {
        transform: translateX(-15px) rotate(-3deg);
    }
    60% {
        transform: translateX(10px) rotate(2deg);
    }
    75% {
        transform: translateX(-5px) rotate(-1deg);
    }
}

.wobble:hover {
    animation: wobble 0.8s;
}

/* Tada Animation */
@keyframes tada {
    0% {
        transform: scale(1) rotate(0deg);
    }
    10%, 20% {
        transform: scale(0.9) rotate(-3deg);
    }
    30%, 50%, 70%, 90% {
        transform: scale(1.1) rotate(3deg);
    }
    40%, 60%, 80% {
        transform: scale(1.1) rotate(-3deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.tada:hover {
    animation: tada 0.8s;
}

/* Counter Animation */
@keyframes counter-tick {
    from {
        transform: translateY(10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.counter-animate {
    animation: counter-tick 0.3s ease-out;
}

/* Glow Spread */
@keyframes glow-spread {
    0% {
        box-shadow: 0 0 5px currentColor;
    }
    50% {
        box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
    }
    100% {
        box-shadow: 0 0 5px currentColor;
    }
}

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

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: currentColor;
    transform: translate(-50%, -50%);
    animation: ripple 1s ease-out infinite;
}

/* Delayed Animations (stagger effect) */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* Scroll-triggered animations (added via JS) */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px rgba(0, 255, 255, 0.3);
}

/* Neon Border Animation */
@keyframes neon-border-rotate {
    0% {
        border-image-source: linear-gradient(0deg, var(--neon-cyan), var(--neon-magenta));
    }
    25% {
        border-image-source: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    }
    50% {
        border-image-source: linear-gradient(180deg, var(--neon-cyan), var(--neon-magenta));
    }
    75% {
        border-image-source: linear-gradient(270deg, var(--neon-cyan), var(--neon-magenta));
    }
    100% {
        border-image-source: linear-gradient(360deg, var(--neon-cyan), var(--neon-magenta));
    }
}

.neon-border-animate {
    border: 2px solid;
    border-image-slice: 1;
    animation: neon-border-rotate 4s linear infinite;
}

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

.spinner {
    border: 3px solid rgba(0, 255, 255, 0.1);
    border-top: 3px solid var(--neon-cyan);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--neon-cyan);
    animation: typewriter 3s steps(40) 1s 1 normal both;
}

/* Blink Cursor */
@keyframes blink-caret {
    50% { border-color: transparent; }
}

.typewriter {
    animation: 
        typewriter 3s steps(40) 1s 1 normal both,
        blink-caret 0.75s step-end infinite;
}
