/* RTL Animations & Effects - Advanced animations and transitions for RTL mode
   Includes keyframe adjustments, direction-specific effects, and smooth transitions
*/

/* ==================== ANIMATION ADJUSTMENTS ==================== */

/* Fade In animations remain the same */
@-webkit-keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Slide In from left (mirror for RTL - becomes right in visual) */
@-webkit-keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In from right (mirror for RTL - becomes left in visual) */
@-webkit-keyframes fadeInRight {
  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);
  }
}

/* Fade Down animation */
@-webkit-keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ==================== MARQUEE / HEADLINE ANIMATION ==================== */

/* ==================== HOVER STATE ANIMATIONS ==================== */

html[dir="rtl"] .service-three-item {
  animation-duration: 0.5s;
}

html[dir="rtl"] .service-three-item:hover {
  animation: cardHover 0.5s ease-in-out forwards;
}

@-webkit-keyframes cardHover {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-15px) scale(1.02);
  }
  100% {
    transform: translateY(-15px) scale(1.02);
  }
}

@keyframes cardHover {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-15px) scale(1.02);
  }
  100% {
    transform: translateY(-15px) scale(1.02);
  }
}

/* Button hover animation */
html[dir="rtl"] .theme-btn {
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html[dir="rtl"] .theme-btn:hover {
  transform: translateX(-3px);
}

html[dir="rtl"] .theme-btn:active {
  transform: translateX(-1px);
}

/* ==================== ICON ANIMATIONS ==================== */

html[dir="rtl"] .fa-chevron-right,
html[dir="rtl"] .fa-arrow-right {
  transition: transform 0.3s ease, color 0.3s ease;
}

html[dir="rtl"] .service-three-item:hover .fa-arrow-right,
html[dir="rtl"] .read-more:hover .fa-arrow-right {
  transform: rotateY(180deg) translateX(-5px);
}

html[dir="rtl"] .blog-item:hover .fa-arrow-right {
  transform: rotateY(180deg) translateX(-5px);
}

/* ==================== SHAPE ANIMATIONS ==================== */

html[dir="rtl"] .shape-animation {
  animation: shapeAnimationRTL 10s ease-in-out infinite;
}

@-webkit-keyframes shapeAnimationRTL {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(-50px) translateY(50px) rotate(90deg);
  }
  50% {
    transform: translateX(50px) translateY(100px) rotate(180deg);
  }
  75% {
    transform: translateX(100px) translateY(50px) rotate(270deg);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(360deg);
  }
}

@keyframes shapeAnimationRTL {
  0% {
    transform: translateX(0) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(-50px) translateY(50px) rotate(90deg);
  }
  50% {
    transform: translateX(50px) translateY(100px) rotate(180deg);
  }
  75% {
    transform: translateX(100px) translateY(50px) rotate(270deg);
  }
  100% {
    transform: translateX(0) translateY(0) rotate(360deg);
  }
}

/* ==================== PULSE ANIMATION ==================== */

html[dir="rtl"] .pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@-webkit-keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ==================== BOUNCE ANIMATION ==================== */

html[dir="rtl"] .bounce {
  animation: bounce 1s infinite;
}

@-webkit-keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* ==================== SLIDE ANIMATION ==================== */

html[dir="rtl"] .slide-in-right {
  animation: slideInRightRTL 0.6s ease-out forwards;
}

@-webkit-keyframes slideInRightRTL {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRightRTL {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

html[dir="rtl"] .slide-in-left {
  animation: slideInLeftRTL 0.6s ease-out forwards;
}

@-webkit-keyframes slideInLeftRTL {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeftRTL {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==================== SCALE ANIMATION ==================== */

html[dir="rtl"] .scale-up {
  animation: scaleUp 0.6s cubic-bezier(0.26, 0.53, 0.6, 1) forwards;
}

@-webkit-keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==================== ROTATION ANIMATION ==================== */

html[dir="rtl"] .spin {
  animation: spin 1s linear infinite;
}

@-webkit-keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==================== GRADIENT ANIMATION ==================== */

html[dir="rtl"] .gradient-animation {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

@-webkit-keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* ==================== STAGGER ANIMATION ==================== */

html[dir="rtl"] .stagger-item {
  animation: fadeInUp 0.6s ease-out backwards;
}

html[dir="rtl"] .stagger-item:nth-child(1) { animation-delay: 0.1s; }
html[dir="rtl"] .stagger-item:nth-child(2) { animation-delay: 0.2s; }
html[dir="rtl"] .stagger-item:nth-child(3) { animation-delay: 0.3s; }
html[dir="rtl"] .stagger-item:nth-child(4) { animation-delay: 0.4s; }
html[dir="rtl"] .stagger-item:nth-child(5) { animation-delay: 0.5s; }
html[dir="rtl"] .stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* ==================== TRANSITION TIMING ==================== */

html[dir="rtl"] * {
  transition-timing-function: cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Fast transitions */
html[dir="rtl"] .fast {
  transition-duration: 0.15s;
}

/* Standard transitions */
html[dir="rtl"] .standard {
  transition-duration: 0.3s;
}

/* Slow transitions */
html[dir="rtl"] .slow {
  transition-duration: 0.5s;
}

/* ==================== HOVER EFFECT COMBINATIONS ==================== */

html[dir="rtl"] .hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

html[dir="rtl"] .hover-scale:hover {
  transform: scale(1.05);
}

html[dir="rtl"] .hover-glow:hover {
  box-shadow: 0 0 20px rgba(209, 157, 30, 0.4);
}

html[dir="rtl"] .hover-color:hover {
  color: var(--wispaar-primary-color);
}

/* ==================== LOADING STATE ==================== */

html[dir="rtl"] .loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

html[dir="rtl"] .loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--wispaar-primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ==================== END ANIMATIONS & EFFECTS ==================== */
