/* ═══════════════════════════════════════════════════════
   Gamification & Engagement CSS
   Confetti, bumps, pulses, progress animations
   ═══════════════════════════════════════════════════════ */

/* ── Confetti celebration ── */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    opacity: 0;
    animation: confetti-fall 3s ease-out forwards;
}

.confetti-piece:nth-child(odd) { border-radius: 50%; }
.confetti-piece:nth-child(even) { border-radius: 2px; }

@keyframes confetti-fall {
    0% { opacity: 1; top: -10px; transform: rotate(0deg) scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; top: 100vh; transform: rotate(720deg) scale(0.3); }
}

/* ── KPI bump animation ── */
@keyframes kpi-bump {
    0% { transform: scale(1); }
    30% { transform: scale(1.15); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.kpi-bump {
    animation: kpi-bump 0.5s ease-out;
}

/* ── Success pulse ── */
@keyframes success-pulse {
    0% { box-shadow: 0 0 0 0 rgba(129, 188, 0, 0.5); }
    70% { box-shadow: 0 0 0 12px rgba(129, 188, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(129, 188, 0, 0); }
}

.success-pulse {
    animation: success-pulse 0.8s ease-out;
}

/* ── Check appear ── */
@keyframes check-appear {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(0deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.check-appear {
    animation: check-appear 0.4s ease-out forwards;
}

/* ── Progress bar shimmer ── */
@keyframes progress-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.progress-bar-animated {
    background-image: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 100%
    );
    background-size: 200% 100%;
    animation: progress-shimmer 2s infinite;
}

/* ── Toast notification ── */
.toast-notification {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-notification.show {
    transform: translateX(0);
}

/* ── Score radio celebration ── */
@keyframes radio-check {
    0% { transform: scale(1); }
    40% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.radio-checked {
    animation: radio-check 0.3s ease-out;
}

/* ── Milestone glow ── */
@keyframes milestone-glow {
    0% { box-shadow: 0 0 0 0 rgba(129, 188, 0, 0.6); }
    50% { box-shadow: 0 0 20px 4px rgba(129, 188, 0, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(129, 188, 0, 0); }
}

.milestone-glow {
    animation: milestone-glow 1.5s ease-out;
}

/* ── Tip card slide-in ── */
@keyframes tip-slide-in {
    0% { opacity: 0; transform: translateY(-8px); }
    100% { opacity: 1; transform: translateY(0); }
}

.tip-card {
    animation: tip-slide-in 0.5s ease-out;
}

/* ── Action du Jour highlight ── */
@keyframes action-highlight {
    0% { border-color: rgba(129, 188, 0, 0.3); }
    50% { border-color: rgba(129, 188, 0, 0.8); }
    100% { border-color: rgba(129, 188, 0, 0.3); }
}

.action-highlight {
    animation: action-highlight 2s ease-in-out 1;
}

/* ── Progress percentage counter ── */
.progress-counter {
    transition: all 0.5s ease-out;
}

/* ── Print: disable all animations ── */
@media print {
    .confetti-container,
    .toast-notification { display: none !important; }
    *, *::before, *::after { animation: none !important; }
}
