/* 
 * ANIMATIONS
 * All animation definitions and keyframes
 */

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Slide Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shimmer Effect for Placeholders */
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -30px, 0);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0,-4px,0);
    }
}

/* Fade In Classes */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.fade-in-right {
    animation: slideInRight 0.8s ease-out forwards;
}

/* Hover Animations */
.hover-lift {
    transition: var(--transition-smooth);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-scale {
    transition: var(--transition-smooth);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: var(--transition-smooth);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(255, 95, 7, 0.3);
}

/* Utility Animation Classes */
.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 1s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Delayed Animation Classes */
.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; }

/* Page Transition Effects */
.page-enter {
    animation: fadeInUp 0.6s ease-out;
}

.page-exit {
    animation: fadeInUp 0.6s ease-out reverse;
}

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Scroll-triggered Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Interactive Element Animations */
.button-press {
    transition: var(--transition-smooth);
}

.button-press:active {
    transform: scale(0.95);
}

.card-flip {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card-flip.flipped {
    transform: rotateY(180deg);
}

/* Success/Error State Animations */
.success-animation {
    animation: pulse 0.5s ease-in-out, bounce 0.8s ease-in-out 0.5s;
}

.error-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Typing Indicator Animation */
@keyframes typingDots {
    0%, 60%, 100% {
        transform: initial;
    }
    30% {
        transform: translateY(-10px);
    }
}

.typing-dots {
    position: relative;
    display: inline-block;
}

.typing-dots::after {
    content: '●●●';
    display: inline-block;
    animation: typingPulse 1.4s infinite;
    margin-left: 5px;
}

@keyframes typingPulse {
    0%, 60%, 100% {
        opacity: 0.4;
    }
    30% {
        opacity: 1;
    }
}

/* Chat Message Slide Animations */
.chat-message-user {
    animation: slideInRight 0.3s ease-out;
}

.chat-message-ai {
    animation: slideInLeft 0.3s ease-out;
}

/* Mobile-specific Animations */
@media (max-width: 768px) {
    /* Reduce motion for mobile performance */
    .hero-text h1 {
        animation-duration: 0.8s;
    }
    
    .solution-card:hover {
        transform: translateY(-5px); /* Reduced from -10px */
    }
    
    /* Disable complex animations on mobile */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}
