/* ═══════════════════════════════════════════════════════════════════════════
   MOQBridge — Animation System
═══════════════════════════════════════════════════════════════════════════ */

/* ─── Floating Animation ───────────────────────────────────────────────────── */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33%       { transform: translateY(-16px) rotate(1deg); }
    66%       { transform: translateY(-8px) rotate(-1deg); }
}
@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-12px); }
}
.float { animation: float 6s ease-in-out infinite; }
.float-y { animation: floatY 4s ease-in-out infinite; }
.float-delayed { animation: float 6s ease-in-out 2s infinite; }

/* ─── Glow Pulse ───────────────────────────────────────────────────────────── */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.3); }
    50%       { box-shadow: 0 0 50px rgba(0, 212, 255, 0.6), 0 0 80px rgba(0, 212, 255, 0.2); }
}
@keyframes glowPulsePurple {
    0%, 100% { box-shadow: 0 0 20px rgba(157, 78, 221, 0.3); }
    50%       { box-shadow: 0 0 50px rgba(157, 78, 221, 0.6), 0 0 80px rgba(157, 78, 221, 0.2); }
}
.glow-pulse { animation: glowPulse 3s ease infinite; }
.glow-pulse-purple { animation: glowPulsePurple 3s ease infinite; }

/* ─── Shimmer / Scan Effect ────────────────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.shimmer-text {
    background: linear-gradient(90deg, var(--cyan) 0%, var(--text-white) 40%, var(--purple) 60%, var(--cyan) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

@keyframes scanLine {
    0%   { top: 0; opacity: 0.7; }
    100% { top: 100%; opacity: 0; }
}
.scan-effect {
    position: relative;
    overflow: hidden;
}
.scan-effect::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    top: 0;
    animation: scanLine 3s ease-in-out infinite;
    pointer-events: none;
}

/* ─── Border Glow Animation ────────────────────────────────────────────────── */
@keyframes borderRotate {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.animated-border {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.animated-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: conic-gradient(from 0deg, var(--cyan), var(--purple), var(--pink), var(--cyan));
    z-index: -1;
    animation: borderRotate 4s linear infinite;
}
.animated-border::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: var(--bg-card);
    border-radius: calc(var(--radius-lg) - 2px);
    z-index: 0;
}
.animated-border > * { position: relative; z-index: 1; }

/* ─── Glitch Effect ────────────────────────────────────────────────────────── */
@keyframes glitch1 {
    0%, 100% { clip-path: inset(40% 0 61% 0); transform: translate(-2px, 0); }
    20%       { clip-path: inset(92% 0 1% 0); transform: translate(2px, 0); }
    40%       { clip-path: inset(43% 0 1% 0); transform: translate(-2px, 0); }
    60%       { clip-path: inset(25% 0 58% 0); transform: translate(2px, 0); }
    80%       { clip-path: inset(54% 0 7% 0); transform: translate(-2px, 0); }
}
@keyframes glitch2 {
    0%, 100% { clip-path: inset(50% 0 30% 0); transform: translate(2px, 0); }
    25%       { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 0); }
    50%       { clip-path: inset(70% 0 10% 0); transform: translate(2px, 0); }
    75%       { clip-path: inset(30% 0 50% 0); transform: translate(-2px, 0); }
}
.glitch-text {
    position: relative;
}
.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%;
}
.glitch-text::before {
    color: var(--cyan);
    animation: glitch1 3s infinite linear;
    animation-play-state: paused;
}
.glitch-text::after {
    color: var(--purple);
    animation: glitch2 3s infinite linear;
    animation-play-state: paused;
}
.glitch-text:hover::before,
.glitch-text:hover::after {
    animation-play-state: running;
}

/* ─── Typewriter ───────────────────────────────────────────────────────────── */
.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--cyan);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blinkCursor 0.75s step-end infinite;
}
@keyframes typing { from { width: 0; } to { width: 100%; } }
@keyframes blinkCursor { from, to { border-color: transparent; } 50% { border-color: var(--cyan); } }

/* ─── Counter animation ────────────────────────────────────────────────────── */
.counter-up {
    display: inline-block;
    transition: all 0.05s ease;
}

/* ─── Scroll Reveal ────────────────────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }
.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

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

/* ─── Gradient Orbs ────────────────────────────────────────────────────────── */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    animation: orbDrift 12s ease-in-out infinite;
}
.orb-cyan { background: radial-gradient(circle, rgba(0, 212, 255, 0.25) 0%, transparent 70%); }
.orb-purple { background: radial-gradient(circle, rgba(157, 78, 221, 0.25) 0%, transparent 70%); animation-delay: -4s; }
.orb-pink { background: radial-gradient(circle, rgba(255, 0, 110, 0.15) 0%, transparent 70%); animation-delay: -8s; }
@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%       { transform: translate(30px, -20px) scale(1.05); }
    50%       { transform: translate(-20px, 30px) scale(0.95); }
    75%       { transform: translate(20px, 20px) scale(1.02); }
}

/* ─── Neon line decorations ────────────────────────────────────────────────── */
.neon-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    box-shadow: 0 0 10px var(--cyan);
    animation: neonFlicker 4s ease infinite;
}
@keyframes neonFlicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.3; }
    94% { opacity: 1; }
    96% { opacity: 0.5; }
    97% { opacity: 1; }
}

/* ─── Holographic gradient card ────────────────────────────────────────────── */
.holo-card {
    position: relative;
    overflow: hidden;
}
.holo-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 0%,
        rgba(0, 212, 255, 0.04) 30%,
        rgba(157, 78, 221, 0.06) 50%,
        rgba(0, 212, 255, 0.04) 70%,
        transparent 100%
    );
    background-size: 200% 200%;
    animation: holoShift 6s ease infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes holoShift {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

/* ─── Loading spinner ──────────────────────────────────────────────────────── */
.spinner {
    width: 24px; height: 24px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
.spinner-lg { width: 48px; height: 48px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── AI Thinking animation ────────────────────────────────────────────────── */
.ai-thinking {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ai-thinking span {
    width: 8px; height: 8px;
    background: var(--cyan);
    border-radius: 50%;
    animation: aiPulse 1.2s ease infinite;
}
.ai-thinking span:nth-child(2) { animation-delay: 0.2s; background: var(--purple); }
.ai-thinking span:nth-child(3) { animation-delay: 0.4s; background: var(--pink); }
@keyframes aiPulse {
    0%, 100% { transform: scale(0.7); opacity: 0.5; }
    50%       { transform: scale(1.2); opacity: 1; }
}

/* ─── Progress bars ────────────────────────────────────────────────────────── */
.progress-bar {
    height: 6px;
    background: var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
    margin: 8px 0;
}
.progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill-cyan { background: linear-gradient(90deg, var(--cyan), rgba(0, 212, 255, 0.5)); box-shadow: 0 0 8px var(--cyan); }
.progress-fill-purple { background: linear-gradient(90deg, var(--purple), rgba(157, 78, 221, 0.5)); box-shadow: 0 0 8px var(--purple); }
.progress-fill-green { background: linear-gradient(90deg, var(--green), rgba(0, 255, 136, 0.5)); box-shadow: 0 0 8px var(--green); }
.progress-fill-gold { background: linear-gradient(90deg, var(--gold), rgba(255, 214, 10, 0.5)); box-shadow: 0 0 8px var(--gold); }
.progress-fill-red { background: linear-gradient(90deg, var(--red), rgba(255, 51, 102, 0.5)); box-shadow: 0 0 8px var(--red); }

/* ─── Page transitions ─────────────────────────────────────────────────────── */
.page-enter {
    animation: pageEnter 0.5s ease forwards;
}
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Hover glow buttons ───────────────────────────────────────────────────── */
.hover-glow {
    transition: var(--transition);
    position: relative;
}
.hover-glow::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    opacity: 0;
    z-index: -1;
    filter: blur(12px);
    transition: var(--transition);
}
.hover-glow:hover::after { opacity: 0.5; }

/* ─── 3D Card Tilt (CSS perspective) ──────────────────────────────────────── */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.1s ease;
}

/* ─── Gradient borders ─────────────────────────────────────────────────────── */
.gradient-border {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}
.gradient-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: calc(var(--radius-lg) + 1px);
    background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
    z-index: -1;
    opacity: 0.5;
}

/* ─── Hero Dashboard Preview ───────────────────────────────────────────────── */
.dashboard-preview {
    background: rgba(5, 5, 22, 0.9);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-deep), 0 0 80px rgba(0, 212, 255, 0.08);
    animation: dashboardFloat 8s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}
@keyframes dashboardFloat {
    0%, 100% { transform: translateY(0) rotateX(2deg) rotateY(-2deg); }
    50%       { transform: translateY(-16px) rotateX(-1deg) rotateY(1deg); }
}
.dashboard-preview::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40px;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.05), transparent);
    animation: scanLine 4s ease infinite;
    pointer-events: none;
}
.dp-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}
.dp-dot { width: 12px; height: 12px; border-radius: 50%; }
.dp-dot-red { background: #ff5f57; }
.dp-dot-yellow { background: #febc2e; }
.dp-dot-green { background: #28c840; }
.dp-title { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }
.dp-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.dp-metric {
    background: rgba(0, 212, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 14px;
}
.dp-metric-val { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--cyan); }
.dp-metric-lbl { font-family: var(--font-body); font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.dp-bars { display: flex; flex-direction: column; gap: 10px; }
.dp-bar-row { display: flex; align-items: center; gap: 10px; }
.dp-bar-label { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); width: 70px; flex-shrink: 0; }
.dp-bar-track { flex: 1; height: 4px; background: var(--border-subtle); border-radius: 4px; overflow: hidden; }
.dp-bar-fill { height: 100%; border-radius: 4px; animation: fillBarAnim 2s ease forwards; }
@keyframes fillBarAnim { from { width: 0; } }
.dp-bar-val { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); width: 40px; text-align: right; flex-shrink: 0; }
