/* Safari Performance Optimizations
 * This file reduces expensive CSS properties specifically for Safari
 * to improve scrolling and animation performance.
 */

@supports (-webkit-backdrop-filter: blur(1px)) {
    /* Reduce backdrop-filter blur values for Safari */

    /* Header - Reduce blur significantly */
    header {
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
    }

    header.scrolled {
        backdrop-filter: blur(3px) !important;
        -webkit-backdrop-filter: blur(3px) !important;
    }

    /* Mobile menu - Reduce blur */
    .mobile-menu {
        backdrop-filter: blur(8px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(8px) saturate(150%) !important;
    }

    /* Modals - Reduce blur */
    .repair-modal-overlay {
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
    }

    .gallery-modal-overlay {
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
    }

    /* Scroll to top button - Minimal blur */
    .scroll-to-top {
        backdrop-filter: blur(2px) !important;
        -webkit-backdrop-filter: blur(2px) !important;
    }

    /* Gallery overlays - Reduce blur */
    .gallery-item-overlay,
    .modal-item-overlay {
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
    }
}

/* Reduce box-shadow complexity for Safari */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {

        /* Safari-only: Simplify shadows */
        header {
            box-shadow: 0 1px 8px rgba(59, 130, 246, 0.08) !important;
        }

        header.scrolled {
            box-shadow: 0 2px 12px rgba(59, 130, 246, 0.12) !important;
        }

        /* Simplify card shadows */
        .review-card,
        .gallery-item,
        .modal-gallery-item {
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
        }

        .review-card:hover,
        .gallery-item:hover,
        .modal-gallery-item:hover {
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15) !important;
        }

        /* Simplify button shadows */
        .btn-primary,
        .cta-button {
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2) !important;
        }

        .btn-primary:hover,
        .cta-button:hover {
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
        }
    }
}

/* Disable expensive animations on Safari during scroll */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {

        /* Reduce transition complexity */
        * {
            will-change: auto !important;
        }

        /* Only allow will-change on actively animating elements */
        .carousel-slide.active,
        .modal-gallery-item:hover,
        header.scrolled {
            will-change: transform;
        }
    }
}