/* Cyberpunk animations and effects */

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

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes pulse-neon {
    0%, 100% { 
        box-shadow: 0 0 5px #00FFFF, 0 0 10px #00FFFF, 0 0 15px #00FFFF;
        opacity: 1;
    }
    50% { 
        box-shadow: 0 0 2px #00FFFF, 0 0 5px #00FFFF, 0 0 8px #00FFFF;
        opacity: 0.8;
    }
}

@keyframes matrix-rain {
    0% { transform: translateY(-100%); opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

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

@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glitch text effect */
.glitch-text {
    position: relative;
    text-shadow: 0.05em 0 0 #00FFFF, -0.05em -0.025em 0 #8A2BE2, 0.025em 0.05em 0 #00FF41;
    animation: glitch 0.3s infinite;
}

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

.glitch-text:before {
    animation: glitch 0.3s infinite;
    color: #00FFFF;
    z-index: -1;
}

.glitch-text:after {
    animation: glitch 0.3s infinite reverse;
    color: #8A2BE2;
    z-index: -2;
}

/* Glassmorphism cards */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Link card hover effects */
.link-card:hover .glass-card {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.2);
}

/* Matrix rain overlay */
.matrix-rain-overlay::before {
    content: "01001000 01100001 01100011 01101011 01100101 01110010";
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    font-family: 'Fira Code', monospace;
    font-size: 8px;
    color: #00FF41;
    letter-spacing: 1px;
    animation: matrix-rain 3s linear infinite;
    word-wrap: break-word;
    white-space: pre-wrap;
    opacity: 0.7;
}

/* Particle background */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particles-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #00FFFF, transparent),
        radial-gradient(2px 2px at 40px 70px, #8A2BE2, transparent),
        radial-gradient(1px 1px at 90px 40px, #00FF41, transparent),
        radial-gradient(1px 1px at 130px 80px, #00FFFF, transparent),
        radial-gradient(2px 2px at 160px 30px, #8A2BE2, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: matrix-rain 20s linear infinite;
    opacity: 0.1;
}

/* Glow effects */
.glow-effect {
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        0 0 40px rgba(0, 255, 255, 0.3),
        0 0 60px rgba(0, 255, 255, 0.1);
}

.pulse-glow {
    animation: pulse-neon 2s ease-in-out infinite;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(45deg, #00FFFF, #8A2BE2, #00FF41, #00FFFF);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease-in-out infinite;
}

/* Fade in animation */
.animate-fade-in {
    animation: fade-in 1s ease-out forwards;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0F1419;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00FFFF, #8A2BE2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8A2BE2, #00FFFF);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .glass-card {
        padding: 1rem;
    }
    
    .glitch-text {
        font-size: 2rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .glitch-text,
    .animate-float,
    .animate-pulse-neon,
    .animate-gradient-shift {
        animation: none;
    }
    
    .matrix-rain-overlay::before {
        animation: none;
    }
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #00FFFF;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .glass-card {
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid #00FFFF;
    }
    
    .gradient-text {
        -webkit-text-fill-color: #00FFFF;
    }
}