/* ========================================
   ANIMATIONS - HACKER THEME
   ======================================== */

/* Typing Effect */
.typing-effect {
    overflow: hidden;
    border-right: 0.15em solid var(--primary-green);
    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(--primary-green) }
}

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

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

/* Glow Animation */
.glow {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 
            0 0 5px var(--primary-green),
            0 0 10px var(--primary-green);
    }
    50% {
        text-shadow: 
            0 0 10px var(--primary-green),
            0 0 20px var(--primary-green),
            0 0 30px var(--primary-green);
    }
}

/* Fade In */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide In From Top */
.slide-in-top {
    animation: slideInTop 0.5s ease-out;
}

@keyframes slideInTop {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide In From Bottom */
.slide-in-bottom {
    animation: slideInBottom 0.5s ease-out;
}

@keyframes slideInBottom {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide In From Left */
.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide In From Right */
.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Zoom In */
.zoom-in {
    animation: zoomIn 0.3s ease-out;
}

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

/* Shake Animation */
.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

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

/* Loading Dots */
.loading-dots::after {
    content: '...';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Progress Bar Animation */
.progress-bar {
    position: relative;
    height: 8px;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-green);
    box-shadow: 0 0 10px var(--primary-green);
    transition: width 0.5s ease;
    animation: progressGlow 2s infinite;
}

@keyframes progressGlow {
    0%, 100% {
        box-shadow: 0 0 5px var(--primary-green);
    }
    50% {
        box-shadow: 0 0 15px var(--primary-green);
    }
}

/* Matrix Rain Effect */
@keyframes matrixRain {
    to {
        transform: translateY(100vh);
    }
}

.matrix-char {
    position: absolute;
    color: var(--primary-green);
    animation: matrixRain 10s linear infinite;
    opacity: 0.7;
    font-size: 1.2rem;
}

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

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

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

@keyframes flicker {
    0%, 100% { opacity: 1; }
    41.99% { opacity: 1; }
    42% { opacity: 0; }
    43% { opacity: 0; }
    43.01% { opacity: 1; }
    47.99% { opacity: 1; }
    48% { opacity: 0; }
    49% { opacity: 0; }
    49.01% { opacity: 1; }
}

/* Number Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    animation: countUp 0.5s ease-out;
}

/* Terminal Cursor Blink */
.terminal-cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background: var(--primary-green);
    animation: cursorBlink 1s infinite;
    margin-left: 5px;
}

@keyframes cursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Neon Border */
.neon-border {
    position: relative;
    border: 2px solid var(--primary-green);
    animation: neonBorder 2s infinite;
}

@keyframes neonBorder {
    0%, 100% {
        box-shadow: 
            0 0 5px var(--primary-green),
            inset 0 0 5px var(--primary-green);
    }
    50% {
        box-shadow: 
            0 0 20px var(--primary-green),
            inset 0 0 10px var(--primary-green);
    }
}

/* Scroll Fade In */
.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    animation: fadeInStagger 0.5s ease 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 fadeInStagger {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
