* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* فقط input ها و textarea ها قابل انتخاب */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* حذف outline در iOS */
* {
    outline: none;
    -webkit-appearance: none;
}

/* بهبود فونت rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* جلوگیری از bounce در iOS */
body {
    position: fixed;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

#app {
    width: 100%;
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Smooth scrolling */
* {
    scroll-behavior: smooth;
}

/* بهبود انیمیشن‌ها با GPU */
.animate-gpu {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

/* انیمیشن‌های صفحه */
.page-transition-enter {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition-leave {
    animation: slideOutLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* Pull to Refresh استایل */
.pull-to-refresh {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    transition: top 0.3s ease;
    z-index: 1000;
}

.pull-to-refresh.active {
    top: 20px;
}

/* Safe Area برای iPhone با notch */
body {
    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);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* بهبود دکمه‌ها */
button, a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button:active, a:active {
    transform: scale(0.97);
}

/* Haptic Feedback شبیه‌ساز */
.haptic-light:active {
    animation: hapticLight 0.1s;
}

.haptic-medium:active {
    animation: hapticMedium 0.15s;
}

@keyframes hapticLight {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.98); }
}

@keyframes hapticMedium {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.95); }
}

/* محو شدن splash screen */
#splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

#splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* بهبود scroll performance */
.scroll-container {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
}

/* لودینگ بهتر */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}