/* Advanced Animations & Effects */

/* Smooth Reveal Animations */
@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);
    }
}

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

/* Glow Effects */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.6);
    }
}

@keyframes text-glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    }
}

/* Morphing Backgrounds */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes mesh-morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: translate(20px, -20px) rotate(90deg);
    }
    50% {
        border-radius: 70% 30% 40% 60% / 40% 70% 60% 30%;
        transform: translate(-20px, 20px) rotate(180deg);
    }
    75% {
        border-radius: 40% 70% 60% 30% / 70% 40% 50% 70%;
        transform: translate(20px, 20px) rotate(270deg);
    }
}

/* Particle Effects */
@keyframes particle-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0.5;
    }
}

@keyframes particle-drift {
    0% {
        transform: translateX(0px) translateY(0px);
    }
    25% {
        transform: translateX(50px) translateY(-25px);
    }
    50% {
        transform: translateX(0px) translateY(-50px);
    }
    75% {
        transform: translateX(-50px) translateY(-25px);
    }
    100% {
        transform: translateX(0px) translateY(0px);
    }
}

/* Glass Morphism Effects */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all var(--transition-base);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Neon Effects */
.neon-text {
    color: var(--primary-color);
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor,
        0 0 20px currentColor;
    animation: neon-flicker 2s ease-in-out infinite alternate;
}

@keyframes neon-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 15px currentColor,
            0 0 20px currentColor;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

.neon-border {
    border: 2px solid var(--primary-color);
    box-shadow: 
        0 0 10px var(--primary-color),
        inset 0 0 10px var(--primary-color);
    animation: neon-border-pulse 2s ease-in-out infinite;
}

@keyframes neon-border-pulse {
    0%, 100% {
        box-shadow: 
            0 0 10px var(--primary-color),
            inset 0 0 10px var(--primary-color);
    }
    50% {
        box-shadow: 
            0 0 20px var(--primary-color),
            inset 0 0 20px var(--primary-color);
    }
}

/* Holographic Effects */
.holographic {
    background: linear-gradient(
        45deg,
        #ff0080,
        #ff8c00,
        #40e0d0,
        #ff0080
    );
    background-size: 400% 400%;
    animation: holographic-shift 3s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes holographic-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Magnetic Hover Effects */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.magnetic:hover {
    transform: scale(1.05);
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Tilt Effect */
.tilt {
    transform-style: preserve-3d;
    transition: transform 0.3s ease-out;
}

.tilt:hover {
    transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
}

/* Parallax Scroll Effects */
.parallax-element {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    animation: stagger-in 0.6s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes stagger-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Morphing Shapes */
.morph-shape {
    width: 100px;
    height: 100px;
    background: var(--primary-gradient);
    border-radius: 50%;
    animation: shape-morph 4s ease-in-out infinite;
}

@keyframes shape-morph {
    0%, 100% {
        border-radius: 50%;
        transform: rotate(0deg);
    }
    25% {
        border-radius: 25% 75% 75% 25%;
        transform: rotate(90deg);
    }
    50% {
        border-radius: 75% 25% 25% 75%;
        transform: rotate(180deg);
    }
    75% {
        border-radius: 25% 75% 25% 75%;
        transform: rotate(270deg);
    }
}

/* Liquid Animation */
.liquid-bg {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    animation: liquid-flow 15s ease-in-out infinite;
}

@keyframes liquid-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
    color: var(--text-primary);
}

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

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: #ff0080;
    z-index: -1;
}

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

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% {
        transform: translate(0);
    }
    15%, 49% {
        transform: translate(-2px, 2px);
    }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 99%, 100% {
        transform: translate(0);
    }
    21%, 62% {
        transform: translate(2px, -2px);
    }
}

/* Cyberpunk Grid */
.cyber-grid {
    background-image: 
        linear-gradient(rgba(102, 126, 234, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 126, 234, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 50px 50px;
    }
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 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;
    }
}
