/* Onboarding animations and micro-interactions */

.onboarding-widget {
    animation: slideInDown 0.5s ease-out;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.onboarding-widget:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

.onboarding-progress {
    animation: progressGrow 0.8s ease-out;
}

.onboarding-step-complete {
    animation: checkmark 0.6s ease-out;
}

.celebration-modal .modal-content {
    animation: celebrationBounce 0.6s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progressGrow {
    from {
        width: 0;
    }
    to {
        width: var(--progress-width);
    }
}

@keyframes checkmark {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes celebrationBounce {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    60% {
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Confetti effect for celebration */
.confetti {
    position: fixed;
    top: -10px;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1050;
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #667eea;
    animation: confetti-fall 3s linear infinite;
}

.confetti-piece:nth-child(2n) { background: #764ba2; }
.confetti-piece:nth-child(3n) { background: #f093fb; }
.confetti-piece:nth-child(4n) { background: #f5576c; }

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Pulse animation for important buttons */
.onboarding-cta {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* Smooth transitions */
.onboarding-widget * {
    transition: all 0.2s ease;
}

.progress-bar {
    transition: width 0.8s ease-out;
}

/* ---------- CSP-safe styles for floating onboarding FAB ---------- */
.onboarding-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1040;
}
.onboarding-fab-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.onboarding-fab-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}
.onboarding-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f5576c;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid white;
}
.onboarding-fab-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 1039;
    display: none;
    animation: slideInUp 0.3s ease-out;
}
.onboarding-fab-panel.show {
    display: block;
}
.onboarding-fab-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.onboarding-fab-body {
    padding: 16px;
}
.onboarding-fab-step {
    padding: 6px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.onboarding-fab-step.active {
    font-weight: 600;
}
.onboarding-fab-progress {
    height: 6px;
}
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- CSP-safe styles for onboarding widget (no inline styles) ---------- */
.onboarding-widget--gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}
.onboarding-widget__icon {
    width: 48px;
    height: 48px;
}
.onboarding-steps-list__item {
    margin-bottom: 4px;
}
.onboarding-steps-list__item.is-current { opacity: 1; }
.onboarding-steps-list__item.is-completed { opacity: 0.9; }
.onboarding-steps-list__item.is-upcoming { opacity: 0.5; }
.onboarding-widget__progress {
    height: 4px;
}