/* ================================================
   MANARA AUTO - Animations CSS
   ================================================ */

/* Ensure animated decorative elements don't block clicks */
.hero-bg,
.hero-gradient,
.floating-shapes,
.shape,
[class*="animate-"]:not(button):not(a):not(.btn) {
    pointer-events: none;
}

/* Slide Up Animation */
.animate-slide-up {
    opacity: 0;
    transform: translateY(40px);
    animation: slideUp 0.8s ease forwards;
}

.animate-slide-up:nth-child(1) { animation-delay: 0.1s; }
.animate-slide-up:nth-child(2) { animation-delay: 0.2s; }
.animate-slide-up:nth-child(3) { animation-delay: 0.3s; }
.animate-slide-up:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Animation */
.animate-fade-in {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.5s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Float Animation */
.animate-float {
    animation: floatUpDown 6s ease-in-out infinite;
}

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

/* Scale In Animation */
.animate-scale-in {
    opacity: 0;
    transform: scale(0.9);
    animation: scaleIn 0.6s ease forwards;
}

@keyframes scaleIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Glow Pulse Animation */
.animate-glow {
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.6);
    }
}

/* Shake Animation */
.animate-shake {
    animation: shake 0.5s ease-in-out;
}

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

/* Rotate Animation */
.animate-rotate {
    animation: rotate 20s linear infinite;
}

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

/* Typing Effect */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--primary);
    white-space: nowrap;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

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

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

/* Slide From Left */
.slide-from-left {
    opacity: 0;
    transform: translateX(-50px);
    animation: slideFromLeft 0.8s ease forwards;
}

@keyframes slideFromLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide From Right */
.slide-from-right {
    opacity: 0;
    transform: translateX(50px);
    animation: slideFromRight 0.8s ease forwards;
}

@keyframes slideFromRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Bounce Animation */
.animate-bounce {
    animation: bounce 2s ease infinite;
}

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

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: translate(-50%, -50%) scale(10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

.ripple:active::after {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.6;
    transition: 0s;
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Card 3D Effect */
.card-3d {
    transition: transform 0.3s ease;
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Gradient Border Animation */
.gradient-border {
    position: relative;
    background: var(--dark-700);
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    z-index: -1;
    animation: gradientRotate 4s linear infinite;
}

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

/* Shimmer Loading Effect */
.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* Text Gradient Animation */
.animated-gradient-text {
    background: linear-gradient(
        90deg,
        #00d4ff,
        #a855f7,
        #ff6b35,
        #00d4ff
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 5s ease infinite;
}

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

/* Particle Float */
.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.5;
    animation: particleFloat 15s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.5;
    }
    25% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-200px) translateX(-30px);
        opacity: 0.3;
    }
    75% {
        transform: translateY(-100px) translateX(-80px);
        opacity: 0.6;
    }
}

/* Intersection Observer Animations */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

[data-animate].animated {
    opacity: 1;
    transform: translateY(0);
}

[data-animate="left"] {
    transform: translateX(-50px);
}

[data-animate="left"].animated {
    transform: translateX(0);
}

[data-animate="right"] {
    transform: translateX(50px);
}

[data-animate="right"].animated {
    transform: translateX(0);
}

[data-animate="scale"] {
    transform: scale(0.9);
}

[data-animate="scale"].animated {
    transform: scale(1);
}

/* Button Hover Animations */
.btn-animated {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
    z-index: -1;
}

.btn-animated:hover::before {
    left: 100%;
}

/* Stagger Children Animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-children.animate > *:nth-child(1) { animation: staggerIn 0.5s ease 0.1s forwards; }
.stagger-children.animate > *:nth-child(2) { animation: staggerIn 0.5s ease 0.2s forwards; }
.stagger-children.animate > *:nth-child(3) { animation: staggerIn 0.5s ease 0.3s forwards; }
.stagger-children.animate > *:nth-child(4) { animation: staggerIn 0.5s ease 0.4s forwards; }
.stagger-children.animate > *:nth-child(5) { animation: staggerIn 0.5s ease 0.5s forwards; }
.stagger-children.animate > *:nth-child(6) { animation: staggerIn 0.5s ease 0.6s forwards; }

@keyframes staggerIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Counter Animation */
.counter {
    display: inline-block;
}

/* Smooth Scroll Reveal */
.reveal {
    opacity: 0;
    visibility: hidden;
    transition: all 1s ease;
}

.reveal.active {
    opacity: 1;
    visibility: visible;
}

.reveal.from-bottom {
    transform: translateY(80px);
}

.reveal.from-bottom.active {
    transform: translateY(0);
}

.reveal.from-left {
    transform: translateX(-80px);
}

.reveal.from-left.active {
    transform: translateX(0);
}

.reveal.from-right {
    transform: translateX(80px);
}

.reveal.from-right.active {
    transform: translateX(0);
}
