/*
 * Advanced Animations & 3D Transforms
 * Sophisticated effects in pure CSS for maximum performance
 */

/* ===== MORPHING TEXT EFFECTS ===== */

.morphing-text {
    position: relative;
    display: inline-block;
    overflow: hidden;
}

.morphing-text::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--blue), var(--purple));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    animation: morphing-reveal 3s ease-in-out infinite;
}

@keyframes morphing-reveal {
    0%, 80% {
        opacity: 0;
        transform: translateY(10px);
    }
    10%, 70% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PROFESSIONAL GLITCH EFFECTS ===== */

.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.8;
    pointer-events: none;
}

.glitch-text::before {
    color: var(--blue);
    animation: glitch-1 2s infinite linear alternate-reverse;
    z-index: -1;
}

.glitch-text::after {
    color: var(--purple);
    animation: glitch-2 2s infinite linear alternate-reverse;
    z-index: -2;
}

@keyframes glitch-1 {
    0% {
        transform: translate(0);
        clip-path: polygon(0 0, 100% 0, 100% 5%, 0 5%);
    }
    5% {
        transform: translate(-2px, 1px);
        clip-path: polygon(0 0, 100% 0, 100% 10%, 0 10%);
    }
    10% {
        transform: translate(-1px, -1px);
        clip-path: polygon(0 0, 100% 0, 100% 15%, 0 15%);
    }
    15% {
        transform: translate(1px, 1px);
        clip-path: polygon(0 0, 100% 0, 100% 20%, 0 20%);
    }
    20% {
        transform: translate(-1px, -1px);
        clip-path: polygon(0 0, 100% 0, 100% 25%, 0 25%);
    }
    25% {
        transform: translate(0);
        clip-path: polygon(0 0, 100% 0, 100% 30%, 0 30%);
    }
    100% {
        transform: translate(0);
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

@keyframes glitch-2 {
    0% {
        transform: translate(0);
        clip-path: polygon(0 15%, 100% 15%, 100% 30%, 0 30%);
    }
    15% {
        transform: translate(2px, -1px);
        clip-path: polygon(0 10%, 100% 10%, 100% 25%, 0 25%);
    }
    30% {
        transform: translate(-1px, 1px);
        clip-path: polygon(0 20%, 100% 20%, 100% 35%, 0 35%);
    }
    45% {
        transform: translate(1px, -1px);
        clip-path: polygon(0 25%, 100% 25%, 100% 40%, 0 40%);
    }
    60% {
        transform: translate(-2px, 1px);
        clip-path: polygon(0 30%, 100% 30%, 100% 45%, 0 45%);
    }
    75% {
        transform: translate(0);
        clip-path: polygon(0 35%, 100% 35%, 100% 50%, 0 50%);
    }
    100% {
        transform: translate(0);
        clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
    }
}

/* ===== PARTICLE TRAIL EFFECTS ===== */

.particle-trail {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--blue);
    border-radius: 50%;
    pointer-events: none;
    animation: particle-fade 1s ease-out forwards;
}

@keyframes particle-fade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.3) translateY(-20px);
    }
}

/* ===== PROFESSIONAL HOVER EFFECTS ===== */

.magnetic-hover {
    transition: transform 0.3s ease-out;
    cursor: pointer;
}

.magnetic-hover:hover {
    transform: translateY(-2px);
}

.card-hover-3d {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    transform-style: preserve-3d;
}

.card-hover-3d:hover {
    transform: translateY(-8px) rotateX(5deg) rotateY(5deg);
    box-shadow: var(--shadow-2xl);
}

/* ===== LIQUID MORPHING SHAPES ===== */

.liquid-shape {
    background: linear-gradient(45deg, var(--slate-700), var(--slate-800));
    border-radius: 40% 60% 70% 30% / 50% 30% 60% 40%;
    animation: liquid-morph 8s ease-in-out infinite;
}

@keyframes liquid-morph {
    0%, 100% {
        border-radius: 40% 60% 70% 30% / 50% 30% 60% 40%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 30% 70% 40% 60% / 60% 40% 30% 70%;
        transform: rotate(45deg) scale(1.05);
    }
    50% {
        border-radius: 70% 30% 60% 40% / 30% 70% 40% 60%;
        transform: rotate(90deg) scale(0.95);
    }
    75% {
        border-radius: 60% 40% 30% 70% / 70% 60% 40% 30%;
        transform: rotate(135deg) scale(1.02);
    }
}

/* ===== HOLOGRAPHIC EFFECTS ===== */

.holographic {
    position: relative;
    background: linear-gradient(135deg, var(--slate-800), var(--slate-900));
    overflow: hidden;
}

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

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

/* ===== NEURAL NETWORK LINES ===== */

.neural-line {
    stroke: var(--slate-400);
    stroke-width: 1;
    fill: none;
    opacity: 0.3;
    animation: neural-pulse 3s ease-in-out infinite;
}

.neural-node {
    fill: var(--slate-600);
    r: 4;
    animation: neural-glow 2s ease-in-out infinite;
}

@keyframes neural-pulse {
    0%, 100% {
        opacity: 0.3;
        stroke-width: 1;
    }
    50% {
        opacity: 0.8;
        stroke-width: 2;
    }
}

@keyframes neural-glow {
    0%, 100% {
        fill: var(--slate-600);
        r: 4;
    }
    50% {
        fill: var(--blue);
        r: 6;
    }
}

/* ===== SMOOTH REVEAL ANIMATIONS ===== */

.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    animation: reveal-up 0.8s ease-out forwards;
}

.reveal-up.delay-1 { animation-delay: 0.2s; }
.reveal-up.delay-2 { animation-delay: 0.4s; }
.reveal-up.delay-3 { animation-delay: 0.6s; }

@keyframes reveal-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    animation: reveal-scale 0.6s ease-out forwards;
}

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



/* ===== PROFESSIONAL PROGRESS ANIMATIONS ===== */

.progress-bar {
    position: relative;
    overflow: hidden;
    background: var(--slate-200);
    border-radius: var(--radius-full);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--purple));
    border-radius: var(--radius-full);
    transition: width 0.3s ease-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progress-shimmer 2s ease-in-out infinite;
}

@keyframes progress-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===== ADVANCED COUNTER ANIMATIONS ===== */

.counter-animation {
    transition: transform 0.3s ease-out;
}

.counter-animation.updating {
    transform: translateY(-5px);
}

/* ===== SOPHISTICATED BUTTON EFFECTS ===== */

.btn-magnetic {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease-out;
}

.btn-magnetic::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease-out, height 0.3s ease-out;
}

.btn-magnetic:hover::before {
    width: 300px;
    height: 300px;
}

.btn-magnetic:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

/* ===== RESPONSIVE ANIMATION OPTIMIZATIONS ===== */

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

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

.will-change-transform {
    will-change: transform;
}

.will-change-auto {
    will-change: auto;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===== BACKGROUND CANVAS STYLES ===== */

.background-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.8;
}

.neural-network-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    opacity: 0.1;
}