/* ===== Creative Animations for Industrial Production Analytics ===== */

/* ===== Scroll-triggered animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

/* Elements that animate on scroll */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.animated {
    opacity: 1;
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-left {
    opacity: 0;
}

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

.animate-right {
    opacity: 0;
}

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

/* ===== Counter animation (metrics) ===== */
@keyframes countUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

/* ===== Hero section animations ===== */
@keyframes heroTextSlide {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes heroSubtitleFade {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    animation: heroTextSlide 1s ease-out 0.3s both;
}

.hero-subtitle {
    animation: heroSubtitleFade 1.2s ease-out 0.6s both;
}

/* ===== Animated background shapes ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes floatReverse {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(20px) rotate(-5deg);
    }
}

.animated-shape {
    animation: float 6s ease-in-out infinite;
}

.animated-shape-reverse {
    animation: floatReverse 8s ease-in-out infinite;
}

/* ===== Service cards creative animations ===== */
.service-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* ===== Icon animations ===== */
@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.service-icon {
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    animation: iconPulse 1s ease-in-out infinite;
    transform: rotate(5deg);
}

/* ===== Progress bars and charts ===== */
@keyframes progressFill {
    from {
        width: 0;
    }
}

.progress-bar {
    animation: progressFill 2s ease-out forwards;
}

/* ===== Button animations ===== */
@keyframes buttonShimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.btn-primary {
    position: relative;
    overflow: hidden;
    background: var(--gradient-primary);
    background-size: 200% 100%;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-colored);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ===== Form field animations ===== */
.form-field {
    transition: all 0.3s ease;
}

.form-field:focus {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(0,102,204,0.2);
}

/* ===== Modal animations ===== */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

/* ===== Number counting animation ===== */
@keyframes numberCount {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number {
    animation: numberCount 0.8s ease-out;
}

/* ===== Process flow animations ===== */
@keyframes processFlow {
    0% {
        stroke-dashoffset: 1000;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.process-line {
    stroke-dasharray: 1000;
    animation: processFlow 3s ease-in-out forwards;
}

/* ===== Page load animation ===== */
@keyframes pageLoad {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

body {
    animation: pageLoad 0.6s ease-out;
}

/* ===== Disable animations on mobile devices ===== */
@media (max-width: 768px) {
    body {
        animation: none !important;
    }
    
    .hero-title {
        animation: none !important;
    }
    
    .hero-subtitle {
        animation: none !important;
    }
    
    .animate-on-scroll {
        opacity: 1 !important;
        transition: none !important;
    }
    
    .animate-on-scroll.animated {
        animation: none !important;
    }
    
    .animate-left {
        opacity: 1 !important;
    }
    
    .animate-left.animated {
        animation: none !important;
    }
    
    .animate-right {
        opacity: 1 !important;
    }
    
    .animate-right.animated {
        animation: none !important;
    }
    
    .counter-animate {
        animation: none !important;
    }
    
    .animated-shape {
        animation: none !important;
    }
    
    .animated-shape-reverse {
        animation: none !important;
    }
    
    .stat-number {
        animation: none !important;
    }
    
    .progress-bar {
        animation: none !important;
    }
    
    .modal-content {
        animation: none !important;
    }
    
    .process-line {
        animation: none !important;
    }
}

/* ===== Accessibility - Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

