/**
 * Mobile Stability & Performance CSS
 * Prevents crashes, improves rendering
 */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Prevent layout shifts */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Optimize rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* GPU acceleration for animations */
.card,
.tab-btn,
button,
.stat-card {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* Prevent text selection issues on mobile */
button,
.tab-btn,
.download-banner {
    -webkit-user-select: none;
    user-select: none;
}

/* Fix iOS input zoom */
input,
select,
textarea {
    font-size: 16px !important;
    -webkit-appearance: none;
    appearance: none;
}

/* Prevent bounce scroll on iOS */
body {
    overscroll-behavior-y: contain;
}

/* Fix button active states on mobile */
button:active,
.tab-btn:active {
    opacity: 0.8;
    transform: scale(0.98);
}

/* Optimize images for mobile */
img {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
}

/* Reduce motion for better performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    /* Reduce complexity on mobile */
    * {
        will-change: auto;
    }
    
    /* Only animate what's necessary */
    .card {
        transition: none;
    }
    
    /* Larger touch targets */
    button,
    .tab-btn,
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Fix sticky positioning */
    .download-banner {
        position: -webkit-sticky;
        position: sticky;
    }
    
    /* Prevent text overflow */
    .address,
    [id$="Link"] {
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-all;
    }
}

/* Pull-to-refresh visual feedback */
@keyframes refresh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Prevent crashes from large content */
.card,
.tab-content {
    contain: layout style paint;
}

/* Optimize font loading */
@font-face {
    font-display: swap;
}




