/**
 * Touch Action Utilities
 * Prevents double-tap zoom and other unwanted touch behaviors
 * Requirements: 4.6, 4.8
 */

/* ============================================
   PREVENT DOUBLE-TAP ZOOM
   ============================================ */

/* Apply to all interactive elements by default */
button,
a,
input,
select,
textarea,
[role="button"],
[role="link"],
[tabindex]:not([tabindex="-1"]) {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Utility class to prevent double-tap zoom */
.no-double-tap-zoom {
    touch-action: manipulation;
}

/* Utility class to allow only panning (no zoom) */
.pan-only {
    touch-action: pan-x pan-y;
}

/* Utility class to allow only horizontal panning */
.pan-x-only {
    touch-action: pan-x;
}

/* Utility class to allow only vertical panning */
.pan-y-only {
    touch-action: pan-y;
}

/* Utility class to disable all touch actions */
.no-touch-action {
    touch-action: none;
}

/* Utility class to allow all touch actions (default) */
.touch-action-auto {
    touch-action: auto;
}

/* ============================================
   REMOVE TAP HIGHLIGHT
   ============================================ */

/* Remove default tap highlight on mobile browsers */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Custom tap highlight for specific elements if needed */
.tap-highlight {
    -webkit-tap-highlight-color: rgba(47, 111, 237, 0.1);
}

/* ============================================
   USER SELECT
   ============================================ */

/* Prevent text selection on interactive elements */
button,
[role="button"],
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection */
.user-select-text {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Allow all selection */
.user-select-all {
    -webkit-user-select: all;
    -moz-user-select: all;
    -ms-user-select: all;
    user-select: all;
}

/* ============================================
   CURSOR STYLES
   ============================================ */

/* Pointer cursor for interactive elements */
button,
a,
[role="button"],
[role="link"],
.cursor-pointer {
    cursor: pointer;
}

/* Default cursor */
.cursor-default {
    cursor: default;
}

/* Not-allowed cursor for disabled elements */
button:disabled,
[disabled],
.cursor-not-allowed {
    cursor: not-allowed;
}

/* ============================================
   PREVENT CALLOUT ON LONG PRESS (iOS)
   ============================================ */

/* Prevent iOS callout menu on long press */
button,
a,
img,
[role="button"],
.no-callout {
    -webkit-touch-callout: none;
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

/* Enable smooth scrolling for scroll containers */
.smooth-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Disable smooth scrolling if user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .smooth-scroll {
        scroll-behavior: auto;
    }
}

/* ============================================
   OVERSCROLL BEHAVIOR
   ============================================ */

/* Prevent overscroll bounce effect */
.no-overscroll {
    overscroll-behavior: none;
}

/* Contain overscroll within element */
.overscroll-contain {
    overscroll-behavior: contain;
}

/* Allow overscroll (default) */
.overscroll-auto {
    overscroll-behavior: auto;
}

/* ============================================
   SAFE AREA INSETS
   ============================================ */

/* Respect safe area insets (notches, home indicator) */
.safe-area-inset-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-inset-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-inset-left {
    padding-left: env(safe-area-inset-left);
}

.safe-area-inset-right {
    padding-right: env(safe-area-inset-right);
}

.safe-area-inset-all {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}
