/* ============================================
   ANIMATIONS - Keyframes & Motion
   ============================================ */

/* ========== GLOW ANIMATIONS ========== */

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
        filter: brightness(1);
    }

    50% {
        opacity: 0.7;
        filter: brightness(1.2);
    }
}

@keyframes breathe {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 40px rgba(0, 240, 255, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(0, 240, 255, 0.5), 0 0 60px rgba(0, 240, 255, 0.2);
    }
}

@keyframes energy-border {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ========== ROTATION ANIMATIONS ========== */

@keyframes rotate-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes rotate-reverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

/* ========== FLOAT ANIMATIONS ========== */

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes float-slow {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-5px) rotate(1deg);
    }

    50% {
        transform: translateY(-10px) rotate(0deg);
    }

    75% {
        transform: translateY(-5px) rotate(-1deg);
    }
}

/* ========== REVEAL ANIMATIONS ========== */

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-left {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fade-in-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes phase-in {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
        filter: blur(10px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== TYPEWRITER ANIMATION ========== */

@keyframes blink-cursor {

    0%,
    50% {
        border-color: var(--cyan-glow);
    }

    51%,
    100% {
        border-color: transparent;
    }
}

/* ========== ENERGY RING ANIMATIONS ========== */

@keyframes ring-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

@keyframes ring-expand {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ========== GRADIENT FLOW ========== */

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes holo-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ========== SKILL METER ANIMATIONS ========== */

@keyframes meter-fill {
    from {
        width: 0%;
    }
}

@keyframes meter-glow {

    0%,
    100% {
        box-shadow: 0 0 10px var(--cyan-glow), inset 0 0 10px rgba(0, 240, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 20px var(--cyan-glow), inset 0 0 20px rgba(0, 240, 255, 0.5);
    }
}

/* ========== SUCCESS ANIMATION ========== */

@keyframes success-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 30px rgba(0, 240, 255, 0);
    }
}

@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

/* ========== PARTICLE/STAR ANIMATIONS ========== */

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes drift {
    0% {
        transform: translateX(0) translateY(0);
    }

    25% {
        transform: translateX(10px) translateY(-10px);
    }

    50% {
        transform: translateX(20px) translateY(0);
    }

    75% {
        transform: translateX(10px) translateY(10px);
    }

    100% {
        transform: translateX(0) translateY(0);
    }
}

/* ========== HOVER EFFECT ANIMATIONS ========== */

@keyframes tilt-shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(1deg);
    }

    75% {
        transform: rotate(-1deg);
    }
}

/* ========== LOADING ANIMATION ========== */

@keyframes loading-ring {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes loading-pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* ========== ANIMATION UTILITIES ========== */

.animate-pulse {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-breathe {
    animation: breathe 3s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate-slow 20s linear infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 5s ease infinite;
}

/* Stagger delays for children */
.stagger-children>*:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-children>*:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-children>*:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-children>*:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-children>*:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-children>*:nth-child(6) {
    animation-delay: 0.6s;
}

.stagger-children>*:nth-child(7) {
    animation-delay: 0.7s;
}

.stagger-children>*:nth-child(8) {
    animation-delay: 0.8s;
}