/* Animations and Visual Effects */

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

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

.glitch-effect::before {
    left: -2px;
    text-shadow: 1px 0 #00d9c5;
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch-effect::after {
    left: 2px;
    text-shadow: -1px 0 #6e57ff;
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(76px, 9999px, 61px, 0);
    }
    5% {
        clip: rect(28px, 9999px, 7px, 0);
    }
    10% {
        clip: rect(64px, 9999px, 78px, 0);
    }
    15% {
        clip: rect(75px, 9999px, 40px, 0);
    }
    20% {
        clip: rect(48px, 9999px, 69px, 0);
    }
    25% {
        clip: rect(14px, 9999px, 56px, 0);
    }
    30% {
        clip: rect(62px, 9999px, 53px, 0);
    }
    35% {
        clip: rect(65px, 9999px, 54px, 0);
    }
    40% {
        clip: rect(84px, 9999px, 22px, 0);
    }
    45% {
        clip: rect(54px, 9999px, 30px, 0);
    }
    50% {
        clip: rect(82px, 9999px, 90px, 0);
    }
    55% {
        clip: rect(66px, 9999px, 92px, 0);
    }
    60% {
        clip: rect(11px, 9999px, 6px, 0);
    }
    65% {
        clip: rect(46px, 9999px, 95px, 0);
    }
    70% {
        clip: rect(4px, 9999px, 51px, 0);
    }
    75% {
        clip: rect(40px, 9999px, 95px, 0);
    }
    80% {
        clip: rect(98px, 9999px, 100px, 0);
    }
    85% {
        clip: rect(54px, 9999px, 99px, 0);
    }
    90% {
        clip: rect(53px, 9999px, 31px, 0);
    }
    95% {
        clip: rect(81px, 9999px, 83px, 0);
    }
    100% {
        clip: rect(44px, 9999px, 35px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(36px, 9999px, 13px, 0);
    }
    5% {
        clip: rect(62px, 9999px, 97px, 0);
    }
    10% {
        clip: rect(39px, 9999px, 36px, 0);
    }
    15% {
        clip: rect(100px, 9999px, 66px, 0);
    }
    20% {
        clip: rect(39px, 9999px, 24px, 0);
    }
    25% {
        clip: rect(19px, 9999px, 63px, 0);
    }
    30% {
        clip: rect(91px, 9999px, 56px, 0);
    }
    35% {
        clip: rect(28px, 9999px, 28px, 0);
    }
    40% {
        clip: rect(24px, 9999px, 75px, 0);
    }
    45% {
        clip: rect(53px, 9999px, 54px, 0);
    }
    50% {
        clip: rect(47px, 9999px, 75px, 0);
    }
    55% {
        clip: rect(78px, 9999px, 79px, 0);
    }
    60% {
        clip: rect(26px, 9999px, 81px, 0);
    }
    65% {
        clip: rect(85px, 9999px, 73px, 0);
    }
    70% {
        clip: rect(18px, 9999px, 86px, 0);
    }
    75% {
        clip: rect(81px, 9999px, 62px, 0);
    }
    80% {
        clip: rect(33px, 9999px, 8px, 0);
    }
    85% {
        clip: rect(5px, 9999px, 24px, 0);
    }
    90% {
        clip: rect(90px, 9999px, 49px, 0);
    }
    95% {
        clip: rect(24px, 9999px, 6px, 0);
    }
    100% {
        clip: rect(88px, 9999px, 53px, 0);
    }
}

/* Neural Network Animation */
.neural-network {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" stroke="%236e57ff" stroke-width="1" fill="none" /></svg>') center/cover no-repeat;
    opacity: 0.7;
    animation: pulse 3s infinite alternate;
}

.neural-animation {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(110, 87, 255, 0.1) 0%, rgba(0, 217, 197, 0.1) 100%);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.neural-animation::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="30" cy="30" r="2" fill="%236e57ff" /><circle cx="70" cy="30" r="2" fill="%236e57ff" /><circle cx="30" cy="70" r="2" fill="%236e57ff" /><circle cx="70" cy="70" r="2" fill="%236e57ff" /><circle cx="50" cy="50" r="2" fill="%2300d9c5" /><line x1="30" y1="30" x2="50" y2="50" stroke="%236e57ff" stroke-width="0.5" /><line x1="70" y1="30" x2="50" y2="50" stroke="%236e57ff" stroke-width="0.5" /><line x1="30" y1="70" x2="50" y2="50" stroke="%236e57ff" stroke-width="0.5" /><line x1="70" y1="70" x2="50" y2="50" stroke="%236e57ff" stroke-width="0.5" /></svg>') 0 0/100px 100px;
    animation: neural-move 30s linear infinite;
}

@keyframes neural-move {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

/* Float Animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Typing Animation */
.typing-animation {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary);
    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(--primary) }
}

/* Gradient Shift */
.gradient-shift {
    background: linear-gradient(-45deg, var(--primary), var(--primary-dark), var(--secondary), var(--primary-light));
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

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

/* Count Up Animation */
.counting-animation {
    animation: countup 2s forwards;
}

@keyframes countup {
    from { content: "0"; }
    to { content: attr(data-count); }
}

/* Scroll-Triggered Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.slide-in-left {
    transform: translateX(-100px);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

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

.slide-in-right {
    transform: translateX(100px);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

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

/* Parallax Effect */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}
