/* Mobile Performance Optimization CSS */

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    /* Optimize video performance */
    .bg-video {
        will-change: auto;
        transform: translateZ(0);
        backface-visibility: hidden;
    }
    
    /* Reduce animation complexity */
    .area-effect {
        transition: all 0.3s ease;
    }
    
    .area-effect:hover {
        transform: none !important;
    }
    
    /* Optimize text animations */
    .split-text {
        will-change: auto;
    }
    
    .split-line {
        transition: all 0.4s ease;
    }
    
    /* Optimize Swiper performance */
    .swiper-slide {
        will-change: auto;
        transform: translateZ(0);
    }
    
    .swiper-wrapper {
        transition-timing-function: ease-out;
    }
    
    /* Reduce shadow effects on mobile */
    .bs-light-mode {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Optimize counter animations */
    .odometer {
        transition: none !important;
    }
    
    /* Reduce complex transforms */
    .mobile-optimized {
        transform: none !important;
        filter: none !important;
    }
    
    /* Optimize background effects */
    .bg-shape {
        animation: none !important;
    }
    
    /* Reduce particle effects */
    .item-shape {
        animation-duration: 2s !important;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .tablet-optimized .area-effect {
        transition: all 0.4s ease;
    }
    
    .tablet-optimized .bg-video {
        will-change: transform;
    }
}

/* Low-end device optimizations */
.low-end-device {
    /* Disable heavy effects */
    .area-effect:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .bg-video {
        opacity: 0.8;
    }
    
    /* Reduce animation frequency */
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
}

/* Performance optimizations for all devices */
* {
    /* Optimize rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimize video elements */
video {
    object-fit: cover;
    will-change: auto;
}

/* Optimize images */
img {
    image-rendering: optimizeSpeed;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
}

/* Reduce repaints */
.fixed-element {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize scroll performance */
.scroll-container {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Mobile-specific performance tweaks */
@media (max-width: 768px) {
    /* Reduce complex CSS effects */
    .text_primary-color {
        text-shadow: none !important;
    }
    
    /* Optimize button animations */
    .tf-btn {
        transition: all 0.2s ease !important;
    }
    
    /* Reduce hover effects complexity */
    .hover-underline-link::after {
        transition: width 0.2s ease !important;
    }
    
    /* Optimize navigation */
    .nav-menu li {
        transition: all 0.2s ease !important;
    }
    
    /* Reduce animation delays */
    .scrolling-effect {
        animation-delay: 0s !important;
    }
    
    /* Optimize counter display */
    .counter-number {
        font-size: 2rem !important;
    }
    
    /* Reduce complex gradients */
    .bg-linear,
    .bg-linear-2 {
        background: linear-gradient(135deg, var(--Primary) 0%, var(--Secondary) 100%) !important;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .bg-video {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .bg-video {
        animation: none !important;
    }
}

/* Low performance mode styles */
.low-performance-mode {
    /* Disable complex animations */
    .area-effect:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    /* Reduce video effects */
    .bg-video {
        opacity: 0.7;
        filter: brightness(0.8);
    }
    
    /* Simplify text animations */
    .split-text {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Reduce Swiper complexity */
    .swiper-slide {
        transition: none !important;
    }
    
    /* Simplify counter animations */
    .odometer {
        transition: none !important;
    }
}

/* Additional mobile optimizations */
@media (max-width: 768px) {
    /* Optimize touch interactions */
    .swiper-container {
        touch-action: pan-y;
    }
    
    /* Reduce repaints on scroll */
    .fixed-element {
        transform: translate3d(0, 0, 0);
    }
    
    /* Optimize button interactions */
    .tf-btn:active {
        transform: scale(0.98);
    }
    
    /* Reduce complex shadows */
    .bs-light-mode {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }
}
