/* 🚀 ULTRA MODERN ANIMATIONS - Next Level Design */

/* ============================================
   ADVANCED GRADIENT ANIMATIONS
   ============================================ */

/* Holographic Gradient Shift */
@keyframes holographicShift {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg) brightness(1);
    }
    25% {
        background-position: 100% 50%;
        filter: hue-rotate(90deg) brightness(1.1);
    }
    50% {
        background-position: 100% 100%;
        filter: hue-rotate(180deg) brightness(1.2);
    }
    75% {
        background-position: 0% 100%;
        filter: hue-rotate(270deg) brightness(1.1);
    }
    100% {
        background-position: 0% 50%;
        filter: hue-rotate(360deg) brightness(1);
    }
}

/* Liquid Metal Effect */
@keyframes liquidMetal {
    0%, 100% {
        background-position: 0% 50%, 100% 50%, 50% 0%, 50% 100%;
        transform: scale(1) rotate(0deg);
    }
    25% {
        background-position: 50% 0%, 50% 100%, 100% 50%, 0% 50%;
        transform: scale(1.02) rotate(5deg);
    }
    50% {
        background-position: 100% 50%, 0% 50%, 50% 100%, 50% 0%;
        transform: scale(1.05) rotate(0deg);
    }
    75% {
        background-position: 50% 100%, 50% 0%, 0% 50%, 100% 50%;
        transform: scale(1.02) rotate(-5deg);
    }
}

/* Plasma Wave Animation */
@keyframes plasmaWave {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
        opacity: 0.8;
    }
    33% {
        background-position: 100% 0%, 0% 100%, 75% 25%;
        opacity: 1;
    }
    66% {
        background-position: 0% 100%, 100% 0%, 25% 75%;
        opacity: 0.9;
    }
}

/* ============================================
   3D TRANSFORM ANIMATIONS
   ============================================ */

/* Floating 3D Card */
@keyframes float3D {
    0%, 100% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg) scale(1);
        box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
    }
    25% {
        transform: translateY(-20px) rotateX(5deg) rotateY(5deg) scale(1.02);
        box-shadow: 0 20px 60px rgba(139, 92, 246, 0.4);
    }
    50% {
        transform: translateY(-30px) rotateX(0deg) rotateY(10deg) scale(1.05);
        box-shadow: 0 30px 80px rgba(236, 72, 153, 0.5);
    }
    75% {
        transform: translateY(-20px) rotateX(-5deg) rotateY(5deg) scale(1.02);
        box-shadow: 0 20px 60px rgba(16, 185, 129, 0.4);
    }
}

/* Magnetic Hover Effect */
@keyframes magneticPull {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(var(--mouse-x, 0), var(--mouse-y, 0)) scale(1.1);
    }
}

/* Perspective Flip */
@keyframes perspectiveFlip {
    0% {
        transform: perspective(1000px) rotateY(0deg);
    }
    50% {
        transform: perspective(1000px) rotateY(180deg);
    }
    100% {
        transform: perspective(1000px) rotateY(360deg);
    }
}

/* ============================================
   PARTICLE & GLOW EFFECTS
   ============================================ */

/* Cosmic Particles */
@keyframes cosmicFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(50px, -50px) scale(1.5);
        opacity: 0.7;
    }
    50% {
        transform: translate(100px, 0) scale(1);
        opacity: 0.5;
    }
    75% {
        transform: translate(50px, 50px) scale(1.3);
        opacity: 0.8;
    }
}

/* Aurora Glow */
@keyframes auroraGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(99, 102, 241, 0.5),
            0 0 40px rgba(139, 92, 246, 0.3),
            0 0 60px rgba(236, 72, 153, 0.2),
            inset 0 0 20px rgba(99, 102, 241, 0.1);
        filter: brightness(1) saturate(1);
    }
    33% {
        box-shadow: 
            0 0 30px rgba(139, 92, 246, 0.6),
            0 0 50px rgba(236, 72, 153, 0.4),
            0 0 70px rgba(16, 185, 129, 0.3),
            inset 0 0 30px rgba(139, 92, 246, 0.2);
        filter: brightness(1.2) saturate(1.3);
    }
    66% {
        box-shadow: 
            0 0 25px rgba(236, 72, 153, 0.5),
            0 0 45px rgba(16, 185, 129, 0.3),
            0 0 65px rgba(99, 102, 241, 0.2),
            inset 0 0 25px rgba(236, 72, 153, 0.1);
        filter: brightness(1.1) saturate(1.2);
    }
}

/* Neon Pulse */
@keyframes neonPulse {
    0%, 100% {
        text-shadow: 
            0 0 5px rgba(99, 102, 241, 0.8),
            0 0 10px rgba(99, 102, 241, 0.6),
            0 0 15px rgba(99, 102, 241, 0.4),
            0 0 20px rgba(99, 102, 241, 0.2);
        filter: brightness(1);
    }
    50% {
        text-shadow: 
            0 0 10px rgba(139, 92, 246, 1),
            0 0 20px rgba(139, 92, 246, 0.8),
            0 0 30px rgba(139, 92, 246, 0.6),
            0 0 40px rgba(139, 92, 246, 0.4),
            0 0 50px rgba(236, 72, 153, 0.2);
        filter: brightness(1.3);
    }
}

/* ============================================
   MORPHING & BLOB ANIMATIONS
   ============================================ */

/* Advanced Blob Morph */
@keyframes advancedMorph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate(0, 0) rotate(0deg) scale(1);
        filter: blur(40px) hue-rotate(0deg);
    }
    20% {
        border-radius: 40% 60% 50% 50% / 40% 50% 50% 60%;
        transform: translate(30px, -30px) rotate(72deg) scale(1.1);
        filter: blur(45px) hue-rotate(72deg);
    }
    40% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: translate(0, 0) rotate(144deg) scale(0.9);
        filter: blur(50px) hue-rotate(144deg);
    }
    60% {
        border-radius: 50% 50% 40% 60% / 60% 40% 60% 40%;
        transform: translate(-30px, 30px) rotate(216deg) scale(1.05);
        filter: blur(42px) hue-rotate(216deg);
    }
    80% {
        border-radius: 70% 30% 50% 50% / 30% 70% 50% 50%;
        transform: translate(0, 0) rotate(288deg) scale(1);
        filter: blur(48px) hue-rotate(288deg);
    }
}

/* Liquid Shape Shift */
@keyframes liquidShift {
    0%, 100% {
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
    }
    25% {
        clip-path: polygon(0% 10%, 90% 0%, 100% 90%, 10% 100%);
    }
    50% {
        clip-path: polygon(10% 0%, 100% 10%, 90% 100%, 0% 90%);
    }
    75% {
        clip-path: polygon(0% 20%, 80% 0%, 100% 80%, 20% 100%);
    }
}

/* ============================================
   ADVANCED TEXT EFFECTS
   ============================================ */

/* Glitch Text */
@keyframes glitch {
    0%, 100% {
        transform: translate(0);
        opacity: 1;
    }
    20% {
        transform: translate(-2px, 2px);
        opacity: 0.8;
    }
    40% {
        transform: translate(2px, -2px);
        opacity: 0.9;
    }
    60% {
        transform: translate(-2px, -2px);
        opacity: 0.7;
    }
    80% {
        transform: translate(2px, 2px);
        opacity: 0.9;
    }
}

/* Rainbow Text Flow */
@keyframes rainbowFlow {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    50% {
        background-position: 100% 50%;
        filter: hue-rotate(180deg);
    }
    100% {
        background-position: 0% 50%;
        filter: hue-rotate(360deg);
    }
}

/* Typewriter with Cursor */
@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes cursorBlink {
    0%, 49% { border-color: var(--accent); opacity: 1; }
    50%, 100% { border-color: transparent; opacity: 0; }
}

/* ============================================
   INTERACTIVE HOVER EFFECTS
   ============================================ */

/* Magnetic Button */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

.magnetic-btn:hover {
    transform: scale(1.1) translateZ(20px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

/* Ripple Wave Effect */
@keyframes rippleWave {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Shimmer Sweep */
@keyframes shimmerSweep {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        transform: translateX(200%) skewX(-15deg);
    }
}

/* ============================================
   LOADING & PROGRESS ANIMATIONS
   ============================================ */

/* Orbital Loader */
@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(50px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(50px) rotate(-360deg);
    }
}

/* Pulse Ring */
@keyframes pulseRing {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Progress Wave */
@keyframes progressWave {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Holographic Text */
.holographic-text {
    background: linear-gradient(
        135deg,
        #667eea 0%,
        #764ba2 25%,
        #f093fb 50%,
        #4facfe 75%,
        #00f2fe 100%
    );
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: holographicShift 8s ease-in-out infinite;
    font-weight: 800;
}

/* Liquid Metal Card */
.liquid-metal {
    background: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(139, 92, 246, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(236, 72, 153, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.4) 0%, transparent 50%);
    background-size: 300% 300%;
    animation: liquidMetal 15s ease-in-out infinite;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Plasma Background */
.plasma-bg {
    background:
        radial-gradient(ellipse at 20% 30%, rgba(99, 102, 241, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.3) 0%, transparent 50%);
    background-size: 200% 200%;
    animation: plasmaWave 20s ease-in-out infinite;
}

/* Floating 3D Element */
.float-3d {
    animation: float3D 6s ease-in-out infinite;
    transform-style: preserve-3d;
    will-change: transform;
}

/* Aurora Glow Effect */
.aurora-glow {
    animation: auroraGlow 8s ease-in-out infinite;
    will-change: box-shadow, filter;
}

/* Neon Text */
.neon-text-advanced {
    animation: neonPulse 3s ease-in-out infinite;
    color: #fff;
    font-weight: 700;
}

/* Advanced Blob */
.blob-advanced {
    position: absolute;
    width: 400px;
    height: 400px;
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.4),
        rgba(139, 92, 246, 0.3),
        rgba(236, 72, 153, 0.2)
    );
    animation: advancedMorph 20s ease-in-out infinite;
    will-change: transform, border-radius, filter;
}

/* Glitch Effect */
.glitch-text {
    position: relative;
    animation: glitch 3s infinite;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 #ff00de;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch 2s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch 2.5s infinite linear alternate-reverse;
}

/* Rainbow Text */
.rainbow-text {
    background: linear-gradient(
        90deg,
        #ff0000 0%,
        #ff7f00 16.67%,
        #ffff00 33.33%,
        #00ff00 50%,
        #0000ff 66.67%,
        #8b00ff 83.33%,
        #ff0000 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbowFlow 6s linear infinite;
}

/* Shimmer Overlay */
.shimmer-overlay {
    position: relative;
    overflow: hidden;
}

.shimmer-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmerSweep 3s infinite;
}

/* Orbital Loader */
.orbital-loader {
    position: relative;
    width: 100px;
    height: 100px;
}

.orbital-loader::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    animation: orbit 2s linear infinite;
}

/* Pulse Ring Effect */
.pulse-ring {
    position: relative;
}

.pulse-ring::before,
.pulse-ring::after {
    content: '';
    position: absolute;
    inset: -10px;
    border: 2px solid rgba(99, 102, 241, 0.5);
    border-radius: inherit;
    animation: pulseRing 2s ease-out infinite;
}

.pulse-ring::after {
    animation-delay: 1s;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

.gpu-boost {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform;
}

.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.elastic-transition {
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   RESPONSIVE ANIMATIONS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    .float-3d {
        animation-duration: 8s;
    }
    
    .blob-advanced {
        width: 250px;
        height: 250px;
    }
    
    .holographic-text {
        animation-duration: 10s;
    }
}