/* AstroZiva Mobile & WebView 60fps Smoothness Optimization */
html, body {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
}

a, button, input, select, textarea, label, .btn, [role="button"], .nav-link, .dropdown-item {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

input, select, textarea {
    scroll-margin-top: 84px;
    scroll-margin-bottom: 140px;
}

/* Eliminate GPU blur overhead on Login / OTP modal backdrops on all viewports */
#global-login-modal,
#global-otp-modal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    overscroll-behavior: contain;
}

#global-login-modal {
    background: rgba(15, 23, 42, 0.78) !important;
}

#global-otp-modal {
    background: rgba(15, 23, 42, 0.76) !important;
}

/* Smooth scrolling inside modals */
#global-login-modal > div,
#global-otp-modal > div,
.modal-body,
.modal-content,
.gc-messages-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* While keyboard is active (typing in any input), pause background animations & drop heavy blurs/shadows */
html.az-keyboard-active *:not(.spinner-border):not(.spinner-grow):not(.fa-spin):not(.fa-pulse),
html.az-keyboard-active *::before,
html.az-keyboard-active *::after {
    animation-play-state: paused !important;
}

html.az-keyboard-active [style*="backdrop-filter"],
html.az-keyboard-active .navbar-custom,
html.az-keyboard-active .navbar-dark-custom,
html.az-keyboard-active .site-nav,
html.az-keyboard-active .modal-backdrop,
html.az-keyboard-active .global-chat-window,
html.az-keyboard-active .az-blur-orb,
html.az-keyboard-active [class*="glow"] {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.az-keyboard-active .stars-container,
html.az-keyboard-active #stars-container {
    visibility: hidden !important;
}

/* Mobile & AstroZiva WebView App frame-rate optimizations */
@media (max-width: 991px), (pointer: coarse) {
    .stars-container,
    #stars-container,
    #stars-container .star {
        animation: none !important;
        will-change: auto !important;
    }

    /* Disable costly backdrop-filter compositing layers on touch screens / WebView */
    .navbar-custom,
    .navbar-dark-custom,
    .navbar-glass,
    .hero-glass-card,
    .glass-card,
    .card-glass,
    .trust-pill,
    .az-glass,
    .modal-backdrop,
    #chatLoginModalOverlay,
    #chatDataCollectionModal,
    #chatBookingModalOverlay,
    #globalChatLoginModalOverlay,
    #globalChatDataCollectionModal,
    #globalChatBookingModalOverlay,
    [style*="backdrop-filter"] {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Reduce expensive large ambient blur radiuses on mobile GPUs */
    .hero-glow,
    .ambient-orb,
    .bg-orb {
        filter: none !important;
        opacity: 0.35 !important;
    }

    /* Replace expensive infinite transitions on interactive rows */
    .astro-card,
    .puja-card,
    .product-card,
    .global-otp-group,
    .btn,
    button {
        transition-duration: 0.14s !important;
    }
}

html.az-webview-app .stars-container,
html.az-webview-app #stars-container,
html.az-webview-app #stars-container .star {
    animation: none !important;
}
