/* Animation Styles */

/* Matrix Background */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
}

/* Scroll Animations */
[data-scroll] {
    opacity: 0;
    transition: opacity 1s, transform 1s;
}

[data-scroll="in"] {
    opacity: 1;
    transform: translateY(0) !important;
}

[data-scroll="out"] {
    opacity: 0;
}

.fade-in {
    transform: translateY(50px);
}

.fade-in-left {
    transform: translateX(-50px);
}

.fade-in-right {
    transform: translateX(50px);
}

.fade-in-delay-1 {
    transition-delay: 0.2s;
}

.fade-in-delay-2 {
    transition-delay: 0.4s;
}

.fade-in-delay-3 {
    transition-delay: 0.6s;
}

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

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

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 var(--secondary-color);
    animation: glitch-text-anim-1 2s linear infinite alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: 1px 0 var(--accent-color);
    animation: glitch-text-anim-2 3s linear infinite alternate-reverse;
}

@keyframes glitch-text-anim-1 {
    0% {
        clip-path: inset(0% 0% 98% 0%);
    }
    20% {
        clip-path: inset(29% 0% 20% 0%);
    }
    40% {
        clip-path: inset(80% 0% 5% 0%);
    }
    60% {
        clip-path: inset(43% 0% 40% 0%);
    }
    80% {
        clip-path: inset(21% 0% 40% 0%);
    }
    100% {
        clip-path: inset(60% 0% 10% 0%);
    }
}

@keyframes glitch-text-anim-2 {
    0% {
        clip-path: inset(82% 0% 1% 0%);
    }
    20% {
        clip-path: inset(33% 0% 40% 0%);
    }
    40% {
        clip-path: inset(20% 0% 50% 0%);
    }
    60% {
        clip-path: inset(50% 0% 20% 0%);
    }
    80% {
        clip-path: inset(10% 0% 60% 0%);
    }
    100% {
        clip-path: inset(70% 0% 5% 0%);
    }
}

/* Terminal Blinking Cursor */
.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--primary-color);
    margin-left: 5px;
    animation: cursor-blink 1.2s infinite;
    vertical-align: text-bottom;
}

@keyframes cursor-blink {
    0%, 40% {
        opacity: 1;
    }
    50%, 90% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 20px;
}

.loading::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        var(--primary-color) 0%, 
        var(--primary-color) 50%,
        transparent 50%, 
        transparent 100%
    );
    background-size: 200% 100%;
    animation: progress 2s linear infinite;
}

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

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

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

/* Scan Lines */
.scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    pointer-events: none;
    opacity: 0.2;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 0, 0, 0.5) 51%
    );
    background-size: 100% 4px;
}

/* Flicker Effect */
.flicker {
    animation: flicker 4s linear infinite;
}

@keyframes flicker {
    0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% {
        opacity: 1;
    }
    20%, 21.999%, 63%, 63.999%, 65%, 69.999% {
        opacity: 0.5;
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Glow Animation */
.glow {
    text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px var(--primary-color), 0 0 10px var(--primary-color);
    }
    to {
        text-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color);
    }
}

/* Hover Effects */
.hover-glow {
    transition: all 0.3s ease;
}

.hover-glow:hover {
    text-shadow: 0 0 8px var(--primary-color);
    color: #fff;
}

/* Smooth Reveal */
.reveal {
    position: relative;
    overflow: hidden;
}

.reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    transform: translateX(0);
    transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.reveal.show::after {
    transform: translateX(100%);
}

/* 3D Card Tilt Effect */
.tilt-card {
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.3s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(var(--rotateX)) rotateY(var(--rotateY));
}

/* Hacker Scan Effect */
.scan-effect {
    position: relative;
}

.scan-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    opacity: 0.7;
    box-shadow: 0 0 15px var(--primary-color);
    animation: scan 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes scan {
    0% {
        top: 0;
    }
    100% {
        top: 100%;
    }
}

/* Circle Loader */
.circle-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 255, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Text Scramble Effect */
.scramble {
    display: inline-block;
}

/* Digital Noise */
.digital-noise {
    position: relative;
}

.digital-noise::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/noise.png');
    opacity: 0.05;
    animation: noise 0.2s steps(2) infinite;
    pointer-events: none;
}

@keyframes noise {
    0% {
        transform: translate(-10px, 0px);
    }
    25% {
        transform: translate(-5px, -5px);
    }
    50% {
        transform: translate(0, 10px);
    }
    75% {
        transform: translate(5px, 5px);
    }
    100% {
        transform: translate(10px, 0px);
    }
}

/* Particle Effect */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 50%;
    opacity: 0.5;
    animation: float-particle 15s linear infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-800px) translateX(100px);
        opacity: 0;
    }
}

/* Binary Rain */
.binary-rain {
    position: absolute;
    font-family: var(--font-mono);
    color: var(--primary-color);
    font-size: 12px;
    opacity: 0.2;
    text-shadow: 0 0 5px var(--primary-color);
    user-select: none;
    white-space: nowrap;
}

/* Menu Animation */
.menu-open .line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-open .line:nth-child(2) {
    opacity: 0;
}

.menu-open .line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Page Transitions */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--darker-bg);
    z-index: 9999;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.page-transition.active {
    transform: scaleY(1);
} 