/* 
 * animate.css - https://animate.style/
 * Version - 4.1.1 (تحسين)
 * Licensed under the MIT license - http://opensource.org/licenses/MIT
 *
 * Copyright (c) 2020 Animate.css
 * تم تحسينه في 2025
 */

:root {
  /* متغيرات أساسية للتحكم بالتأثيرات */
  --animate-duration: 1s;
  --animate-delay: 1s;
  --animate-repeat: 1;
  
  /* متغيرات إضافية للمزيد من الخيارات */
  --animate-easing: ease;
  --animate-distance-small: 10px;
  --animate-distance-medium: 20px;
  --animate-distance-large: 50px;
  --animate-scale-small: 0.9;
  --animate-scale-medium: 0.75;
  --animate-scale-large: 0.5;
}

/*
 * فئة الرسوم المتحركة الأساسية
 * يتم تطبيقها على جميع العناصر التي تحتاج إلى تحريك
 */
.animate__animated {
  animation-duration: 1s;
  animation-duration: var(--animate-duration);
  animation-fill-mode: both;
  will-change: transform, opacity; /* تحسين أداء GPU */
}

/* 
 * تعديلات مدة الأنيميشن 
 */
.animate__animated.animate__faster {
  animation-duration: 0.5s;
  animation-duration: calc(var(--animate-duration) / 2);
}

.animate__animated.animate__fast {
  animation-duration: 0.8s;
  animation-duration: calc(var(--animate-duration) * 0.8);
}

.animate__animated.animate__slow {
  animation-duration: 2s;
  animation-duration: calc(var(--animate-duration) * 2);
}

.animate__animated.animate__slower {
  animation-duration: 3s;
  animation-duration: calc(var(--animate-duration) * 3);
}

/*
 * تكرار الأنيميشن
 */
.animate__animated.animate__infinite {
  animation-iteration-count: infinite;
}

.animate__animated.animate__repeat-1 {
  animation-iteration-count: 1;
  animation-iteration-count: var(--animate-repeat);
}

.animate__animated.animate__repeat-2 {
  animation-iteration-count: 2;
  animation-iteration-count: calc(var(--animate-repeat) * 2);
}

.animate__animated.animate__repeat-3 {
  animation-iteration-count: 3;
  animation-iteration-count: calc(var(--animate-repeat) * 3);
}

/*
 * تأخير الأنيميشن
 */
.animate__animated.animate__delay-1s {
  animation-delay: 1s;
  animation-delay: var(--animate-delay);
}

.animate__animated.animate__delay-2s {
  animation-delay: 2s;
  animation-delay: calc(var(--animate-delay) * 2);
}

.animate__animated.animate__delay-3s {
  animation-delay: 3s;
  animation-delay: calc(var(--animate-delay) * 3);
}

.animate__animated.animate__delay-4s {
  animation-delay: 4s;
  animation-delay: calc(var(--animate-delay) * 4);
}

.animate__animated.animate__delay-5s {
  animation-delay: 5s;
  animation-delay: calc(var(--animate-delay) * 5);
}

/*
 * تكييف للمستخدمين الذين يفضلون تقليل الحركة
 * يتبع إرشادات الوصول WCAG 2.1
 */
@media (prefers-reduced-motion: reduce), print {
  .animate__animated {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  
  .animate__animated[class*=Out] {
    opacity: 0;
  }
}

/* 
 * تأثير الارتداد (Bounce)
 * يظهر العنصر وكأنه يرتد 
 */
@keyframes bounce {
  0%, 20%, 53%, to {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translateZ(0);
  }

  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -30px, 0) scaleY(1.1);
  }

  70% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -15px, 0) scaleY(1.05);
  }

  80% {
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translateZ(0) scaleY(0.95);
  }

  90% {
    transform: translate3d(0, -4px, 0) scaleY(1.02);
  }
}

.animate__bounce {
  animation-name: bounce;
  transform-origin: center bottom;
}

/* 
 * تأثير الظهور (Fade In)
 * يجعل العنصر يظهر بتدريج 
 */
@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate__fadeIn {
  animation-name: fadeIn;
}

/* 
 * تأثير الظهور من الأعلى
 */
@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translate3d(0, -100%, 0);
  }
  to {
    opacity: 1;
    transform: translateZ(0);
  }
}

.animate__fadeInDown {
  animation-name: fadeInDown;
}

/* 
 * تأثير الظهور من اليسار
 */
@keyframes fadeInLeft {
  0% {
    opacity: 0;
    transform: translate3d(-100%, 0, 0);
  }
  to {
    opacity: 1;
    transform: translateZ(0);
  }
}

.animate__fadeInLeft {
  animation-name: fadeInLeft;
}

/* 
 * تأثير الظهور من اليمين
 */
@keyframes fadeInRight {
  0% {
    opacity: 0;
    transform: translate3d(100%, 0, 0);
  }
  to {
    opacity: 1;
    transform: translateZ(0);
  }
}

.animate__fadeInRight {
  animation-name: fadeInRight;
}

/* 
 * تأثير الظهور من الأسفل
 */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }
  to {
    opacity: 1;
    transform: translateZ(0);
  }
}

.animate__fadeInUp {
  animation-name: fadeInUp;
}

/* 
 * تأثير النبض (Pulse)
 * يجعل العنصر ينبض أو يتوسع ويتقلص
 */
@keyframes pulse {
  0% {
    transform: scale3d(1, 1, 1);
  }
  50% {
    transform: scale3d(1.05, 1.05, 1.05);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}

.animate__pulse {
  animation-name: pulse;
  animation-timing-function: ease-in-out;
}

/* 
 * تأثير الاهتزاز (Shake)
 * يجعل العنصر يهتز من جانب لآخر
 */
@keyframes shakeX {
  0%, to {
    transform: translateZ(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translate3d(-10px, 0, 0);
  }
  20%, 40%, 60%, 80% {
    transform: translate3d(10px, 0, 0);
  }
}

.animate__shakeX {
  animation-name: shakeX;
}

/* 
 * تأثير الانزلاق (Slide)
 * يجعل العنصر ينزلق من الجانب إلى موضعه
 */
@keyframes slideInRight {
  0% {
    transform: translate3d(100%, 0, 0);
    visibility: visible;
  }
  to {
    transform: translateZ(0);
  }
}

.animate__slideInRight {
  animation-name: slideInRight;
}

@keyframes slideInLeft {
  0% {
    transform: translate3d(-100%, 0, 0);
    visibility: visible;
  }
  to {
    transform: translateZ(0);
  }
}

.animate__slideInLeft {
  animation-name: slideInLeft;
}

/* 
 * تأثير الدوران (Rotate)
 * يجعل العنصر يدور حول نفسه
 */
@keyframes rotateIn {
  0% {
    transform: rotate(-200deg);
    opacity: 0;
  }
  to {
    transform: translateZ(0);
    opacity: 1;
  }
}

.animate__rotateIn {
  animation-name: rotateIn;
  transform-origin: center;
}

/* 
 * تأثير التكبير (Zoom)
 * يجعل العنصر يظهر مع تكبير تدريجي
 */
@keyframes zoomIn {
  0% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  50% {
    opacity: 1;
  }
}

.animate__zoomIn {
  animation-name: zoomIn;
}

/* يمكن إضافة المزيد من التأثيرات حسب الحاجة */