/* أنيميشنز وتحسينات إضافية */

/* أنيميشن الظهور */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* تطبيق الأنيميشنز */
.header-content {
    animation: fadeInDown 0.8s ease-out;
}

.search-content h2 {
    animation: fadeInUp 0.6s ease-out;
}

.search-content p {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.search-bar {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.categories {
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.product-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

/* تأثيرات تفاعلية */
.whatsapp-btn:hover {
    animation: pulse 0.6s ease-in-out;
}

.cart-btn:hover {
    animation: bounce 0.6s ease-in-out;
}

.category-btn:hover {
    animation: pulse 0.3s ease-in-out;
}

.add-to-cart-btn:hover {
    animation: bounce 0.4s ease-in-out;
}

/* تأثير التحميل */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::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: shimmer 1.5s infinite;
}

/* تأثيرات النص */
.text-glow {
    text-shadow: 0 0 10px rgba(139, 69, 19, 0.5);
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* تأثيرات الخلفية */
.bg-pattern {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(139, 69, 19, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(160, 82, 45, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(205, 133, 63, 0.1) 0%, transparent 50%);
}

/* تأثيرات البطاقات */
.card-hover-effect {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-effect:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* تأثيرات الأزرار */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
}

.btn-hover-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-hover-effect:hover::before {
    left: 100%;
}

/* تأثيرات الصور */
.image-zoom {
    transition: transform 0.4s ease;
}

.image-zoom:hover {
    transform: scale(1.1);
}

/* تأثيرات النوافذ المنبثقة */
.modal-enter {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* تأثيرات التنبيهات */
.notification-enter {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* تأثيرات التحميل */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* تأثيرات النص المتحرك */
.text-animate {
    animation: textSlide 0.5s ease-out;
}

@keyframes textSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تأثيرات التدرج المتحرك */
.gradient-animate {
    background: linear-gradient(-45deg, #8B4513, #A0522D, #CD853F, #DEB887);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* تأثيرات الظلال المتحركة */
.shadow-animate {
    animation: shadowPulse 2s ease-in-out infinite;
}

@keyframes shadowPulse {
    0% {
        box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    }
    50% {
        box-shadow: 0 8px 25px rgba(139, 69, 19, 0.5);
    }
    100% {
        box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
    }
}
