/* Animation Keyframes */

/* Background Animations */
@keyframes gradientShift {
    0%, 100% { 
        background: linear-gradient(45deg, #1a1a2e, #16213e, #0f0f23);
    }
    25% { 
        background: linear-gradient(45deg, #16213e, #0f0f23, #1a1a2e);
    }
    50% { 
        background: linear-gradient(45deg, #0f0f23, #1a1a2e, #16213e);
    }
    75% { 
        background: linear-gradient(45deg, #1a1a2e, #16213e, #0f0f23);
    }
}

@keyframes floatingParticles {
    0%, 100% { 
        transform: translateY(0px) translateX(0px);
    }
    33% { 
        transform: translateY(-20px) translateX(10px);
    }
    66% { 
        transform: translateY(10px) translateX(-10px);
    }
}

/* Entry Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

/* Interactive Animations */
@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes heartbeat {
    0%, 100% { 
        transform: scale(1);
    }
    14% { 
        transform: scale(1.1);
    }
    28% { 
        transform: scale(1);
    }
    42% { 
        transform: scale(1.1);
    }
    70% { 
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { 
        transform: translateY(0);
    }
    40% { 
        transform: translateY(-10px);
    }
    60% { 
        transform: translateY(-5px);
    }
}

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

@keyframes wobble {
    0% { 
        transform: translateX(0%);
    }
    15% { 
        transform: translateX(-25%) rotate(-5deg);
    }
    30% { 
        transform: translateX(20%) rotate(3deg);
    }
    45% { 
        transform: translateX(-15%) rotate(-3deg);
    }
    60% { 
        transform: translateX(10%) rotate(2deg);
    }
    75% { 
        transform: translateX(-5%) rotate(-1deg);
    }
    100% { 
        transform: translateX(0%);
    }
}

@keyframes swing {
    20% { 
        transform: rotate(15deg);
    }
    40% { 
        transform: rotate(-10deg);
    }
    60% { 
        transform: rotate(5deg);
    }
    80% { 
        transform: rotate(-5deg);
    }
    100% { 
        transform: rotate(0deg);
    }
}

/* Phone and Device Animations */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px);
    }
    50% { 
        transform: translateY(-15px);
    }
}

@keyframes phoneGlow {
    0%, 100% { 
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    }
    50% { 
        box-shadow: 0 25px 60px rgba(255, 107, 107, 0.3), 0 0 30px rgba(78, 205, 196, 0.2);
    }
}

@keyframes screenFlicker {
    0%, 100% { 
        opacity: 1;
    }
    50% { 
        opacity: 0.95;
    }
}

/* Progress and Loading Animations */
@keyframes progressFill {
    0% { 
        width: 0%;
        opacity: 0.5;
    }
    50% { 
        width: 100%;
        opacity: 1;
    }
    100% { 
        width: 0%;
        opacity: 0.5;
    }
}

@keyframes progressPulse {
    0%, 100% { 
        background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    }
    50% { 
        background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    }
}

@keyframes loadingDots {
    0%, 80%, 100% { 
        transform: scale(0);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes spinner {
    0% { 
        transform: rotate(0deg);
    }
    100% { 
        transform: rotate(360deg);
    }
}

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

/* Text Animations */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% { 
        border-color: transparent;
    }
    51%, 100% { 
        border-color: #4ecdc4;
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 5px rgba(78, 205, 196, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(78, 205, 196, 0.8), 0 0 30px rgba(255, 107, 107, 0.3);
    }
}

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

/* Number Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI Assistant Animations */
@keyframes assistantPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.4;
    }
}

@keyframes assistantBounce {
    0%, 20%, 50%, 80%, 100% { 
        transform: translateY(0);
    }
    40% { 
        transform: translateY(-8px);
    }
    60% { 
        transform: translateY(-4px);
    }
}

@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Feature Card Animations */
@keyframes cardHover {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-10px);
    }
}

@keyframes iconRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Demo Animations */
@keyframes demoSuccess {
    0% {
        background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    }
    50% {
        background: linear-gradient(135deg, #51cf66, #69db7c);
    }
    100% {
        background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    }
}

@keyframes demoAnalyzing {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.05) rotate(5deg);
    }
    50% {
        transform: scale(1.1) rotate(-5deg);
    }
    75% {
        transform: scale(1.05) rotate(5deg);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Navigation Animations */
@keyframes navSlideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes navSlideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

/* Mobile Menu Animations */
@keyframes mobileMenuSlide {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes hamburgerToX {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(45deg);
    }
}

/* Testimonial Animations */
@keyframes testimonialSlide {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Download Button Animations */
@keyframes downloadPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 107, 107, 0);
    }
}

/* Utility Animation Classes */
.animate-fadeInUp {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.8s ease forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.8s ease forwards;
}

.animate-fadeIn {
    animation: fadeIn 1s ease forwards;
}

.animate-slideInUp {
    animation: slideInUp 0.6s ease forwards;
}

.animate-zoomIn {
    animation: zoomIn 0.5s ease forwards;
}

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

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

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

.animate-heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

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

.animate-wobble {
    animation: wobble 1s ease-in-out;
}

.animate-swing {
    animation: swing 1s ease-in-out;
}

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

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

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

.animate-gradient {
    background-size: 400% 400%;
    animation: gradient 3s ease infinite;
}

.animate-countUp {
    animation: countUp 0.6s ease forwards;
}

.animate-iconRotate {
    animation: iconRotate 0.3s ease;
}

.animate-iconPulse {
    animation: iconPulse 0.3s ease;
}

.animate-ripple {
    animation: ripple 0.6s linear;
}

/* Animation Delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* Animation Durations */
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }
.duration-1500 { animation-duration: 1.5s; }
.duration-2000 { animation-duration: 2s; }
.duration-3000 { animation-duration: 3s; }

/* Apply Animations to Elements */
.bg-animation {
    animation: gradientShift 8s ease infinite;
}

.phone-mockup {
    animation: float 4s ease-in-out infinite;
}

.phone-mockup:hover {
    animation: float 4s ease-in-out infinite, phoneGlow 2s ease-in-out;
}

.posture-demo {
    animation: pulse 2s ease-in-out infinite;
}

.progress-fill {
    animation: progressFill 3s ease-in-out infinite;
}

.ai-assistant {
    animation: assistantBounce 3s ease-in-out infinite;
}

.assistant-pulse {
    animation: assistantPulse 2s ease-in-out infinite;
}

.status-indicator {
    animation: pulse 2s ease-in-out infinite;
}

.demo-icon {
    transition: transform 0.3s ease;
}

.demo-item:hover .demo-icon {
    animation: iconPulse 0.6s ease;
}

.feature-icon {
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    animation: iconRotate 0.8s ease;
}

.section-title {
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 4s ease infinite;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.3s ease;
}

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

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.4);
}

/* 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;
    }
    
    .bg-animation {
        animation: none;
    }
    
    .phone-mockup,
    .posture-demo,
    .ai-assistant,
    .assistant-pulse {
        animation: none;
    }
}