/* Variables for animation durations and repeat counts */
:root {
  --animate-duration: 1s;
  --animate-delay: 1s;
  --animate-repeat: 1;
}

/* General animation properties */
.animate__animated {
  animation-duration: var(--animate-duration);
  animation-fill-mode: both;
}

/* Infinite animation */
.animate__animated.animate__infinite {
  animation-iteration-count: infinite;
}

/* Repeat animation with dynamic values */
.animate__animated.animate__repeat-1 {
  animation-iteration-count: var(--animate-repeat);
}

.animate__animated.animate__repeat-2 {
  animation-iteration-count: calc(var(--animate-repeat) * 2);
}

.animate__animated.animate__repeat-3 {
  animation-iteration-count: calc(var(--animate-repeat) * 3);
}

/* Delay variations */
.animate__animated.animate__delay-1s {
  animation-delay: var(--animate-delay);
}

.animate__animated.animate__delay-2s {
  animation-delay: calc(var(--animate-delay) * 2);
}

.animate__animated.animate__delay-3s {
  animation-delay: calc(var(--animate-delay) * 3);
}

/* Speed variations */
.animate__animated.animate__faster {
  animation-duration: calc(var(--animate-duration) / 2);
}

.animate__animated.animate__fast {
  animation-duration: calc(var(--animate-duration) * 0.8);
}

.animate__animated.animate__slow {
  animation-duration: calc(var(--animate-duration) * 2);
}

.animate__animated.animate__slower {
  animation-duration: calc(var(--animate-duration) * 3);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce), print {
  .animate__animated {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .animate__animated[class*='Out'] {
    opacity: 0;
  }
}

/* Bounce Animation */
@keyframes bounce {
  0%, 20%, 53%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translate3d(0px, 0px, 0px);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0px, -30px, 0px) scaleY(1.1);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0px, -15px, 0px) scaleY(1.05);
  }
  80% {
    transform: translate3d(0px, 0px, 0px) scaleY(0.95);
  }
  90% {
    transform: translate3d(0px, -4px, 0px) scaleY(1.02);
  }
}

.animate__bounce {
  animation-name: bounce;
  transform-origin: center bottom;
}
@keyframes flash {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}
.animate__flash {
  animation-name: flash;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.animate__pulse {
  animation-name: pulse;
  animation-timing-function: ease-in-out;
}

@keyframes rubberBand {
  0% { transform: scale(1); }
  30% { transform: scale(1.25, 0.75); }
  40% { transform: scale(0.75, 1.25); }
  50% { transform: scale(1.15, 0.85); }
  65% { transform: scale(0.95, 1.05); }
  75% { transform: scale(1.05, 0.95); }
  100% { transform: scale(1); }
}
.animate__rubberBand {
  animation-name: rubberBand;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  20%, 40%, 60%, 80% { transform: translateX(10px); }
}
.animate__shakeX {
  animation-name: shakeX;
}

@keyframes shakeY {
  0%, 100% { transform: translateY(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateY(-10px); }
  20%, 40%, 60%, 80% { transform: translateY(10px); }
}
.animate__shakeY {
  animation-name: shakeY;
}

@keyframes headShake {
  0% { transform: translateX(0); }
  6.5% { transform: translateX(-6px) rotateY(-9deg); }
  18.5% { transform: translateX(5px) rotateY(7deg); }
  31.5% { transform: translateX(-3px) rotateY(-5deg); }
  43.5% { transform: translateX(2px) rotateY(3deg); }
  50% { transform: translateX(0); }
}
.animate__headShake {
  animation-name: headShake;
  animation-timing-function: ease-in-out;
}

@keyframes swing {
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-10deg); }
  60% { transform: rotate(5deg); }
  80% { transform: rotate(-5deg); }
  100% { transform: rotate(0deg); }
}
.animate__swing {
  animation-name: swing;
  transform-origin: top center;
}

@keyframes tada {
  0% { transform: scale(1); }
  10%, 20% { transform: scale(0.9) rotate(-3deg); }
  30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
  40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1); }
}
.animate__tada {
  animation-name: tada;
}

@keyframes wobble {
  0% { transform: translateX(0); }
  15% { transform: translateX(-25%) rotate(-5deg); }
  30% { transform: translateX(20%) rotate(3deg); }
  45% { transform: translateX(-15%) rotate(-3deg); }
  60% { transform: translateX(10%) rotate(2deg); }
  75% { transform: translateX(-5%) rotate(-1deg); }
  100% { transform: translateX(0); }
}
.animate__wobble {
  animation-name: wobble;
}

@keyframes jello {
  0%, 100% { transform: translateZ(0); }
  22.2% { transform: skewX(-12.5deg) skewY(-12.5deg); }
  33.3% { transform: skewX(6.25deg) skewY(6.25deg); }
  44.4% { transform: skewX(-3.125deg) skewY(-3.125deg); }
  55.5% { transform: skewX(1.5625deg) skewY(1.5625deg); }
  66.6% { transform: skewX(-0.78125deg) skewY(-0.78125deg); }
  77.7% { transform: skewX(0.390625deg) skewY(0.390625deg); }
  88.8% { transform: skewX(-0.1953125deg) skewY(-0.1953125deg); }
}
.animate__jello {
  animation-name: jello;
}
@keyframes jello {
  0%, 100% { transform: skewX(0) skewY(0); }
  33.3% { transform: skewX(1.5625deg) skewY(1.5625deg); }
  66.6% { transform: skewX(-0.78125deg) skewY(-0.78125deg); }
  77.7% { transform: skewX(0.390625deg) skewY(0.390625deg); }
  88.8% { transform: skewX(-0.1953125deg) skewY(-0.1953125deg); }
}

.animate__jello {
  animation-name: jello;
  transform-origin: center;
}

@keyframes heartBeat {
  0%, 28%, 70% { transform: scale(1); }
  14%, 42% { transform: scale(1.3); }
}

.animate__heartBeat {
  animation-duration: 1.3s;
  animation-name: heartBeat;
  animation-timing-function: ease-in-out;
}

@keyframes backInDown {
  0% { opacity: 0.7; transform: translateY(-1200px) scale(0.7); }
  80% { opacity: 0.7; transform: translateY(0) scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}

.animate__backInDown {
  animation-name: backInDown;
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); }
  20% { transform: scale3d(1.1, 1.1, 1.1); }
  40% { transform: scale3d(0.9, 0.9, 0.9); }
  60% { opacity: 1; transform: scale3d(1.03, 1.03, 1.03); }
  80% { transform: scale3d(0.97, 0.97, 0.97); }
  100% { opacity: 1; transform: scaleX(1); }
}

.animate__bounceIn {
  animation-name: bounceIn;
}
.bounceIn {
    animation-name: bounceIn;
    animation-duration: 1s;
    animation-fill-mode: both;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }

    50% {
        opacity: 1;
        transform: scale3d(1.05, 1.05, 1.05);
    }

    70% {
        transform: scale3d(0.9, 0.9, 0.9);
    }

    100% {
        transform: scale3d(1, 1, 1);
    }
}

.fadeIn {
    animation-name: fadeIn;
    animation-duration: 1s;
    animation-fill-mode: both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.bounceOut {
    animation-name: bounceOut;
    animation-duration: 1s;
    animation-fill-mode: both;
}

@keyframes bounceOut {
    20% {
        transform: scale3d(0.9, 0.9, 0.9);
    }

    50%, 55% {
        opacity: 1;
        transform: scale3d(1.1, 1.1, 1.1);
    }

    to {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
}

.bounceInLeft {
    animation-name: bounceInLeft;
    animation-duration: 1s;
    animation-fill-mode: both;
}

@keyframes bounceInLeft {
    from {
        opacity: 0;
        transform: translate3d(-100%, 0, 0);
    }

    60% {
        opacity: 1;
        transform: translate3d(25px, 0, 0);
    }

    100% {
        transform: translate3d(0, 0, 0);
    }
}
document.addEventListener('DOMContentLoaded', () => {
    const image = document.getElementById('zoom-image');
    let scale = 1;
    let translateX = 0;
    let translateY = 0;

    const updateTransform = () => {
        image.style.transform = `translate3d(${translateX}px, ${translateY}px, 0) scale(${scale})`;
    };

    document.getElementById('zoom-in').addEventListener('click', () => {
        scale += 0.1;
        updateTransform();
    });

    document.getElementById('zoom-out').addEventListener('click', () => {
        scale = Math.max(0.1, scale - 0.1);
        updateTransform();
    });

    let isDragging = false;
    let startX = 0;
    let startY = 0;

    image.addEventListener('mousedown', (e) => {
        isDragging = true;
        startX = e.clientX - translateX;
        startY = e.clientY - translateY;
        image.style.cursor = 'grabbing';
    });

    document.addEventListener('mousemove', (e) => {
        if (!isDragging) return;
        translateX = e.clientX - startX;
        translateY = e.clientY - startY;
        updateTransform();
    });

    document.addEventListener('mouseup', () => {
        isDragging = false;
        image.style.cursor = 'grab';
    });
});
transform: translate3d(-100%,0,0) skewX(30deg);
}
60% {
  opacity: 1;
  -webkit-transform: skewX(-20deg);
  transform: skewX(-20deg);
}
80% {
  -webkit-transform: skewX(5deg);
  transform: skewX(5deg);
}
to {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.animate__lightSpeedInLeft {
  -webkit-animation-name: lightSpeedInLeft;
  animation-name: lightSpeedInLeft;
  -webkit-animation-timing-function: ease-out;
  animation-timing-function: ease-out;
}

@-webkit-keyframes lightSpeedOutRight {
  0% {
    opacity: 1;
  }
  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0) skewX(30deg);
    transform: translate3d(100%, 0, 0) skewX(30deg);
  }
}

@keyframes lightSpeedOutRight {
  0% {
    opacity: 1;
  }
  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0) skewX(30deg);
    transform: translate3d(100%, 0, 0) skewX(30deg);
  }
}

.animate__lightSpeedOutRight {
  -webkit-animation-name: lightSpeedOutRight;
  animation-name: lightSpeedOutRight;
  -webkit-animation-timing-function: ease-in;
  animation-timing-function: ease-in;
}

@-webkit-keyframes rotateIn {
  0% {
    opacity: 0;
    -webkit-transform: rotate(-200deg);
    transform: rotate(-200deg);
  }
  to {
    opacity: 1;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

@keyframes rotateIn {
  0% {
    opacity: 0;
    -webkit-transform: rotate(-200deg);
    transform: rotate(-200deg);
  }
  to {
    opacity: 1;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

.animate__rotateIn {
  -webkit-animation-name: rotateIn;
  animation-name: rotateIn;
  -webkit-transform-origin: center;
  transform-origin: center;
}
opacity: 0;
-webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0);
transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0);
}

60% {
  -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  opacity: 1;
  -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0);
  transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0);
}

.animate__zoomInLeft {
  -webkit-animation-name: zoomInLeft;
  animation-name: zoomInLeft;
}

@-webkit-keyframes zoomInRight {
  0% {
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0);
  }

  60% {
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
  }
}

@keyframes zoomInRight {
  0% {
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0);
  }

  60% {
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
  }
}

.animate__zoomInRight {
  -webkit-animation-name: zoomInRight;
  animation-name: zoomInRight;
}

/* تمامی مقادیر 0 باید بدون واحد باشند */
@keyframes slideInDown {
  0% {
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
    visibility: visible;
  }
  to {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

@keyframes slideInLeft {
  0% {
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
    visibility: visible;
  }
  to {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

@keyframes slideInRight {
  0% {
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
    visibility: visible;
  }
  to {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

@keyframes slideInUp {
  0% {
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
    visibility: visible;
  }
  to {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}
