/* ===== ADVANCED ANIMATIONS ===== */

/* Scroll-triggered animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

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

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

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px var(--neon-cyan);
}

/* Text animations */
.text-shimmer {
    background: linear-gradient(
        90deg,
        var(--text-primary) 0%,
        var(--neon-cyan) 50%,
        var(--text-primary) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

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

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

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

/* Particle effects */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-cyan);
    border-radius: 50%;
    pointer-events: none;
    animation: particle-float 3s ease-out forwards;
}

@keyframes particle-float {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0);
    }
}

/* Glitch effects */
.glitch-text {
    position: relative;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-weight: 900;
}

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

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 var(--neon-cyan);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-purple), 2px 0 var(--neon-pink);
    animation: glitch-anim2 1s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); }
    5% { clip: rect(112px, 9999px, 76px, 0); }
    10% { clip: rect(85px, 9999px, 77px, 0); }
    15% { clip: rect(27px, 9999px, 63px, 0); }
    20% { clip: rect(42px, 9999px, 75px, 0); }
    25% { clip: rect(14px, 9999px, 79px, 0); }
    30% { clip: rect(87px, 9999px, 85px, 0); }
    35% { clip: rect(73px, 9999px, 61px, 0); }
    40% { clip: rect(22px, 9999px, 91px, 0); }
    45% { clip: rect(67px, 9999px, 62px, 0); }
    50% { clip: rect(28px, 9999px, 92px, 0); }
    55% { clip: rect(73px, 9999px, 79px, 0); }
    60% { clip: rect(87px, 9999px, 85px, 0); }
    65% { clip: rect(14px, 9999px, 79px, 0); }
    70% { clip: rect(42px, 9999px, 75px, 0); }
    75% { clip: rect(27px, 9999px, 63px, 0); }
    80% { clip: rect(85px, 9999px, 77px, 0); }
    85% { clip: rect(112px, 9999px, 76px, 0); }
    90% { clip: rect(31px, 9999px, 94px, 0); }
    95% { clip: rect(73px, 9999px, 61px, 0); }
    100% { clip: rect(22px, 9999px, 91px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 119px, 0); }
    5% { clip: rect(25px, 9999px, 36px, 0); }
    10% { clip: rect(25px, 9999px, 9px, 0); }
    15% { clip: rect(54px, 9999px, 74px, 0); }
    20% { clip: rect(48px, 9999px, 29px, 0); }
    25% { clip: rect(42px, 9999px, 73px, 0); }
    30% { clip: rect(31px, 9999px, 75px, 0); }
    35% { clip: rect(6px, 9999px, 4px, 0); }
    40% { clip: rect(79px, 9999px, 85px, 0); }
    45% { clip: rect(75px, 9999px, 5px, 0); }
    50% { clip: rect(67px, 9999px, 61px, 0); }
    55% { clip: rect(7px, 9999px, 79px, 0); }
    60% { clip: rect(43px, 9999px, 45px, 0); }
    65% { clip: rect(25px, 9999px, 9px, 0); }
    70% { clip: rect(25px, 9999px, 36px, 0); }
    75% { clip: rect(54px, 9999px, 74px, 0); }
    80% { clip: rect(48px, 9999px, 29px, 0); }
    85% { clip: rect(42px, 9999px, 73px, 0); }
    90% { clip: rect(31px, 9999px, 75px, 0); }
    95% { clip: rect(6px, 9999px, 4px, 0); }
    100% { clip: rect(79px, 9999px, 85px, 0); }
}

/* Cyber grid background */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Neon border animation */
.neon-border {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(45deg, var(--primary-bg), var(--primary-bg)) padding-box,
                linear-gradient(45deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink)) border-box;
    animation: border-glow 3s ease-in-out infinite;
}

@keyframes border-glow {
    0%, 100% { 
        border-image: linear-gradient(45deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink)) 1;
    }
    50% { 
        border-image: linear-gradient(45deg, var(--neon-pink), var(--neon-cyan), var(--neon-purple)) 1;
    }
}

/* Typewriter effect */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--neon-cyan);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--neon-cyan); }
}

/* Floating elements */
.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Pulse effect */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Rotate animation */
.rotate {
    animation: rotate 10s linear infinite;
}

/* Matrix rain effect */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    overflow: hidden;
}

.matrix-rain::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 255, 0.03) 2px,
            rgba(0, 255, 255, 0.03) 4px
        );
    animation: matrix-fall 20s linear infinite;
}

@keyframes matrix-fall {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Holographic effect */
.holographic {
    background: linear-gradient(
        45deg,
        #ff0080,
        #8b5cf6,
        #00ffff,
        #00ff88,
        #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%; }
}

