/* ============================================
   Parsa Group Co. - Animations Stylesheet (Fixed)
   ============================================ */

/* =====================
   Global Motion Safety
   ===================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* =====================
   Fade Animations
   ===================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out both;
    will-change: opacity, transform;
}

/* =====================
   Fade In Down
   ===================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-down {
    animation: fadeInDown 0.4s ease-out both;
    will-change: opacity, transform;
}

/* =====================
   Slide Animations
   ===================== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out both;
    will-change: opacity, transform;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out both;
    will-change: opacity, transform;
}

/* =====================
   Scale
   ===================== */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.45s ease-out both;
    will-change: opacity, transform;
}

/* =====================
   Pulse
   ===================== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
    will-change: transform;
}

/* =====================
   Rotate
   ===================== */
@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 2s linear infinite;
    will-change: transform;
}

/* =====================
   Shake
   ===================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* =====================
   Bounce
   ===================== */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.bounce {
    animation: bounce 1s ease-in-out;
}

/* =====================
   Gradient Animation
   ===================== */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* =====================
   Scroll Reveal
   ===================== */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Force visibility for product cards */
.product-cards-grid .product-card.reveal,
.product-cards-grid .product-card.reveal.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* =====================
   Hover Effects
   ===================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(26, 115, 232, 0.5);
}

/* =====================
   Spinner
   ===================== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(26, 115, 232, 0.15);
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

/* =====================
   Progress Bar
   ===================== */
@keyframes progress {
    from { width: 0%; }
}

.progress-bar {
    height: 4px;
    background-color: var(--primary-color);
    animation: progress 2s ease-out forwards;
}

/* =====================
   Typing Effect
   ===================== */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary-color);
    animation:
        typing 3s steps(40, end) both,
        blink 0.75s step-end infinite;
}

/* =====================
   Header / Mega Menu
   ===================== */
@keyframes megaMenuFadeDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.mega-menu-animate {
    animation: megaMenuFadeDown 0.35s ease-out both;
}
