/* ============================================
   MJ.SERVICES - ANIMATIONS & EFFECTS
   Advanced animations using GSAP & CSS
   ============================================ */

/* ===== GSAP SCROLL TRIGGER INITIAL STATES ===== */
.gsap-hidden {
    opacity: 0;
    transform: translateY(30px);
}

/* ===== FADE UP ANIMATION ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fadeUp 0.8s ease-out forwards;
}

/* ===== FADE IN ANIMATION ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* ===== SLIDE UP BLUR ===== */
@keyframes slideUpBlur {
    from {
        opacity: 0;
        transform: translateY(60px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.slide-up-blur {
    animation: slideUpBlur 1s ease-out forwards;
}

/* ===== SCALE IN ===== */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
}

/* ===== STAGGER CHILDREN ===== */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-children.animate > *:nth-child(1) { animation: fadeUp 0.6s 0.1s ease-out forwards; }
.stagger-children.animate > *:nth-child(2) { animation: fadeUp 0.6s 0.2s ease-out forwards; }
.stagger-children.animate > *:nth-child(3) { animation: fadeUp 0.6s 0.3s ease-out forwards; }
.stagger-children.animate > *:nth-child(4) { animation: fadeUp 0.6s 0.4s ease-out forwards; }
.stagger-children.animate > *:nth-child(5) { animation: fadeUp 0.6s 0.5s ease-out forwards; }
.stagger-children.animate > *:nth-child(6) { animation: fadeUp 0.6s 0.6s ease-out forwards; }
.stagger-children.animate > *:nth-child(7) { animation: fadeUp 0.6s 0.7s ease-out forwards; }
.stagger-children.animate > *:nth-child(8) { animation: fadeUp 0.6s 0.8s ease-out forwards; }
.stagger-children.animate > *:nth-child(9) { animation: fadeUp 0.6s 0.9s ease-out forwards; }
.stagger-children.animate > *:nth-child(10) { animation: fadeUp 0.6s 1.0s ease-out forwards; }

/* ===== HERO TEXT REVEAL ===== */
.hero-line {
    opacity: 0;
    transform: translateY(30px);
    display: block;
}

.hero-line.revealed {
    animation: heroReveal 0.8s ease-out forwards;
}

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

/* ===== LETTER BY LETTER ANIMATION ===== */
.letter-reveal {
    display: inline-block;
    overflow: hidden;
}

.letter-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: letterReveal 0.5s ease-out forwards;
}

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

/* ===== CARD LIFT EFFECT ===== */
.card-lift {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease;
}

.card-lift:hover {
    transform: translateY(-12px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

/* ===== 3D TILT EFFECT ===== */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.1s ease-out;
}

.tilt-card-inner {
    transform-style: preserve-3d;
    transition: transform 0.3s ease-out;
}

/* ===== GLOW BORDER ANIMATION ===== */
.glow-border {
    position: relative;
}

.glow-border::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink), var(--accent-cyan), var(--accent-purple));
    background-size: 300% 300%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: glowRotate 3s linear infinite;
}

.glow-border:hover::after {
    opacity: 1;
}

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

/* ===== SHIMMER EFFECT ===== */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== FLOATING ANIMATION ===== */
.float {
    animation: float 6s ease-in-out infinite;
}

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

.float-delay-1 { animation-delay: -2s; }
.float-delay-2 { animation-delay: -4s; }

/* ===== SPIN SLOW ===== */
.spin-slow {
    animation: spinSlow 20s linear infinite;
}

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

/* ===== PULSE GLOW ===== */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(168, 85, 247, 0.6);
    }
}

/* ===== BOUNCE IN ===== */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.8s ease-out forwards;
}

/* ===== SLIDE IN LEFT ===== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.7s ease-out forwards;
}

/* ===== SLIDE IN RIGHT ===== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.7s ease-out forwards;
}

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

.rotate-in {
    animation: rotateIn 0.7s ease-out forwards;
}

/* ===== FLIP IN ===== */
@keyframes flipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateY(0);
    }
}

.flip-in {
    animation: flipIn 0.7s ease-out forwards;
}

/* ===== ZOOM IN ===== */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.5s ease-out forwards;
}

/* ===== BLUR IN ===== */
@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(20px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

.blur-in {
    animation: blurIn 0.8s ease-out forwards;
}

/* ===== COUNTER ANIMATION ===== */
.counter-animate {
    display: inline-block;
}

/* ===== MAGNETIC BUTTON ===== */
.magnetic-btn {
    transition: transform 0.2s ease-out;
}

/* ===== RIPPLE BUTTON ===== */
.ripple-btn {
    position: relative;
    overflow: hidden;
}

/* ===== GRADIENT TEXT ANIMATION ===== */
.gradient-text-animated {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink), var(--accent-cyan), var(--accent-purple));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 5s ease infinite;
}

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

/* ===== BORDER DRAW ANIMATION ===== */
.border-draw {
    position: relative;
}

.border-draw::before,
.border-draw::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 2px solid transparent;
    transition: all 0.4s ease;
}

.border-draw::before {
    top: 0;
    left: 0;
}

.border-draw::after {
    bottom: 0;
    right: 0;
}

.border-draw:hover::before {
    width: 100%;
    height: 100%;
    border-top-color: var(--accent-purple);
    border-right-color: var(--accent-purple);
}

.border-draw:hover::after {
    width: 100%;
    height: 100%;
    border-bottom-color: var(--accent-purple);
    border-left-color: var(--accent-purple);
}

/* ===== MORPHING SHAPE ===== */
.morph-shape {
    animation: morphShape 8s ease-in-out infinite;
}

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

/* ===== TEXT SHADOW ANIMATION ===== */
.text-shadow-animate {
    animation: textShadow 3s ease-in-out infinite;
}

@keyframes textShadow {
    0%, 100% { text-shadow: 0 0 10px rgba(168, 85, 247, 0.5); }
    50% { text-shadow: 0 0 30px rgba(168, 85, 247, 0.8), 0 0 60px rgba(236, 72, 153, 0.4); }
}

/* ===== UNDERLINE ANIMATION ===== */
.underline-animate {
    position: relative;
    display: inline-block;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
    transition: width 0.4s ease;
}

.underline-animate:hover::after {
    width: 100%;
}

/* ===== ICON BOUNCE ===== */
.icon-bounce {
    transition: transform 0.3s ease;
}

.icon-bounce:hover {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-8px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-4px); }
}

/* ===== SCALE ON HOVER ===== */
.scale-hover {
    transition: transform 0.3s ease;
}

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

/* ===== ROTATE ON HOVER ===== */
.rotate-hover {
    transition: transform 0.4s ease;
}

.rotate-hover:hover {
    transform: rotate(5deg) scale(1.02);
}

/* ===== GRAYSCALE TO COLOR ===== */
.grayscale-hover {
    filter: grayscale(100%);
    transition: filter 0.4s ease;
}

.grayscale-hover:hover {
    filter: grayscale(0%);
}

/* ===== SECTION REVEAL ===== */
.section-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== PARALLAX LAYER ===== */
.parallax-layer {
    will-change: transform;
}

/* ===== SMOOTH REVEAL FOR CARDS ===== */
.card-reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-reveal.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ===== LOADING DOTS ===== */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-purple);
    animation: loadingDots 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDots {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== HEARTBEAT ===== */
.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

/* ===== SWING ===== */
.swing {
    animation: swing 2s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes swing {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(5deg); }
    40% { transform: rotate(-3deg); }
    60% { transform: rotate(2deg); }
    80% { transform: rotate(-1deg); }
}

/* ===== WOBBLE ===== */
.wobble {
    animation: wobble 1s ease-in-out;
}

@keyframes wobble {
    0% { transform: translateX(0); }
    15% { transform: translateX(-15px) rotate(-5deg); }
    30% { transform: translateX(10px) rotate(3deg); }
    45% { transform: translateX(-8px) rotate(-3deg); }
    60% { transform: translateX(5px) rotate(2deg); }
    75% { transform: translateX(-3px) rotate(-1deg); }
    100% { transform: translateX(0); }
}

/* ===== RUBBER BAND ===== */
.rubber-band {
    animation: rubberBand 1s 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); }
}

/* ===== TADA ===== */
.tada {
    animation: tada 1s ease-in-out;
}

@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) rotate(0); }
}

/* ===== JELLO ===== */
.jello {
    animation: jello 1s ease-in-out;
}

@keyframes jello {
    0%, 100% { transform: scale(1, 1); }
    25% { transform: scale(0.9, 1.1); }
    50% { transform: scale(1.1, 0.9); }
    75% { transform: scale(0.95, 1.05); }
}

/* ===== FLIP ===== */
.flip {
    animation: flip 0.7s ease-in-out;
}

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

/* ===== PAGE TRANSITION ===== */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1);
}

.page-transition.active {
    transform: translateY(0);
}

/* ===== CURSOR GLOW ===== */
.cursor-glow {
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.08), transparent 70%);
    pointer-events: none;
    z-index: 9997;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

/* ===== SCROLL PROGRESS BAR ===== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
    z-index: 1001;
    transition: width 0.1s ease;
}

/* ===== INTERSECTION OBSERVER ANIMATIONS ===== */
.io-fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.io-fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.io-fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.io-fade-in.visible {
    opacity: 1;
}

.io-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.io-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.io-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.io-blur {
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.8s ease, filter 0.8s ease;
}

.io-blur.visible {
    opacity: 1;
    filter: blur(0);
}

/* ===== DELAY CLASSES ===== */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }
.delay-700 { transition-delay: 0.7s; }
.delay-800 { transition-delay: 0.8s; }

/* ===== ANIMATION DURATION CLASSES ===== */
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }
.duration-1500 { animation-duration: 1.5s; }
.duration-2000 { animation-duration: 2s; }

/* ===== EASING CLASSES ===== */
.ease-smooth { animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.ease-bounce { animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
.ease-expo { animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }

/* ===== HAMBURGER ANIMATION ===== */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== NAV LINK UNDERLINE ===== */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-pink));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

/* ===== SERVICE CARD BORDER ANIMATION ===== */
.service-card {
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1.5px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink), var(--accent-cyan));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover::before {
    opacity: 1;
}

/* ===== PRICING CARD POPULAR GLOW ===== */
.pricing-card.popular::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 26px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    z-index: -1;
    opacity: 0.5;
    filter: blur(15px);
}

/* ===== CONTACT CARD HOVER EFFECTS ===== */
.contact-card {
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(168, 85, 247, 0.03));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.contact-card:hover::before {
    opacity: 1;
}

/* ===== FOOTER LINK UNDERLINE ===== */
.footer-links ul li a {
    position: relative;
}

.footer-links ul li a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-purple);
    transition: width 0.3s ease;
}

.footer-links ul li a:hover::after {
    width: 100%;
}

/* ===== SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--hover-bg) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

/* ===== TOOLTIP ===== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ===== SCROLL SNAP ===== */
.scroll-snap {
    scroll-snap-type: y proximity;
}

.scroll-snap > * {
    scroll-snap-align: start;
}

/* ===== SMOOTH SCROLL BEHAVIOR ===== */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .float,
    .spin-slow,
    .pulse-glow,
    .morph-shape,
    .text-shadow-animate,
    .shimmer::after,
    .bg-blob,
    .hero-card,
    .loading-bar,
    .scroll-dot,
    .hero-glow,
    .badge-dot,
    .blob-1,
    .blob-2,
    .blob-3 {
        animation: none !important;
    }
}
