/* ==========================================================================
   ZIRA Animations - Keyframes & Utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   Keyframe Animations
   -------------------------------------------------------------------------- */

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Glow Pulse Animation */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px var(--color-primary-glow);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 40px var(--color-primary-glow), 0 0 60px var(--color-primary-glow);
        opacity: 0.8;
    }
}

/* Orb Pulse Animation - Softer */
@keyframes orb-pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.08);
    }
}

/* Core Glow Animation - Gentler */
@keyframes core-glow {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* Rotate Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Rotate Reverse */
@keyframes rotate-reverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

/* Fade In */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade In Up */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Scale */
@keyframes fade-in-scale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In Left */
@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide In Right */
@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-10px);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

/* Spin */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Wave Animation */
@keyframes wave {
    0% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-5px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(5px);
    }
    100% {
        transform: translateY(0);
    }
}

/* Breathing Animation - For subtle ambient effects */
@keyframes breathing {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Gradient Shift */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Border Glow */
@keyframes border-glow {
    0%, 100% {
        border-color: var(--color-primary);
        box-shadow: 0 0 10px var(--color-primary-glow);
    }
    50% {
        border-color: var(--color-secondary);
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    }
}

/* Line Extend */
@keyframes line-extend {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Scale In */
@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Flip */
@keyframes flip {
    from {
        transform: perspective(400px) rotateY(0);
    }
    to {
        transform: perspective(400px) rotateY(360deg);
    }
}

/* Shake */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Ping (like radar ping) */
@keyframes ping {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Blink */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Ripple */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Countdown Tick */
@keyframes tick {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Particle Float */
@keyframes particle-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    25% {
        transform: translate(10px, -20px) scale(1.2);
        opacity: 0.6;
    }
    50% {
        transform: translate(-5px, -10px) scale(0.8);
        opacity: 0.4;
    }
    75% {
        transform: translate(15px, -5px) scale(1.1);
        opacity: 0.5;
    }
}

/* Atmosphere Shift - Very subtle background movement */
@keyframes atmosphere-shift {
    0%, 100% {
        opacity: 0.03;
        transform: translate(0, 0);
    }
    33% {
        opacity: 0.05;
        transform: translate(10px, -10px);
    }
    66% {
        opacity: 0.04;
        transform: translate(-10px, 10px);
    }
}

/* Nebula Pulse */
@keyframes nebula-pulse {
    0%, 100% {
        opacity: 0.1;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.15;
        transform: scale(1.05) rotate(180deg);
    }
}

/* --------------------------------------------------------------------------
   Animation Utility Classes
   -------------------------------------------------------------------------- */

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}

.animate-orb-pulse {
    animation: orb-pulse 8s ease-in-out infinite;
}

.animate-core-glow {
    animation: core-glow 4s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 20s linear infinite;
}

.animate-rotate-reverse {
    animation: rotate-reverse 30s linear infinite;
}

.animate-fade-in {
    animation: fade-in 0.6s ease-out forwards;
}

.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out forwards;
}

.animate-fade-in-down {
    animation: fade-in-down 0.8s ease-out forwards;
}

.animate-fade-in-scale {
    animation: fade-in-scale 0.5s ease-out forwards;
}

.animate-slide-in-left {
    animation: slide-in-left 0.8s ease-out forwards;
}

.animate-slide-in-right {
    animation: slide-in-right 0.8s ease-out forwards;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-wave {
    animation: wave 2s ease-in-out infinite;
}

.animate-breathing {
    animation: breathing 4s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

.animate-border-glow {
    animation: border-glow 3s ease-in-out infinite;
}

.animate-line-extend {
    animation: line-extend 2s ease-out forwards;
}

.animate-scale-in {
    animation: scale-in 0.4s ease-out forwards;
}

.animate-flip {
    animation: flip 1s ease-in-out;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-ping {
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.animate-blink {
    animation: blink 1s step-end infinite;
}

.animate-tick {
    animation: tick 0.3s ease-out;
}

.animate-particle-float {
    animation: particle-float 10s ease-in-out infinite;
}

.animate-atmosphere {
    animation: atmosphere-shift 20s ease-in-out infinite;
}

.animate-nebula {
    animation: nebula-pulse 15s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Animation Delays
   -------------------------------------------------------------------------- */

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }
.delay-900 { animation-delay: 900ms; }
.delay-1000 { animation-delay: 1000ms; }

.delay-1s { animation-delay: 1s; }
.delay-2s { animation-delay: 2s; }
.delay-3s { animation-delay: 3s; }
.delay-4s { animation-delay: 4s; }
.delay-5s { animation-delay: 5s; }

/* --------------------------------------------------------------------------
   Animation Duration Utilities
   -------------------------------------------------------------------------- */

.duration-fast { animation-duration: 150ms; }
.duration-normal { animation-duration: 300ms; }
.duration-slow { animation-duration: 500ms; }
.duration-slower { animation-duration: 750ms; }
.duration-slowest { animation-duration: 1000ms; }

/* --------------------------------------------------------------------------
   Transition Utilities
   -------------------------------------------------------------------------- */

.transition-all {
    transition: all var(--transition-base);
}

.transition-colors {
    transition: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base);
}

.transition-transform {
    transition: transform var(--transition-base);
}

.transition-opacity {
    transition: opacity var(--transition-base);
}

.transition-shadow {
    transition: box-shadow var(--transition-base);
}

.transition-none {
    transition: none;
}

/* --------------------------------------------------------------------------
   Hover Transform Effects
   -------------------------------------------------------------------------- */

.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-grow {
    transition: transform var(--transition-base);
}

.hover-grow:hover {
    transform: scale(1.1);
}

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   Stagger Animation Helper (for JavaScript to use)
   -------------------------------------------------------------------------- */

[data-animate] {
    opacity: 0;
}

[data-animate="fade-in-up"] {
    transform: translateY(30px);
}

[data-animate="fade-in-left"] {
    transform: translateX(-30px);
}

[data-animate="fade-in-right"] {
    transform: translateX(30px);
}

[data-animate].animated {
    opacity: 1;
    transform: translate(0, 0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* --------------------------------------------------------------------------
   Reduced Motion Support
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
