* {
-webkit-tap-highlight-color: transparent;
}

body { 
font-family: 'Vazir', sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
background-attachment: fixed;
min-height: 100vh;
/* بهینه‌سازی performance */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}

/* بهینه‌سازی موبایل */
@media (max-width: 768px) {
body {
    background-attachment: scroll; /* بهتر برای performance */
}
}

.glass-effect {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* بهینه‌سازی glass-effect در موبایل */
@media (max-width: 768px) {
.glass-effect {
    background: rgba(255, 255, 255, 0.98); /* کمتر blur = سریع‌تر */
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}
}

.pwa-card {
background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.95));
backdrop-filter: blur(10px);
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
border: 1px solid rgba(255, 255, 255, 0.3);
/* بهینه‌سازی rendering */
contain: layout style paint;
will-change: transform;
}

.pwa-card:hover {
transform: translateY(-8px) scale(1.02);
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
border-color: rgba(255, 255, 255, 0.6);
}

/* بهینه‌سازی موبایل */
@media (max-width: 768px) {
.pwa-card {
    background: rgba(255, 255, 255, 0.98); /* بدون gradient = سریع‌تر */
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    will-change: auto !important;
}
}

.pwa-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: 1.5rem;
padding: 2px;
background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0.1));
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
-webkit-mask-composite: xor;
mask-composite: exclude;
opacity: 0;
transition: opacity 0.4s;
}

.pwa-card:hover::before {
opacity: 1;
}

.category-btn {
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
overflow: hidden;
}

.category-btn::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
border-radius: 50%;
background: rgba(255, 255, 255, 0.3);
transform: translate(-50%, -50%);
transition: width 0.6s, height 0.6s;
}

.category-btn:hover::before {
width: 300px;
height: 300px;
}

.category-btn:active {
transform: scale(0.95);
}

.featured-badge {
animation: float 3s ease-in-out infinite;
background: linear-gradient(135deg, #ffd700, #ffed4e);
box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-5px); }
}

.icon-gradient {
background: linear-gradient(135deg, var(--icon-color-1), var(--icon-color-2));
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stats-card {
background: rgba(255, 255, 255, 0.15);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.3);
transition: all 0.3s ease;
}

.stats-card:hover {
background: rgba(255, 255, 255, 0.25);
transform: translateY(-2px);
}

/* بهینه‌سازی stats-card در موبایل */
@media (max-width: 768px) {
.stats-card {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    transition: none !important;
}
}

.search-container {
position: relative;
}

.search-container input {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
transition: all 0.3s ease;
}

.search-container input:focus {
background: rgba(255, 255, 255, 1);
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header-gradient {
background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
backdrop-filter: blur(20px);
}

@keyframes slideUp {
from {
    opacity: 0;
    transform: translateY(30px);
}
to {
    opacity: 1;
    transform: translateY(0);
}
}

.pwa-card {
animation: slideUp 0.6s ease forwards;
}

.pwa-card:nth-child(1) { animation-delay: 0.05s; }
.pwa-card:nth-child(2) { animation-delay: 0.1s; }
.pwa-card:nth-child(3) { animation-delay: 0.15s; }
.pwa-card:nth-child(4) { animation-delay: 0.2s; }
.pwa-card:nth-child(5) { animation-delay: 0.25s; }
.pwa-card:nth-child(6) { animation-delay: 0.3s; }
.pwa-card:nth-child(7) { animation-delay: 0.35s; }
.pwa-card:nth-child(8) { animation-delay: 0.4s; }

.scrollbar-hide::-webkit-scrollbar {
display: none;
}
.scrollbar-hide {
-ms-overflow-style: none;
scrollbar-width: none;
}

.avatar-gradient {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-modern {
position: relative;
overflow: hidden;
transition: all 0.3s ease;
}

.btn-modern:hover {
transform: translateY(-2px);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.btn-modern:active {
transform: translateY(0);
}

/* Safe area for iOS */
.safe-area-bottom {
padding-bottom: env(safe-area-inset-bottom);
}

/* ==================== MOBILE OPTIMIZATIONS ==================== */
@media (max-width: 768px) {
/* حذف تمام انیمیشن‌ها در موبایل */
.pwa-card {
    animation: none !important;
    transition: none !important;
}

.pwa-card:hover {
    transform: none !important;
}

.category-btn {
    animation: none !important;
}

.featured-badge {
    animation: none !important;
}

/* کاهش backdrop-filter (سنگین است) */
.glass-effect {
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

/* بهینه‌سازی transform */
* {
    will-change: auto !important;
}

/* کاهش shadow برای performance */
.pwa-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* حذف hover effects */
.pwa-card:hover::before {
    display: none !important;
}

/* بهینه‌سازی font loading */
body {
    font-display: swap;
}

/* کاهش opacity transitions */
* {
    transition-duration: 0.1s !important;
    transition-property: opacity, transform !important;
}

/* حذف decorative elements */
.bg-decoration {
    display: none !important;
}

/* حذف hover effects در موبایل */
.category-btn:hover::before {
    display: none !important;
}

.stats-card:hover {
    transform: none !important;
}

/* کاهش complexity در Popular section */
.popular-section {
    display: none !important;
}

/* بهینه‌سازی search input */
.search-container input {
    backdrop-filter: blur(3px) !important;
}

/* کاهش shadow complexity */
.pwa-card,
.glass-effect,
.category-btn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}
}

/* Performance optimizations */
@media (max-width: 768px) {
/* CSS Containment برای بهینه‌سازی rendering */
.pwa-card {
    contain: layout style paint;
    content-visibility: auto;
}

/* GPU acceleration فقط برای transform */
.pwa-card {
    transform: translateZ(0);
}

/* کاهش repaints */
.stats-card {
    will-change: auto;
}

/* بهینه‌سازی font rendering */
body, * {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeSpeed;
}

/* کاهش reflow */
.container {
    contain: layout;
}

/* Lazy load images */
img {
    loading: lazy;
    decoding: async;
}

/* بهینه‌سازی scroll */
* {
    scroll-behavior: auto !important;
}
}

/* Critical CSS - فقط برای موبایل */
@media (max-width: 768px) {
/* حذف تمام effects غیرضروری */
.pwa-card::before,
.pwa-card::after,
.category-btn::before,
.category-btn::after {
    display: none !important;
}
}
