/**
 * Yugantar Cybernetics - Enterprise CSS System
 * Part 4: Animations & Motion Tokens
 */

/* =========================================
   1. KEYFRAMES
========================================= */

@keyframes sysFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sysPulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(255, 143, 0, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 143, 0, 0.4);
    }

    100% {
        box-shadow: 0 0 10px rgba(255, 143, 0, 0.1);
    }
}

@keyframes sysNeonPulse {
    0% {
        filter: drop-shadow(0 0 5px rgba(255, 143, 0, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 15px rgba(255, 143, 0, 0.8));
    }

    100% {
        filter: drop-shadow(0 0 5px rgba(255, 143, 0, 0.4));
    }
}

@keyframes sysDropdownEnter {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes sysShineSweep {
    0% {
        left: -100%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    20% {
        left: 200%;
        opacity: 0;
    }

    100% {
        left: 200%;
        opacity: 0;
    }
}

@keyframes sysVibrancyPulse {
    0%, 100% {
        filter: brightness(1) contrast(1);
        transform: scale(1);
    }
    50% {
        filter: brightness(1.1) contrast(1.05);
        transform: scale(1.02);
    }
}

@keyframes sysGlowSpin {
    from { transform: rotate(0deg); opacity: 0.3; }
    to { transform: rotate(360deg); opacity: 0.6; }
}

.sys-neon-glow {
    animation: sysNeonPulse 3s infinite ease-in-out;
}

@keyframes sysSlideRight {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =========================================
   2. MOTION UTILITIES (Helper Classes)
========================================= */

.sys-animate-up {
    opacity: 0;
    transform: translateY(20px);
    animation: sysFadeInUp 600ms var(--sys-ease-spring) forwards;
}

.sys-animate-fade {
    opacity: 0;
    transition: opacity 800ms var(--sys-ease-cinematic);
}

.sys-animate-fade.is-visible {
    opacity: 1;
}

/* Stagger Logic For Grids */
.sys-stagger-1 {
    animation-delay: 100ms;
}

.sys-stagger-2 {
    animation-delay: 200ms;
}

.sys-stagger-3 {
    animation-delay: 300ms;
}

.sys-stagger-4 {
    animation-delay: 400ms;
}

/* Micro-Interactions */
.sys-hover-lift {
    transition: transform var(--sys-duration-normal) var(--sys-ease-spring);
}

.sys-hover-lift:hover {
    transform: translateY(-5px);
}

.sys-hover-glow-saffron:hover {
    box-shadow: 0 0 20px rgba(255, 143, 0, 0.2);
}

/* Mobile Menu Staggered Entry */
@media (max-width: 991.98px) {
    .navbar-collapse.show .nav-item {
        animation: sysFadeInLeft 0.5s var(--sys-ease-spring) forwards;
        animation-delay: calc(var(--sys-stagger) * 0.1s);
        opacity: 0;
    }
}

@keyframes sysFadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Strict reduction constraint for a11y */
@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
        transform: none !important;
    }

    .sys-animate-up {
        opacity: 1;
        transform: none;
        animation: none;
    }
}