/* تحسينات سلسة للواجهة */

/* تحسينات الخطوط */
* {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* تحسينات الانتقالات */
* {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* تحسينات التمرير */
html {
    scroll-behavior: smooth;
}

/* تحسينات الخلفية */
body {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

/* تحسينات البطاقات */
.product-card {
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

.product-card:hover {
    will-change: transform;
}

/* تحسينات الأزرار */
.whatsapp-btn,
.cart-btn,
.add-to-cart-btn,
.search-bar button {
    will-change: transform;
    backface-visibility: hidden;
}

/* تحسينات الصور */
.product-image img {
    will-change: transform;
    backface-visibility: hidden;
}

/* تحسينات النوافذ المنبثقة */
.cart,
.modal-content {
    will-change: transform;
    backface-visibility: hidden;
}

/* تحسينات النص */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 700;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* تحسينات الألوان */
:root {
    --smooth-primary: #8B4513;
    --smooth-secondary: #FF6B35;
    --smooth-whatsapp: #25D366;
    --smooth-success: #28a745;
    --smooth-warning: #ffc107;
    --smooth-danger: #dc3545;
    --smooth-light: #F5F5DC;
    --smooth-white: #ffffff;
    --smooth-dark: #2c3e50;
    --smooth-muted: #6c757d;
    --smooth-border: #dee2e6;
}

/* تحسينات الظلال */
.shadow-smooth {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shadow-smooth:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

/* تحسينات التدرجات */
.gradient-smooth {
    background: linear-gradient(135deg, var(--smooth-primary) 0%, var(--smooth-secondary) 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* تحسينات الحركة */
.smooth-motion {
    animation: smoothFloat 3s ease-in-out infinite;
}

@keyframes smoothFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* تحسينات النص المتحرك */
.text-smooth {
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from {
        text-shadow: 0 0 5px rgba(139, 69, 19, 0.5);
    }
    to {
        text-shadow: 0 0 20px rgba(139, 69, 19, 0.8);
    }
}

/* تحسينات الاستجابة */
@media (max-width: 768px) {
    .smooth-motion {
        animation: none;
    }
    
    .text-smooth {
        animation: none;
    }
}

/* تحسينات الأداء */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.will-change-auto {
    will-change: auto;
}

/* تحسينات الوصولية */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* تحسينات الطباعة */
@media print {
    .smooth-motion,
    .text-smooth,
    .gradient-smooth {
        animation: none !important;
    }
    
    .shadow-smooth {
        box-shadow: none !important;
    }
}

/* تحسينات الوضع المظلم */
@media (prefers-color-scheme: dark) {
    :root {
        --smooth-dark: #f8f9fa;
        --smooth-muted: #adb5bd;
        --smooth-light: #343a40;
    }
}

/* تحسينات الحركة المقللة */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .smooth-motion,
    .text-smooth,
    .gradient-smooth {
        animation: none !important;
    }
}

/* تحسينات التركيز */
.focus-smooth:focus {
    outline: 2px solid var(--smooth-primary);
    outline-offset: 2px;
}

/* تحسينات التحميل */
.loading-smooth {
    position: relative;
    overflow: hidden;
}

.loading-smooth::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: smoothShimmer 1.5s infinite;
}

@keyframes smoothShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}
