/* ================================================
   MohZarg - انیمیشن‌های پیشرفته و افکت‌های 3D
   نسخه: 2.0.0
   ================================================ */

/* ================================================
   انیمیشن‌های ورود صفحه (Page Load Animations)
   ================================================ */

@keyframes fadeInUp {
    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);
    }
}

@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 scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-180deg) scale(0.5);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* کلاس‌های انیمیشن ورود */
.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease-out;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease-out;
}

.animate-rotateIn {
    animation: rotateIn 0.7s ease-out;
}

/* تأخیر انیمیشن */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ================================================
   افکت‌های شناور 3D (3D Floating Effects)
   ================================================ */

@keyframes float3D {
    0%, 100% {
        transform: translate3d(0, 0px, 0) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: translate3d(10px, -15px, 20px) rotateX(5deg) rotateY(5deg);
    }
    50% {
        transform: translate3d(0, -20px, 40px) rotateX(10deg) rotateY(-5deg);
    }
    75% {
        transform: translate3d(-10px, -15px, 20px) rotateX(5deg) rotateY(-10deg);
    }
}

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

@keyframes floatHorizontal {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(30px);
    }
}

.float-3d {
    animation: float3D 6s ease-in-out infinite;
    transform-style: preserve-3d;
}

.float-smooth {
    animation: floatSmooth 3s ease-in-out infinite;
}

.float-horizontal {
    animation: floatHorizontal 4s ease-in-out infinite;
}

/* ================================================
   انیمیشن‌های چرخش 3D (3D Rotation)
   ================================================ */

@keyframes rotate3D {
    from {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    to {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    }
}

@keyframes spinX {
    from { transform: rotateX(0deg); }
    to { transform: rotateX(360deg); }
}

@keyframes spinY {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

@keyframes spinZ {
    from { transform: rotateZ(0deg); }
    to { transform: rotateZ(360deg); }
}

.rotate-3d {
    animation: rotate3D 20s linear infinite;
    transform-style: preserve-3d;
}

.spin-x {
    animation: spinX 10s linear infinite;
}

.spin-y {
    animation: spinY 10s linear infinite;
}

.spin-z {
    animation: spinZ 2s linear infinite;
}

/* ================================================
   افکت درخشش و نور (Glow & Light Effects)
   ================================================ */

@keyframes glow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(147, 51, 234, 0.5),
            0 0 40px rgba(147, 51, 234, 0.3),
            0 0 60px rgba(147, 51, 234, 0.1);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(147, 51, 234, 0.8),
            0 0 60px rgba(147, 51, 234, 0.6),
            0 0 90px rgba(147, 51, 234, 0.4);
    }
}

@keyframes glowPulse {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(147, 51, 234, 0.7));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(147, 51, 234, 1));
    }
}

@keyframes neonPulse {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(147, 51, 234, 0.8),
            0 0 20px rgba(147, 51, 234, 0.6),
            0 0 30px rgba(147, 51, 234, 0.4),
            0 0 40px rgba(147, 51, 234, 0.2);
    }
    50% {
        text-shadow: 
            0 0 20px rgba(147, 51, 234, 1),
            0 0 30px rgba(147, 51, 234, 0.8),
            0 0 40px rgba(147, 51, 234, 0.6),
            0 0 50px rgba(147, 51, 234, 0.4),
            0 0 60px rgba(147, 51, 234, 0.2);
    }
}

.glow-effect {
    animation: glow 2s ease-in-out infinite;
}

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

.neon-text {
    animation: neonPulse 2s ease-in-out infinite;
}

/* ================================================
   انیمیشن‌های ذرات و پس‌زمینه (Particle Effects)
   ================================================ */

@keyframes particleFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx, 100px), var(--ty, -800px)) rotate(360deg);
        opacity: 0;
    }
}

@keyframes bubbleFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-1000px) scale(1.5);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #9333ea, transparent);
    border-radius: 50%;
    animation: particleFloat 8s linear infinite;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(147, 51, 234, 0.3), transparent);
    animation: bubbleFloat 12s ease-in infinite;
}

/* ================================================
   انیمیشن‌های لودینگ (Loading Animations)
   ================================================ */

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.loader-spin {
    animation: spin 1s linear infinite;
}

.loader-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.loader-bounce {
    animation: bounce 1s infinite;
}

/* ================================================
   افکت موج (Wave Effects)
   ================================================ */

@keyframes wave {
    0% {
        transform: translateX(0) translateZ(0) scaleY(1);
    }
    50% {
        transform: translateX(-25%) translateZ(0) scaleY(0.55);
    }
    100% {
        transform: translateX(-50%) translateZ(0) scaleY(1);
    }
}

.wave {
    position: absolute;
    width: 200%;
    height: 100%;
    animation: wave 10s cubic-bezier(0.36, 0.45, 0.63, 0.53) infinite;
    transform: translate3d(0, 0, 0);
}

.wave:nth-of-type(2) {
    animation-duration: 13s;
}

.wave:nth-of-type(3) {
    animation-duration: 16s;
}

/* ================================================
   افکت گرادینت متحرک (Moving Gradient)
   ================================================ */

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

.gradient-animated {
    background: linear-gradient(
        -45deg,
        #9333ea,
        #ec4899,
        #3b82f6,
        #22c55e
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* ================================================
   افکت تایپ (Typing Effect)
   ================================================ */

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

.typing-effect {
    overflow: hidden;
    border-left: 3px solid #9333ea;
    white-space: nowrap;
    animation: 
        typing 3.5s steps(40, end),
        blink 0.75s step-end infinite;
}

/* ================================================
   افکت برش و چرخش (Flip & Rotate)
   ================================================ */

@keyframes flipX {
    from { transform: perspective(400px) rotateX(0); }
    to { transform: perspective(400px) rotateX(360deg); }
}

@keyframes flipY {
    from { transform: perspective(400px) rotateY(0); }
    to { transform: perspective(400px) rotateY(360deg); }
}

@keyframes flip3D {
    0% {
        transform: perspective(400px) rotateX(0) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateX(360deg) rotateY(360deg);
    }
}

.flip-x {
    animation: flipX 2s ease-in-out infinite;
}

.flip-y {
    animation: flipY 2s ease-in-out infinite;
}

.flip-3d {
    animation: flip3D 4s ease-in-out infinite;
}

/* ================================================
   افکت لرزش (Shake Effect)
   ================================================ */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes jello {
    0%, 100% {
        transform: skewX(0deg) skewY(0deg);
    }
    30% {
        transform: skewX(25deg) skewY(25deg);
    }
    40% {
        transform: skewX(-15deg) skewY(-15deg);
    }
    50% {
        transform: skewX(15deg) skewY(15deg);
    }
    65% {
        transform: skewX(-5deg) skewY(-5deg);
    }
    75% {
        transform: skewX(5deg) skewY(5deg);
    }
}

.shake {
    animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.jello {
    animation: jello 0.9s both;
}

/* ================================================
   افکت برخورد موزاییکی (Glitch Effect)
   ================================================ */

@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                    -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
                    0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    14% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                    -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
                    0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    15% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
                    0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
                    -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    49% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
                    0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
                    -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    50% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
                    0.05em 0 0 rgba(0, 255, 0, 0.75),
                    0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    99% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
                    0.05em 0 0 rgba(0, 255, 0, 0.75),
                    0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    100% {
        text-shadow: -0.025em 0 0 rgba(255, 0, 0, 0.75),
                    -0.025em -0.025em 0 rgba(0, 255, 0, 0.75),
                    -0.025em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
}

.glitch {
    animation: glitch 1s linear infinite;
}

/* ================================================
   افکت ریپل (Ripple Effect)
   ================================================ */

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(147, 51, 234, 0.5);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

/* ================================================
   افکت پارالاکس (Parallax Effect)
   ================================================ */

.parallax {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.parallax-layer-back {
    transform: translateZ(-300px) scale(1.3);
}

.parallax-layer-base {
    transform: translateZ(0);
}

.parallax-layer-front {
    transform: translateZ(200px) scale(0.8);
}

/* ================================================
   افکت ذوب شدن (Morph Effect)
   ================================================ */

@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morph {
    animation: morph 8s ease-in-out infinite;
}

/* ================================================
   افکت بزرگ‌نمایی هاور (Hover Zoom Effects)
   ================================================ */

.hover-zoom {
    transition: transform 0.3s ease;
}

.hover-zoom:hover {
    transform: scale(1.05);
}

.hover-zoom-intense {
    transition: transform 0.3s ease;
}

.hover-zoom-intense:hover {
    transform: scale(1.15) rotate(2deg);
}

.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(147, 51, 234, 0.3);
}

/* ================================================
   افکت روشنایی متحرک (Spotlight Effect)
   ================================================ */

@keyframes spotlight {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.spotlight {
    background: linear-gradient(
        90deg,
        transparent 0%,
        transparent 40%,
        rgba(147, 51, 234, 0.3) 50%,
        transparent 60%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: spotlight 3s linear infinite;
}

/* ================================================
   افکت‌های کارت 3D (3D Card Effects)
   ================================================ */

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(10deg) scale(1.05);
}

.card-flip {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-flip:hover {
    transform: rotateY(180deg);
}

.card-flip-face {
    backface-visibility: hidden;
}

.card-flip-back {
    transform: rotateY(180deg);
}

/* ================================================
   افکت نوار پیشرفت متحرک (Progress Bar Animation)
   ================================================ */

@keyframes progressBar {
    0% { width: 0%; }
    100% { width: 100%; }
}

.progress-animated {
    animation: progressBar 2s ease-in-out;
}

/* ================================================
   افکت کانفتی (Confetti Effect)
   ================================================ */

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(1000px) rotate(720deg);
        opacity: 0;
    }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(45deg, #9333ea, #ec4899);
    animation: confetti 3s ease-in infinite;
}

/* ================================================
   کلاس‌های سرعت انیمیشن
   ================================================ */

.animate-slow {
    animation-duration: 3s;
}

.animate-fast {
    animation-duration: 0.5s;
}

.animate-infinite {
    animation-iteration-count: infinite;
}

.animate-once {
    animation-iteration-count: 1;
}

/* ================================================
   افکت‌های اسکرول (Scroll Effects)
   ================================================ */

.scroll-fade-in {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-slide-right {
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* ================================================
   افکت حباب شکسته (Bubble Pop)
   ================================================ */

@keyframes bubblePop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.bubble-pop {
    animation: bubblePop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ================================================
   افکت تشعشع (Radiate Effect)
   ================================================ */

@keyframes radiate {
    0% {
        box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(147, 51, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(147, 51, 234, 0);
    }
}

.radiate {
    animation: radiate 2s infinite;
}
