/* Enhanced touch scrolling styles for Flutter Web */

/* Base styles for better touch handling */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* Flutter target container */
#flutter_target {
  height: 100%;
  width: 100%;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* Scrollable elements */
.scrollable,
[data-scrollable="true"],
.flutter-scrollable {
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Prevent zoom on double tap */
* {
  touch-action: manipulation;
}

/* Ensure proper touch handling for form elements */
input,
textarea,
select,
button {
  touch-action: auto;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
  html,
  body {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }

  /* Improve touch targets */
  button,
  [role="button"],
  input[type="button"],
  input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
  }

  /* Better scroll performance */
  .scrollable {
    will-change: scroll-position;
    transform: translateZ(0);
  }
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  #flutter_target {
    overflow-x: hidden;
  }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  html,
  body {
    -webkit-overflow-scrolling: touch;
  }

  .scrollable {
    -webkit-overflow-scrolling: touch;
  }
}

/* Android Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .scrollable {
    -webkit-overflow-scrolling: touch;
  }
}
