/* Mobile Performance Optimizations */

/* Reduce animations on low-end devices */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
    /* Simplified animations for mobile */
    .feature-card,
    .testimonial-card,
    .pricing-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .feature-card:hover,
    .testimonial-card:hover,
    .pricing-card:hover {
        transform: translateY(-2px);
    }
    
    /* Reduce complex animations */
    .animate-in {
        animation: fadeInUp 0.4s ease-out;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* GPU acceleration for smooth scrolling */
@media (max-width: 768px) {
    .navbar,
    .nav-menu,
    .hero,
    .feature-card,
    .testimonial-card,
    .pricing-card {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        will-change: transform;
    }
    
    /* Optimize scroll performance */
    .nav-menu {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
    
    /* Reduce repaints */
    .btn {
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }
}

/* Critical CSS for above-the-fold content */
@media (max-width: 768px) {
    /* Inline critical styles for faster loading */
    .hero {
        background: linear-gradient(to bottom, #ffffff, #f9fafb);
        min-height: 60vh;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.1;
        font-weight: 800;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.4;
        color: #6b7280;
    }
    
    .btn-primary {
        background: #2563eb;
        color: #ffffff;
        border: none;
        padding: 12px 24px;
        border-radius: 8px;
        font-weight: 600;
        text-decoration: none;
        display: inline-block;
        transition: background-color 0.2s ease;
    }
    
    .btn-primary:hover {
        background: #1e40af;
    }
}

/* Lazy loading optimization */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Reduce layout shifts */
@media (max-width: 768px) {
    img {
        height: auto;
        max-width: 100%;
    }
    
    /* Reserve space for dynamic content */
    .stat-number {
        min-height: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .feature-icon {
        width: 3rem;
        height: 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Memory optimization */
@media (max-width: 768px) {
    /* Reduce shadow complexity */
    .card,
    .feature-card,
    .testimonial-card,
    .pricing-card {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    /* Simplify gradients */
    .gradient-text {
        background: #2563eb;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    /* Optimize backdrop filters */
    .navbar {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover states that don't work on touch */
    .feature-card:hover,
    .testimonial-card:hover,
    .pricing-card:hover {
        transform: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    /* Optimize touch targets */
    .btn,
    .nav-menu a,
    .accordion-header {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Add touch feedback */
    .btn:active {
        transform: scale(0.98);
    }
    
    .nav-menu a:active {
        background: rgba(37, 99, 235, 0.1);
    }
}

/* Network-aware optimizations */
@media (max-width: 768px) and (prefers-reduced-data: reduce) {
    /* Reduce data usage for slow connections */
    .hero {
        background: #f9fafb;
    }
    
    .gradient-text {
        color: #2563eb;
        background: none;
        -webkit-text-fill-color: initial;
    }
    
    /* Disable non-essential animations */
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Battery optimization */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    /* Disable all animations to save battery */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* Remove parallax and complex effects */
    .hero {
        background-attachment: scroll;
    }
}