/* ================================================
   Shared Animations — Tech Zone
   ================================================ */

:root {
    --theme-accent: #A9FD3B;
    --theme-accent-alt: #5d88ff;
    --theme-accent-glow: rgba(169,253,59,0.3);
    --theme-accent-glow-strong: rgba(169,253,59,0.75);
}

/* Page entrance */
body { animation: pageFadeIn 0.65s cubic-bezier(0.22,0.61,0.36,1) both; }
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* Floating particles (spawned by particles.js) */
.particles-layer {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0; overflow: hidden;
}
.particle-dot {
    position: absolute; border-radius: 50%;
    animation: floatUp linear infinite; will-change: transform, opacity;
}
@keyframes floatUp {
    0%   { transform: translateY(100vh) scale(0.4); opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { transform: translateY(-8vh) scale(1); opacity: 0; }
}

/* Slide-up entrance */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(36px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Slide in from sides */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-48px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(48px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Bounce in */
@keyframes bounceIn {
    0%   { transform: scale(0.2); opacity: 0; }
    55%  { transform: scale(1.1); opacity: 1; }
    80%  { transform: scale(0.94); }
    100% { transform: scale(1); }
}

/* Green glow pulse — for A9FD3B buttons */
@keyframes greenGlow {
    0%, 100% { box-shadow: 0 0 8px var(--theme-accent-glow), 0 15px 30px rgba(0,0,0,0.12); }
    50%       { box-shadow: 0 0 26px var(--theme-accent-glow-strong), 0 18px 34px rgba(0,0,0,0.18); }
}

/* Shimmer sweep */
@keyframes shimmerSweep {
    0%   { background-position: 0% center; }
    100% { background-position: 300% center; }
}

/* Confetti */
.confetti-piece {
    position: fixed; border-radius: 2px;
    pointer-events: none; z-index: 9999;
    animation: confettiFall linear forwards;
}
@keyframes confettiFall {
    0%   { opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Score pop */
@keyframes scorePop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.25); color: var(--theme-accent); }
    100% { transform: scale(1); }
}

/* Progress bar */
.progress-bar-track {
    width: 100%; height: 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 4px; margin-bottom: 14px; overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-accent), var(--theme-accent-alt));
    border-radius: 4px;
    transition: width 0.45s cubic-bezier(0.4,0,0.2,1);
    width: 0%;
}

/* Ripple on buttons */
.ripple-host { position: relative; overflow: hidden; }
.ripple-wave {
    position: absolute; border-radius: 50%;
    background: rgba(255,255,255,0.45);
    transform: scale(0);
    animation: rippleAnim 0.55s linear;
    pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(5); opacity: 0; } }

/* Stagger utility (set via JS or nth-child) */
.stagger-1 { animation-delay: 0.05s !important; }
.stagger-2 { animation-delay: 0.15s !important; }
.stagger-3 { animation-delay: 0.25s !important; }
.stagger-4 { animation-delay: 0.35s !important; }
.stagger-5 { animation-delay: 0.45s !important; }
.stagger-6 { animation-delay: 0.55s !important; }

.tech-icon-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.tech-icon-layer .tech-icon {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(93, 136, 255, 0.45);
    transform: translate(-50%, -50%);
    user-select: none;
    will-change: transform, opacity;
    animation: floatTech linear infinite;
}

.tech-icon-layer .tech-icon:nth-child(odd) {
    color: rgba(169, 253, 59, 0.48);
}

.tech-icon-layer .tech-icon:nth-child(3n) {
    color: rgba(146, 220, 255, 0.42);
}

.tech-icon-layer .tech-icon:nth-child(3n) {
    font-size: clamp(2.5rem, 4vw, 5rem);
}

@keyframes floatTech {
    0% {
        transform: translate(-50%, -50%) translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    35% {
        transform: translate(-50%, -50%) translate(12px, -20px) rotate(-5deg);
    }
    65% {
        transform: translate(-50%, -50%) translate(-12px, 18px) rotate(4deg);
    }
    100% {
        transform: translate(-50%, -50%) translate(6px, -12px) rotate(0deg);
        opacity: 0;
    }
}
