/* Matrix Rain Animation */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.1;
}

/* Glitch Effect */
.glitch {
    position: relative;
}

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

.glitch::before {
    animation: glitch-effect 3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    color: var(--primary-color);
}

.glitch::after {
    animation: glitch-effect 2s infinite reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    color: var(--accent-color);
}

@keyframes glitch-effect {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-3px, 3px);
    }
    40% {
        transform: translate(-3px, -3px);
    }
    60% {
        transform: translate(3px, 3px);
    }
    80% {
        transform: translate(3px, -3px);
    }
    100% {
        transform: translate(0);
    }
}

/* Floating Animation */
.floating {
    animation: floating 3s ease-in-out infinite;
}

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

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

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

/* Cyber Scanner Effect */
.cyber-scan {
    position: relative;
    overflow: hidden;
}

.cyber-scan::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to bottom,
        transparent,
        transparent 50%,
        rgba(0, 255, 136, 0.1) 50%,
        transparent 51%
    );
    animation: scan 4s linear infinite;
}

@keyframes scan {
    0% {
        transform: rotate(0deg) translateY(-50%);
    }
    100% {
        transform: rotate(360deg) translateY(-50%);
    }
}

/* Typing Effect */
.typing {
    border-right: 2px solid var(--primary-color);
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
}

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

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

/* Neon Glow */
.neon-glow {
    animation: neon-glow 1.5s ease-in-out infinite alternate;
}

@keyframes neon-glow {
    from {
        text-shadow: 0 0 5px #fff,
                     0 0 10px #fff,
                     0 0 15px var(--primary-color),
                     0 0 20px var(--primary-color),
                     0 0 25px var(--primary-color);
    }
    to {
        text-shadow: 0 0 10px #fff,
                     0 0 20px #fff,
                     0 0 30px var(--primary-color),
                     0 0 40px var(--primary-color),
                     0 0 50px var(--primary-color);
    }
}

/* Data Flow Animation */
.data-flow {
    position: relative;
    overflow: hidden;
}

.data-flow::before {
    content: '01101001 10101010 11001100';
    position: absolute;
    font-family: monospace;
    font-size: 10px;
    color: var(--primary-color);
    opacity: 0.3;
    white-space: nowrap;
    animation: data-flow 20s linear infinite;
}

@keyframes data-flow {
    from {
        transform: translateX(-50%);
    }
    to {
        transform: translateX(100%);
    }
}

/* Rotate on Hover */
.rotate-hover {
    transition: transform 0.3s ease;
}

.rotate-hover:hover {
    transform: rotate(360deg);
}

/* Scale In Animation */
.scale-in {
    animation: scale-in 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes scale-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
