/* Scroll Performance Optimizations */

/* Enable hardware acceleration */
* {
  -webkit-transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  -webkit-perspective: 1000;
}

/* Optimize scrolling containers */
.scroll-container,
.flt-scene-host,
.flt-scene,
flt-scene-host,
flt-scene {
  will-change: scroll-position;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Reduce repaints during scroll */
.scroll-view {
  contain: layout style paint;
}

/* Optimize fixed elements */
.fixed-element {
  will-change: transform;
  transform: translateZ(0);
}

/* Smooth scrolling with GPU acceleration */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Optimize Flutter canvas */
canvas {
  will-change: transform;
  image-rendering: auto;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  image-rendering: -webkit-optimize-contrast;
}

/* Reduce layout thrashing */
.no-layout-shift {
  contain: layout;
  content-visibility: auto;
}

/* Optimize list performance */
.list-item {
  contain: layout style paint;
  content-visibility: auto;
}

/* Disable hover effects during scroll */
body.is-scrolling * {
  pointer-events: none !important;
}

/* Optimize images */
img {
  will-change: transform;
  transform: translateZ(0);
}

/* Reduce paint areas */
.optimized-paint {
  isolation: isolate;
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
  * {
    -webkit-tap-highlight-color: transparent;
  }
  
  body {
    -webkit-touch-callout: none;
  }
}

/* Fix for passive event listeners */
.flt-scene-host,
flt-scene-host,
.flt-scene,
flt-scene {
  touch-action: none;
}

/* Ensure Flutter can handle all touch events */
body {
  touch-action: none;
  overscroll-behavior: none;
}