/* 🔄 أنماط التبديل التلقائي للمحتوى */

/* ===== تأثيرات التبديل العامة ===== */
.auto-switch-element {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: opacity, transform !important;
}

/* ===== تأثيرات نصوص البطل ===== */
.hero h1,
.hero p {
    transition: all 0.3s ease !important;
    will-change: opacity, transform !important;
}

.hero h1.switching,
.hero p.switching {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
}

/* ===== تأثيرات الإحصائيات ===== */
.stat {
    transition: all 0.3s ease !important;
    will-change: opacity, transform !important;
}

.stat.switching {
    opacity: 0 !important;
    transform: scale(0.8) !important;
}

.stat strong {
    transition: all 0.2s ease !important;
}

.stat span {
    transition: all 0.2s ease 0.1s !important;
}

/* ===== تأثيرات شارات الخدمات ===== */
.service-badge {
    transition: all 0.3s ease !important;
    will-change: opacity, transform !important;
}

.service-badge.switching {
    opacity: 0 !important;
    transform: translateX(-20px) !important;
}

/* ===== تأثيرات آراء العملاء ===== */
.testimonial-card {
    transition: all 0.6s ease !important;
    transform-style: preserve-3d !important;
    will-change: opacity, transform !important;
}

.testimonial-card.switching {
    opacity: 0 !important;
    transform: rotateY(90deg) !important;
}

/* ===== تأثيرات الكلمات المفتاحية ===== */
.hero-rotator {
    transition: all 0.2s ease !important;
    will-change: opacity, transform !important;
}

.hero-rotator.switching {
    opacity: 0 !important;
    transform: translateY(-10px) scale(0.9) !important;
}

/* ===== تأثيرات الأيقونات ===== */
.icon-container {
    transition: all 0.5s ease !important;
    will-change: background, transform !important;
}

.icon-container.color-switching {
    transform: scale(1.1) !important;
}

/* ===== حركات مخصصة للتبديل ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotateY(-90deg);
    }
    to {
        opacity: 1;
        transform: rotateY(0deg);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== تطبيق الحركات على العناصر ===== */
.hero h1.animate-in {
    animation: fadeInDown 0.5s ease-out !important;
}

.hero p.animate-in {
    animation: fadeInUp 0.5s ease-out 0.1s both !important;
}

.stat.animate-in {
    animation: scaleIn 0.4s ease-out !important;
}

.service-badge.animate-in {
    animation: fadeInLeft 0.3s ease-out !important;
}

.testimonial-card.animate-in {
    animation: rotateIn 0.6s ease-out !important;
}

.hero-rotator.animate-in {
    animation: bounceIn 0.4s ease-out !important;
}

.icon-container.animate-in {
    animation: scaleIn 0.3s ease-out !important;
}

/* ===== تحسينات للهاتف المحمول ===== */
@media (max-width: 768px) {
    
    /* تسريع الحركات على الهاتف */
    .auto-switch-element,
    .hero h1,
    .hero p,
    .stat,
    .service-badge,
    .testimonial-card,
    .hero-rotator,
    .icon-container {
        transition-duration: 0.2s !important;
    }
    
    /* تقليل شدة التأثيرات */
    .hero h1.switching,
    .hero p.switching {
        transform: translateY(-10px) !important;
    }
    
    .stat.switching {
        transform: scale(0.9) !important;
    }
    
    .service-badge.switching {
        transform: translateX(-10px) !important;
    }
    
    .testimonial-card.switching {
        transform: rotateY(45deg) !important;
    }
    
    .hero-rotator.switching {
        transform: translateY(-5px) scale(0.95) !important;
    }
}

/* ===== تحسينات الأداء ===== */
.auto-switch-element,
.hero h1,
.hero p,
.stat,
.service-badge,
.testimonial-card,
.hero-rotator,
.icon-container {
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
}

/* ===== إيقاف الحركات للمستخدمين الحساسين ===== */
@media (prefers-reduced-motion: reduce) {
    .auto-switch-element,
    .hero h1,
    .hero p,
    .stat,
    .service-badge,
    .testimonial-card,
    .hero-rotator,
    .icon-container {
        transition: opacity 0.1s ease !important;
        animation: none !important;
    }
    
    .hero h1.switching,
    .hero p.switching,
    .stat.switching,
    .service-badge.switching,
    .testimonial-card.switching,
    .hero-rotator.switching {
        transform: none !important;
    }
}

/* ===== تأثيرات خاصة للعناصر المميزة ===== */
.hero-badge {
    animation: pulse 2s infinite !important;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* ===== تأثيرات التدرج اللوني ===== */
.gradient-text {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #10b981, #f59e0b);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite !important;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ===== تأثيرات الظل المتحرك ===== */
.dynamic-shadow {
    animation: shadowPulse 2s ease-in-out infinite !important;
}

@keyframes shadowPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    50% {
        box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
    }
}

/* ===== تحسينات إضافية للتبديل ===== */
.switching-container {
    overflow: hidden !important;
    position: relative !important;
}

.switching-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent) !important;
    transform: translateX(-100%) !important;
    animation: shimmer 1s ease-out !important;
}

@keyframes shimmer {
    to {
        transform: translateX(100%) !important;
    }
}