/* ============================================
   0xUnstable - Animations & Effects
   Based on 0xNynim Animation System
   ============================================ */

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Scroll Bounce Animation */
@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(10px);
        opacity: 0.5;
    }
}

/* Glitch Effect */
@keyframes glitch {
    0% { clip-path: polygon(0 2%, 100% 2%, 100% 5%, 0 5%); transform: translate(-2px, 2px); }
    10% { clip-path: polygon(0 15%, 100% 15%, 100% 15%, 0 15%); transform: translate(2px, -2px); }
    20% { clip-path: polygon(0 10%, 100% 10%, 100% 20%, 0 20%); transform: translate(-2px, 2px); }
    30% { clip-path: polygon(0 1%, 100% 1%, 100% 2%, 0 2%); transform: translate(2px, -2px); }
    40% { clip-path: polygon(0 33%, 100% 33%, 100% 33%, 0 33%); transform: translate(-2px, 2px); }
    50% { clip-path: polygon(0 44%, 100% 44%, 100% 44%, 0 44%); transform: translate(2px, -2px); }
    60% { clip-path: polygon(0 50%, 100% 50%, 100% 20%, 0 20%); transform: translate(-2px, 2px); }
    70% { clip-path: polygon(0 70%, 100% 70%, 100% 70%, 0 70%); transform: translate(2px, -2px); }
    80% { clip-path: polygon(0 80%, 100% 80%, 100% 80%, 0 80%); transform: translate(-2px, 2px); }
    90% { clip-path: polygon(0 50%, 100% 50%, 100% 55%, 0 55%); transform: translate(2px, -2px); }
    100% { clip-path: polygon(0 70%, 100% 70%, 100% 80%, 0 80%); transform: translate(-2px, 2px); }
}

/* Float Animation */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Gradient Shift Animation */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Glow Pulse Animation */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(153, 69, 255, 0.3); }
    50% { box-shadow: 0 0 40px rgba(153, 69, 255, 0.6), 0 0 60px rgba(20, 241, 149, 0.3); }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Fade In Up Animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scale In Animation */
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================
   Glitch Effect Implementation
   ============================================ */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--solana-dark);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--neon-pink);
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    animation: glitch 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-cyan);
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    animation: glitch 2s infinite linear alternate-reverse;
}

.glitch:hover::before,
.glitch:hover::after {
    animation-duration: 0.5s;
}

/* ============================================
   AOS (Animate On Scroll)
   ============================================ */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
    transition-duration: 0.8s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-aos="fade-up"] { transform: translateY(30px); }
[data-aos="fade-down"] { transform: translateY(-30px); }
[data-aos="zoom-in"] { transform: scale(0.9); }

[data-aos].aos-animate {
    opacity: 1;
    transform: translate(0) scale(1);
}

[data-aos-delay="100"] { transition-delay: 0.1s; }
[data-aos-delay="200"] { transition-delay: 0.2s; }
[data-aos-delay="300"] { transition-delay: 0.3s; }

/* ============================================
   Hover Effects
   ============================================ */
.btn:active,
.nav-link:active {
    transform: scale(0.98);
}

/* ============================================
   Glass Morphism
   ============================================ */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   Focus States
   ============================================ */
:focus-visible {
    outline: 2px solid var(--solana-purple);
    outline-offset: 2px;
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    [data-aos] {
        opacity: 1;
        transform: none;
    }
    
    .glitch::before,
    .glitch::after {
        animation: none;
    }
}
