/* WeberMarketing - Animations & Effects */

/* ===== GRADIENT BACKGROUND ANIMATION ===== */
.animated-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
}

.animated-bg::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.1) 0%, transparent 40%);
    animation: gradientShift 15s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(2%, 2%) rotate(1deg);
    }
    50% {
        transform: translate(-1%, 3%) rotate(-1deg);
    }
    75% {
        transform: translate(1%, -2%) rotate(0.5deg);
    }
}

/* Border Glow Animation */
@keyframes borderGlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

/* ===== FLOATING ORB EFFECT ===== */
.floating-orbs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(0, 212, 255, 0.3);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: rgba(124, 58, 237, 0.3);
    top: 60%;
    right: 10%;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: rgba(59, 130, 246, 0.25);
    bottom: 20%;
    left: 30%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(20px, 10px) scale(1.02);
    }
}

/* ===== PARTICLE EFFECT ===== */
.particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-accent-1);
    border-radius: 50%;
    opacity: 0;
    animation: particleRise 8s linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { left: 30%; animation-delay: 2s; }
.particle:nth-child(4) { left: 40%; animation-delay: 3s; }
.particle:nth-child(5) { left: 50%; animation-delay: 4s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; }
.particle:nth-child(7) { left: 70%; animation-delay: 6s; }
.particle:nth-child(8) { left: 80%; animation-delay: 7s; }
.particle:nth-child(9) { left: 90%; animation-delay: 0.5s; }
.particle:nth-child(10) { left: 15%; animation-delay: 1.5s; }
.particle:nth-child(11) { left: 25%; animation-delay: 2.5s; }
.particle:nth-child(12) { left: 35%; animation-delay: 3.5s; }
.particle:nth-child(13) { left: 45%; animation-delay: 4.5s; }
.particle:nth-child(14) { left: 55%; animation-delay: 5.5s; }
.particle:nth-child(15) { left: 65%; animation-delay: 6.5s; }

@keyframes particleRise {
    0% {
        bottom: -10px;
        opacity: 0;
        transform: translateX(0) scale(0.5);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        bottom: 100%;
        opacity: 0;
        transform: translateX(30px) scale(1);
    }
}

/* ===== GLOW PULSE EFFECT ===== */
.glow-pulse {
    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);
    }
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.fade-in.active {
    opacity: 1;
}

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

.fade-in-up.active {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.active {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.active {
    opacity: 1;
    transform: translateX(0);
}

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

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

/* Staggered delay for grid items */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }
.stagger-7 { transition-delay: 0.7s; }

/* ===== HERO TEXT ANIMATION ===== */
.hero-animate {
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeIn 1s ease forwards;
}

.hero-animate-delay-1 { animation-delay: 0.2s; }
.hero-animate-delay-2 { animation-delay: 0.4s; }
.hero-animate-delay-3 { animation-delay: 0.6s; }
.hero-animate-delay-4 { animation-delay: 0.8s; }

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

/* ===== TYPING CURSOR EFFECT ===== */
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--color-accent-1);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* ===== BUTTON SHINE EFFECT ===== */
.btn-shine {
    position: relative;
    overflow: hidden;
}

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

@keyframes shine {
    0% {
        left: -100%;
    }
    20%, 100% {
        left: 100%;
    }
}

/* ===== CARD HOVER EFFECTS ===== */
.card-hover-glow {
    transition: all 0.3s ease;
}

.card-hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2),
                0 10px 40px rgba(0, 0, 0, 0.3);
}

/* ===== ICON BOUNCE ===== */
.icon-bounce:hover {
    animation: iconBounce 0.5s ease;
}

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

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

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

/* ===== ROTATE ANIMATION ===== */
.rotate-slow {
    animation: rotateSlow 20s linear infinite;
}

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

/* ===== BORDER GRADIENT ANIMATION ===== */
.border-gradient-animate {
    position: relative;
    background: var(--color-bg-card);
    border-radius: var(--border-radius-lg);
    z-index: 1;
}

.border-gradient-animate::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg,
        var(--color-accent-1),
        var(--color-accent-2),
        var(--color-accent-3),
        var(--color-accent-1));
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: borderGradient 4s ease infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.border-gradient-animate:hover::before {
    opacity: 1;
}

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

/* ===== NUMBER COUNTER EFFECT ===== */
.counter {
    display: inline-block;
}

/* ===== WAVE ANIMATION FOR SECTIONS ===== */
.wave-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.wave-divider .shape-fill {
    fill: var(--color-bg-secondary);
}

/* ===== MARQUEE EFFECT ===== */
.marquee {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* ===== MORPHING BLOB BACKGROUND ===== */
.blob-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -2;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    mix-blend-mode: screen;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    top: -10%;
    left: -10%;
    animation: blobMorph1 25s ease-in-out infinite;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
    bottom: -15%;
    right: -10%;
    animation: blobMorph2 20s ease-in-out infinite;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #3b82f6 0%, #00d4ff 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: blobMorph3 22s ease-in-out infinite;
}

@keyframes blobMorph1 {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: translate(30px, -50px) rotate(45deg);
    }
    50% {
        border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
        transform: translate(-20px, 20px) rotate(90deg);
    }
    75% {
        border-radius: 60% 40% 60% 30% / 70% 30% 50% 60%;
        transform: translate(20px, 30px) rotate(135deg);
    }
}

@keyframes blobMorph2 {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
        transform: translate(0, 0) scale(1);
    }
    33% {
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
        transform: translate(-30px, 30px) scale(1.1);
    }
    66% {
        border-radius: 50% 60% 30% 60% / 70% 40% 70% 30%;
        transform: translate(20px, -20px) scale(0.95);
    }
}

@keyframes blobMorph3 {
    0%, 100% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* ===== INTERACTIVE GRID BACKGROUND ===== */
.grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    z-index: -1;
}

@keyframes gridMove {
    from {
        background-position: 0 0, 0 0;
    }
    to {
        background-position: 50px 50px, 50px 50px;
    }
}

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

.btn-ripple .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== BUTTON MAGNETIC EFFECT ===== */
.btn-magnetic {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ===== BUTTON GLOW ON HOVER ===== */
.btn-glow {
    transition: all 0.3s ease;
}

.btn-glow:hover {
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.5),
        0 0 40px rgba(0, 212, 255, 0.3),
        0 0 60px rgba(0, 212, 255, 0.1);
}

/* ===== BUTTON ARROW SLIDE ===== */
.btn-arrow-slide {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-arrow-slide .arrow {
    transition: transform 0.3s ease;
}

.btn-arrow-slide:hover .arrow {
    transform: translateX(5px);
}

/* ===== BUTTON GRADIENT BORDER SPIN ===== */
.btn-gradient-border {
    position: relative;
    background: var(--color-bg-primary);
    z-index: 1;
}

.btn-gradient-border::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: conic-gradient(
        from 0deg,
        var(--color-accent-1),
        var(--color-accent-2),
        var(--color-accent-3),
        var(--color-accent-1)
    );
    border-radius: inherit;
    z-index: -1;
    animation: spinGradient 3s linear infinite;
}

.btn-gradient-border::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--color-bg-primary);
    border-radius: inherit;
    z-index: -1;
}

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

/* ===== TEXT REVEAL ANIMATION ===== */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: textReveal 0.8s ease forwards;
}

.text-reveal span:nth-child(1) { animation-delay: 0s; }
.text-reveal span:nth-child(2) { animation-delay: 0.05s; }
.text-reveal span:nth-child(3) { animation-delay: 0.1s; }
.text-reveal span:nth-child(4) { animation-delay: 0.15s; }
.text-reveal span:nth-child(5) { animation-delay: 0.2s; }
.text-reveal span:nth-child(6) { animation-delay: 0.25s; }
.text-reveal span:nth-child(7) { animation-delay: 0.3s; }
.text-reveal span:nth-child(8) { animation-delay: 0.35s; }
.text-reveal span:nth-child(9) { animation-delay: 0.4s; }
.text-reveal span:nth-child(10) { animation-delay: 0.45s; }

@keyframes textReveal {
    to {
        transform: translateY(0);
    }
}

/* ===== WORD SLIDE UP ===== */
.word-slide-up {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.word-slide-up.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 3D CARD TILT ===== */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

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

.card-3d-inner {
    transform: translateZ(20px);
}

/* ===== GLITCH TEXT EFFECT ===== */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitchTop 2s linear infinite;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    -webkit-clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}

.glitch::after {
    animation: glitchBottom 1.5s linear infinite;
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
    -webkit-clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
}

@keyframes glitchTop {
    0%, 100% {
        transform: translate(0);
        color: var(--color-accent-1);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitchBottom {
    0%, 100% {
        transform: translate(0);
        color: var(--color-accent-2);
    }
    25% {
        transform: translate(2px, 0);
    }
    50% {
        transform: translate(-2px, 0);
    }
    75% {
        transform: translate(0, 2px);
    }
}

/* ===== NEON GLOW TEXT ===== */
.neon-text {
    text-shadow:
        0 0 5px var(--color-accent-1),
        0 0 10px var(--color-accent-1),
        0 0 20px var(--color-accent-1),
        0 0 40px var(--color-accent-2);
    animation: neonFlicker 3s infinite;
}

@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow:
            0 0 5px var(--color-accent-1),
            0 0 10px var(--color-accent-1),
            0 0 20px var(--color-accent-1),
            0 0 40px var(--color-accent-2);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

/* ===== PULSE RING ===== */
.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    inset: -10px;
    border: 2px solid var(--color-accent-1);
    border-radius: inherit;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* ===== FLOATING PARTICLES ENHANCED ===== */
.particle-enhanced {
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, var(--color-accent-1) 0%, transparent 70%);
    box-shadow: 0 0 10px var(--color-accent-1);
}

/* ===== SCAN LINE EFFECT ===== */
.scan-lines::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    animation: scanlines 10s linear infinite;
}

@keyframes scanlines {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 0 100%;
    }
}

/* ===== ICON SPIN ON HOVER ===== */
.icon-spin:hover svg,
.icon-spin:hover .icon {
    animation: iconSpin 0.6s ease;
}

@keyframes iconSpin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* ===== SERVICE ICON FLOAT ===== */
.service-icon-animated {
    animation: serviceIconFloat 3s ease-in-out infinite;
}

@keyframes serviceIconFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(2deg);
    }
    75% {
        transform: translateY(5px) rotate(-2deg);
    }
}

/* ===== MARQUEE ENHANCED ===== */
.marquee-track {
    display: flex;
    animation: marqueeScroll 40s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused;
}

@keyframes marqueeScroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* ===== CANVAS OVERLAY ===== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===== SMOOTH SECTION TRANSITIONS ===== */
.section-transition {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-transition.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animated-bg::before,
    .orb,
    .particle,
    .blob,
    .grid-bg {
        animation: none;
    }

    #particle-canvas {
        display: none;
    }
}
