/* ==============================================
   ECHODATAGRIDAPEX - Rich Animations Library
   ============================================== */

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger Delays */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* Floating Animation */
@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.float-animation {
    animation: floatY 6s ease-in-out infinite;
}

/* Glow Pulse */
@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), 0 0 80px rgba(0, 212, 255, 0.3);
    }
}

.glow-pulse {
    animation: glowPulse 3s ease-in-out infinite;
}

/* Rotate */
@keyframes rotate360 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotate-slow {
    animation: rotate360 20s linear infinite;
}

.rotate-medium {
    animation: rotate360 12s linear infinite;
}

.rotate-fast {
    animation: rotate360 6s linear infinite;
}

.rotate-reverse {
    animation: rotate360 15s linear infinite reverse;
}

/* Typewriter */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent-cyan);
    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(--accent-cyan); }
}

/* Gradient Shift */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gradient-shift {
    background: linear-gradient(270deg, #00d4ff, #0066ff, #8b5cf6, #ff6b35, #00d4ff);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Neon Glow Border */
@keyframes neonBorder {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 212, 255, 0.3), inset 0 0 10px rgba(0, 212, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 212, 255, 0.6), inset 0 0 20px rgba(0, 212, 255, 0.2);
    }
}

.neon-border {
    animation: neonBorder 2.5s ease-in-out infinite;
}

/* Loading Dots */
@keyframes loadingDot {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.loading-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    margin: 0 4px;
    animation: loadingDot 1.4s ease-in-out infinite;
}

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

/* Slide Up */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Slide In Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Slide In Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Zoom In */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.bounce {
    animation: bounce 2s ease infinite;
}

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

.shake {
    animation: shake 0.5s ease;
}

/* Morph Background */
@keyframes morphBg {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

.morph-blob {
    animation: morphBg 8s ease-in-out infinite;
}

/* Wave */
@keyframes wave {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(2deg); }
    75% { transform: translateY(10px) rotate(-2deg); }
}

.wave {
    animation: wave 4s ease-in-out infinite;
}

/* Code Scan */
@keyframes codeScan {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.code-scan::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    animation: codeScan 3s linear infinite;
}

/* Orbit */
@keyframes orbit {
    from { transform: rotate(0deg) translateX(100px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(100px) rotate(-360deg); }
}

.orbit {
    animation: orbit 10s linear infinite;
}

/* Glitch Effect */
@keyframes glitch {
    0%, 100% {
        text-shadow: 0.05em 0 0 var(--accent-cyan), -0.05em -0.025em 0 var(--accent-purple), 0.025em 0.05em 0 var(--accent-orange);
    }
    14% {
        text-shadow: 0.05em 0 0 var(--accent-cyan), -0.05em -0.025em 0 var(--accent-purple), 0.025em 0.05em 0 var(--accent-orange);
    }
    15% {
        text-shadow: -0.05em -0.025em 0 var(--accent-cyan), 0.025em 0.025em 0 var(--accent-purple), -0.05em -0.05em 0 var(--accent-orange);
    }
    49% {
        text-shadow: -0.05em -0.025em 0 var(--accent-cyan), 0.025em 0.025em 0 var(--accent-purple), -0.05em -0.05em 0 var(--accent-orange);
    }
    50% {
        text-shadow: 0.025em 0.05em 0 var(--accent-cyan), 0.05em 0 0 var(--accent-purple), 0 -0.05em 0 var(--accent-orange);
    }
    99% {
        text-shadow: 0.025em 0.05em 0 var(--accent-cyan), 0.05em 0 0 var(--accent-purple), 0 -0.05em 0 var(--accent-orange);
    }
}

.glitch-text {
    animation: glitch 2s infinite;
}

/* Border Trace */
@keyframes borderTrace {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.border-trace {
    position: relative;
    background: var(--card-bg);
    border: none;
}

.border-trace::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple), var(--accent-cyan));
    background-size: 200% 100%;
    -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;
    animation: borderTrace 3s linear infinite;
}

/* Scanline */
@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.5), transparent);
    z-index: 9999;
    pointer-events: none;
    animation: scanline 6s linear infinite;
}

/* Hover Lift */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}

.hover-lift:hover {
    transform: translateY(-12px);
    box-shadow: 0 24px 60px rgba(0, 212, 255, 0.3);
}

/* Underline Animation */
.hover-underline {
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-cyan);
    transition: width 0.3s ease;
}

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

/* Counter Animation */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.count-up {
    animation: countUp 1s ease forwards;
}

/* Parallax */
.parallax {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Magnetic */
.magnetic {
    transition: transform 0.3s ease;
}

/* Line Drawing */
@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 3s ease forwards;
}

/* Progress Bar */
@keyframes progressFill {
    from { width: 0%; }
    to { width: 100%; }
}

.progress-fill {
    animation: progressFill 2s ease forwards;
}

/* Number Ticker */
@keyframes ticker {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

/* Pulse Circle */
@keyframes pulseCircle {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.pulse-circle::before,
.pulse-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulseCircle 2s ease-out infinite;
}

.pulse-circle::after {
    animation-delay: 1s;
}

/* Matrix Rain Effect (decorative) */
.matrix-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.1;
}

.matrix-char {
    position: absolute;
    color: var(--accent-green);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    animation: matrixFall 8s linear infinite;
}

@keyframes matrixFall {
    0% {
        transform: translateY(-100%);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* 3D Tilt */
.tilt-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

/* Card Stack */
.stack-card {
    transition: all 0.4s ease;
}

.stack-card:hover {
    transform: translateY(-10px) scale(1.02);
}

/* Loading Spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Neon Text */
.neon-text {
    color: var(--text-primary);
    text-shadow:
        0 0 5px rgba(0, 212, 255, 0.5),
        0 0 10px rgba(0, 212, 255, 0.5),
        0 0 20px rgba(0, 212, 255, 0.3),
        0 0 40px rgba(0, 212, 255, 0.3);
}

/* Holographic Card */
.holographic {
    background: linear-gradient(135deg,
        rgba(0, 212, 255, 0.1),
        rgba(139, 92, 246, 0.1),
        rgba(255, 107, 53, 0.1));
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}

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

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Tag Cloud Animation */
@keyframes tagFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.tag-float {
    animation: tagFloat 3s ease-in-out infinite;
}

/* Marquee */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee {
    display: flex;
    overflow: hidden;
}

.marquee-track {
    display: flex;
    gap: 48px;
    animation: marquee 30s linear infinite;
    white-space: nowrap;
}

.marquee-item {
    flex-shrink: 0;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 16px;
}

.marquee-item::after {
    content: '◆';
    color: var(--accent-cyan);
    font-size: 0.7rem;
}

/* Hexagon Pattern (decorative) */
.hex-pattern {
    background-image:
        radial-gradient(circle at 1px 1px, rgba(0, 212, 255, 0.15) 1px, transparent 0);
    background-size: 30px 30px;
}

/* Diagonal Lines */
.diagonal-lines {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 212, 255, 0.03) 10px,
        rgba(0, 212, 255, 0.03) 20px
    );
}