@keyframes glow {
    from {
        text-shadow: 0 0 20px var(--primary)30, 0 0 30px var(--primary)20, 0 0 40px var(--primary)10;
    }
    to {
        text-shadow: 0 0 30px var(--primary)50, 0 0 40px var(--primary)30, 0 0 50px var(--primary)20;
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    50% {
        opacity: 1;
    }
    to {
        transform: scale3d(1, 1, 1);
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
    }
    50% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    to {
        opacity: 0;
    }
}

@keyframes slideInDown {
    from {
        transform: translate3d(0, -100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideInUp {
    from {
        transform: translate3d(0, 100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes flipInX {
    from {
        transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
        animation-timing-function: ease-in;
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
        animation-timing-function: ease-in;
    }
    60% {
        transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
    }
    to {
        transform: perspective(400px);
    }
}

@keyframes flipInY {
    from {
        transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
        animation-timing-function: ease-in;
        opacity: 0;
    }
    40% {
        transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
        animation-timing-function: ease-in;
    }
    60% {
        transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
        opacity: 1;
    }
    80% {
        transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
    }
    to {
        transform: perspective(400px);
    }
}

@keyframes rubberBand {
    from {
        transform: scale3d(1, 1, 1);
    }
    30% {
        transform: scale3d(1.25, 0.75, 1);
    }
    40% {
        transform: scale3d(0.75, 1.25, 1);
    }
    50% {
        transform: scale3d(1.15, 0.85, 1);
    }
    65% {
        transform: scale3d(0.95, 1.05, 1);
    }
    75% {
        transform: scale3d(1.05, 0.95, 1);
    }
    to {
        transform: scale3d(1, 1, 1);
    }
}

@keyframes shake {
    from, to {
        transform: translate3d(0, 0, 0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translate3d(-10px, 0, 0);
    }
    20%, 40%, 60%, 80% {
        transform: translate3d(10px, 0, 0);
    }
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.3);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(1);
    }
}

@keyframes jello {
    from, 11.1%, to {
        transform: translate3d(0, 0, 0);
    }
    22.2% {
        transform: skewX(-12.5deg) skewY(-12.5deg);
    }
    33.3% {
        transform: skewX(6.25deg) skewY(6.25deg);
    }
    44.4% {
        transform: skewX(-3.125deg) skewY(-3.125deg);
    }
    55.5% {
        transform: skewX(1.5625deg) skewY(1.5625deg);
    }
    66.6% {
        transform: skewX(-0.78125deg) skewY(-0.78125deg);
    }
    77.7% {
        transform: skewX(0.390625deg) skewY(0.390625deg);
    }
    88.8% {
        transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
    }
}

@keyframes wave {
    0%, 60%, 100% {
        transform: initial;
    }
    30% {
        transform: translateY(-15px);
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blinkCursor {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary);
    }
}

@keyframes particle-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

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

@keyframes neon-glow {
    from {
        box-shadow: 
            0 0 5px var(--primary),
            0 0 10px var(--primary),
            0 0 15px var(--primary);
    }
    to {
        box-shadow: 
            0 0 10px var(--primary),
            0 0 20px var(--primary),
            0 0 30px var(--primary),
            0 0 40px var(--primary);
    }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-ping {
    animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, var(--primary)40, transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-zoom-in {
    animation: zoomIn 0.6s ease-out;
}

.animate-zoom-out {
    animation: zoomOut 0.6s ease-out;
}

.animate-slide-in-down {
    animation: slideInDown 0.8s ease-out;
}

.animate-slide-in-up {
    animation: slideInUp 0.8s ease-out;
}

.animate-flip-in-x {
    animation: flipInX 1s ease-out;
}

.animate-flip-in-y {
    animation: flipInY 1s ease-out;
}

.animate-rubber-band {
    animation: rubberBand 1s ease-out;
}

.animate-shake {
    animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.animate-heart-beat {
    animation: heartBeat 1.3s ease-in-out infinite;
}

.animate-jello {
    animation: jello 0.9s ease-out;
}

.animate-wave {
    animation: wave 2s ease-in-out infinite;
}

.animate-neon {
    animation: neon-glow 1.5s ease-in-out infinite alternate;
}

.animate-gradient {
    background: linear-gradient(-45deg, var(--primary), var(--primary-light), var(--accent), var(--primary));
    background-size: 400% 400%;
    animation: gradient-shift 3s ease infinite;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: 0 0 20px var(--primary)50;
    transition: box-shadow var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
    transition: transform var(--transition-fast);
}

.hover-rotate:hover {
    transform: rotate(5deg);
    transition: transform var(--transition-normal);
}

.hover-bounce:hover {
    animation: bounce 1s ease-in-out;
}

.hover-shake:hover {
    animation: shake 0.5s ease-in-out;
}

.hover-pulse:hover {
    animation: pulse 1s ease-in-out infinite;
}

.hover-neon:hover {
    animation: neon-glow 0.8s ease-in-out infinite alternate;
}

.text-type {
    overflow: hidden;
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    margin: 0 auto;
    animation: typewriter 3s steps(30, end), blinkCursor 0.75s step-end infinite;
}

.text-wave {
    display: inline-block;
}

.text-wave span {
    display: inline-block;
    animation: wave 2s ease-in-out infinite;
}

.text-wave span:nth-child(1) { animation-delay: 0s; }
.text-wave span:nth-child(2) { animation-delay: 0.1s; }
.text-wave span:nth-child(3) { animation-delay: 0.2s; }
.text-wave span:nth-child(4) { animation-delay: 0.3s; }
.text-wave span:nth-child(5) { animation-delay: 0.4s; }
.text-wave span:nth-child(6) { animation-delay: 0.5s; }
.text-wave span:nth-child(7) { animation-delay: 0.6s; }
.text-wave span:nth-child(8) { animation-delay: 0.7s; }
.text-wave span:nth-child(9) { animation-delay: 0.8s; }
.text-wave span:nth-child(10) { animation-delay: 0.9s; }

.loading-dots::after {
    content: '';
    animation: dots 2s infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60% {
        content: '...';
    }
    80%, 100% {
        content: '';
    }
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: particle-float 10s linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { left: 40%; animation-delay: 3s; }
.particle:nth-child(5) { left: 50%; animation-delay: 4s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; }
.particle:nth-child(7) { left: 70%; animation-delay: 6s; }
.particle:nth-child(8) { left: 80%; animation-delay: 7s; }
.particle:nth-child(9) { left: 90%; animation-delay: 8s; }

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.fade-in-up.animate {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

.fade-in-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

.fade-in-right.animate {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s ease-out;
}

.scale-in.animate {
    opacity: 1;
    transform: scale(1);
}

.stagger-in > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.stagger-in.animate > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-in.animate > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-in.animate > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-in.animate > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-in.animate > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-in.animate > *:nth-child(6) { transition-delay: 0.6s; }
.stagger-in.animate > *:nth-child(7) { transition-delay: 0.7s; }
.stagger-in.animate > *:nth-child(8) { transition-delay: 0.8s; }

.stagger-in.animate > * {
    opacity: 1;
    transform: translateY(0);
}

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-auto {
    will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-float,
    .animate-bounce,
    .animate-pulse,
    .animate-spin,
    .animate-ping,
    .animate-glow,
    .animate-shimmer {
        animation: none !important;
    }
}

.theme-transition {
    transition: 
        background-color var(--transition-normal),
        color var(--transition-normal),
        border-color var(--transition-normal),
        box-shadow var(--transition-normal);
}

.dynamic-glow {
    --glow-color: var(--primary);
    box-shadow: 0 0 20px var(--glow-color)50;
    transition: box-shadow var(--transition-normal);
}

.dynamic-scale {
    --scale-factor: 1;
    transform: scale(var(--scale-factor));
    transition: transform var(--transition-normal);
}

.dynamic-rotate {
    --rotation: 0deg;
    transform: rotate(var(--rotation));
    transition: transform var(--transition-normal);
}
