/* ============================================
   0xNynim - Animations & Effects
   Cutting-edge animations for 2026
   ============================================ */



/* ============================================
   Keyframe Animations
   ============================================ */

/* 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);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 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);
    }
}

/* Slide In Left Animation */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right Animation */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Border Glow Animation */
@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(153, 69, 255, 0.3);
    }
    50% {
        border-color: rgba(20, 241, 149, 0.5);
    }
}

/* Text Reveal Animation */
@keyframes textReveal {
    0% {
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(5px);
    }
}

/* ============================================
   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) Custom Animations
   ============================================ */
[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="fade-left"] {
    transform: translateX(30px);
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
}

[data-aos="zoom-in"] {
    transform: scale(0.9);
}

[data-aos="zoom-out"] {
    transform: scale(1.1);
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* Stagger delays */
[data-aos-delay="100"] {
    transition-delay: 0.1s;
}

[data-aos-delay="200"] {
    transition-delay: 0.2s;
}

[data-aos-delay="300"] {
    transition-delay: 0.3s;
}

[data-aos-delay="400"] {
    transition-delay: 0.4s;
}

/* ============================================
   Hover Effects
   ============================================ */

/* Magnetic Button Effect */
.btn-magnetic {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Hover Lift */
.card-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Image Zoom Effect */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease;
}

.img-zoom:hover img {
    transform: scale(1.1);
}

/* Link Underline Animation */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* ============================================
   Loading Animations
   ============================================ */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(153, 69, 255, 0.3);
    border-top-color: var(--solana-purple);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}



/* ============================================
   Special Effects
   ============================================ */

/* Neon Glow Text */
.neon-text {
    text-shadow: 
        0 0 5px var(--solana-purple),
        0 0 10px var(--solana-purple),
        0 0 20px var(--solana-purple),
        0 0 40px var(--solana-purple);
    animation: glowPulse 2s ease-in-out infinite;
}



/* Gradient Border */
.gradient-border {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: var(--gradient-primary);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradientShift 3s ease infinite;
    background-size: 200% 200%;
}

/* 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);
}

/* Floating Elements */
.floating {
    animation: float 6s ease-in-out infinite;
}

.floating-delay-1 {
    animation-delay: 1s;
}

.floating-delay-2 {
    animation-delay: 2s;
}

.floating-delay-3 {
    animation-delay: 3s;
}

/* ============================================
   Scroll Animations
   ============================================ */

/* Parallax Effect */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Interactive States
   ============================================ */

/* Focus States */
:focus-visible {
    outline: 2px solid var(--solana-purple);
    outline-offset: 2px;
}



/* Active States - FIXED: Only apply to interactive elements */
.btn:active,
.nav-link:active,
.tool-link:active,
.insight-link:active {
    transform: scale(0.98);
}


/* Disabled States */
:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   Performance Optimizations
   ============================================ */

/* GPU Acceleration */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Will Change */
.will-animate {
    will-change: transform, opacity;
}

/* 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;
    }
}

/* ============================================
   Particle Effects (for JS integration)
   ============================================ */

.particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    background: var(--solana-purple);
    opacity: 0.6;
}



/* ============================================
   3D Transform Effects
   ============================================ */

.perspective-container {
    perspective: 1000px;
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg);
}

/* ============================================
   Ripple Effect
   ============================================ */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.6s, opacity 0.6s;
}

.ripple:active::after {
    transform: translate(-50%, -50%) scale(2);
    opacity: 1;
    transition: 0s;
}

/* ============================================
   Typing Effect
   ============================================ */

.typing {
    overflow: hidden;
    border-right: 2px solid var(--solana-cyan);
    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(--solana-cyan) }
}



/* ============================================
   Morphing Shapes
   ============================================ */

.morph {
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* ============================================
   Background Animations
   ============================================ */

.animated-gradient {
    background: linear-gradient(-45deg, #9945FF, #14F195, #B829F7, #00F0FF);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}



/* ============================================
   Notification Badge Animation
   ============================================ */

.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 10px;
    height: 10px;
    background: var(--neon-pink);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* ============================================
   ============================================ */

.progress-bar {
    height: 4px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    animation: progressFill 2s ease-out forwards;
    transform-origin: left;
    transform: scaleX(0);
}

@keyframes progressFill {
    to {
        transform: scaleX(1);
    }
}

/* ============================================
   Shake Animation (for errors)
   ============================================ */

.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@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); }
}

/* ============================================
   Bounce In Animation
   ============================================ */

.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   Flip Animation
   ============================================ */

.flip {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.flip:hover {
    transform: rotateY(180deg);
}

.flip-back {
    transform: rotateY(180deg);
    backface-visibility: hidden;
}
