/* ===== ENHANCED VISUAL EFFECTS ===== */

/* Particle background animation */
@keyframes particle-float {
    0% {
        opacity: 0;
        transform: translateY(100vh) translateX(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(100px);
    }
}

/* Enhanced button effects */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.95);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
}

/* Enhanced project card effects */
.project-card {
    position: relative;
    overflow: visible;
}

.project-card::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, var(--secondary), var(--accent), var(--secondary));
    background-size: 300% 300%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

.project-card:hover::after {
    opacity: 0.5;
    animation: gradient-shift 2s ease infinite;
}

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

/* Enhanced stat counter animation */
@keyframes stat-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.stat-number {
    animation: stat-pop 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Neon glow effect */
.neon-text {
    color: var(--secondary);
    text-shadow: 0 0 10px var(--secondary),
                 0 0 20px var(--secondary),
                 0 0 30px var(--secondary),
                 0 0 40px var(--accent);
    animation: neon-flicker 2s infinite;
}

@keyframes neon-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 0 0 10px var(--secondary),
                     0 0 20px var(--secondary),
                     0 0 30px var(--secondary),
                     0 0 40px var(--accent);
    }
    20%, 24%, 55% {
        text-shadow: 0 0 5px var(--secondary),
                     0 0 10px var(--secondary);
    }
}

/* Holographic card effect */
.holographic-card {
    position: relative;
    background: linear-gradient(45deg, 
        rgba(8, 164, 222, 0.1) 0%,
        rgba(13, 61, 145, 0.1) 25%,
        rgba(255, 215, 0, 0.1) 50%,
        rgba(8, 164, 222, 0.1) 75%,
        rgba(13, 61, 145, 0.1) 100%
    );
    background-size: 400% 400%;
    animation: holographic-shift 4s ease infinite;
}

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

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

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

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

/* Pixel dust animation */
.pixel-dust {
    position: relative;
}

.pixel-dust::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 60% 70%, rgba(8, 164, 222, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 80% 30%, rgba(11, 61, 145, 0.1) 1px, transparent 1px);
    background-size: 80px 80px;
    animation: dust-move 20s linear infinite;
}

@keyframes dust-move {
    0% {
        background-position: 0 0, 40px 60px, 20px 20px;
    }
    100% {
        background-position: 80px 80px, 120px 140px, 100px 100px;
    }
}

/* Glow on hover */
.glow-on-hover {
    transition: all 0.3s ease;
}

.glow-on-hover:hover {
    box-shadow: 0 0 20px var(--secondary),
                inset 0 0 10px var(--secondary);
}

/* Matrix rain effect */
.matrix-text {
    font-family: 'Courier New', monospace;
    color: var(--accent);
    opacity: 0.7;
    animation: matrix-rain 10s linear infinite;
}

@keyframes matrix-rain {
    0% {
        text-shadow: 0 0 10px var(--accent);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        text-shadow: 0 0 20px var(--accent);
    }
}

/* Rgb shift / chromatic aberration lite */
.chromatic {
    position: relative;
}

.chromatic:hover {
    animation: chromatic-shift 0.3s ease infinite;
}

@keyframes chromatic-shift {
    0%, 100% {
        text-shadow: 0 0 0 transparent;
    }
    25% {
        text-shadow: -2px 0 0 rgba(255, 0, 0, 0.7),
                     2px 0 0 rgba(0, 255, 255, 0.7);
    }
    50% {
        text-shadow: 0 0 0 transparent;
    }
    75% {
        text-shadow: 2px 0 0 rgba(255, 0, 0, 0.7),
                     -2px 0 0 rgba(0, 255, 255, 0.7);
    }
}

/* Floating animation for cards */
.float-animation {
    animation: gentle-float 3s ease-in-out infinite;
}

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

/* Staggered fade-in for lists */
.stagger-item {
    opacity: 0;
    animation: stagger-fade 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 stagger-fade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grid pattern background */
.grid-bg {
    background-image: 
        linear-gradient(0deg, transparent 24%, rgba(255, 215, 0, 0.05) 25%, rgba(255, 215, 0, 0.05) 26%, transparent 27%, transparent 74%, rgba(255, 215, 0, 0.05) 75%, rgba(255, 215, 0, 0.05) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(255, 215, 0, 0.05) 25%, rgba(255, 215, 0, 0.05) 26%, transparent 27%, transparent 74%, rgba(255, 215, 0, 0.05) 75%, rgba(255, 215, 0, 0.05) 76%, transparent 77%, transparent);
    background-size: 40px 40px;
}

/* Shaking effect */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-2px);
    }
    50% {
        transform: translateX(2px);
    }
    75% {
        transform: translateX(-2px);
    }
}

.shake-on-hover:hover {
    animation: shake 0.5s ease-in-out;
}
