/* =================================================================
   STEP 3 - ANALYSE & TRAITEMENT
   Animation Moodia → Robot IA avec transfert de données
   ================================================================= */

/* Container de l'animation */
.moodia-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    min-height: 500px;
}

/* =================================================================
   ANIMATION PRINCIPALE : Moodia → Robot
   ================================================================= */
.transfer-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-3xl);
    margin-bottom: var(--spacing-2xl);
    position: relative;
    width: 100%;
    max-width: 600px;
}

/* Moodia (émetteur) */
.transfer-sender {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    animation: pulse 2s ease-in-out infinite;
}

.transfer-sender__icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(12, 129, 228, 0.1) 0%, rgba(12, 129, 228, 0.2) 100%);
    border-radius: var(--border-radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(12, 129, 228, 0.15);
}

.transfer-sender__icon svg {
    width: 48px;
    height: 48px;
}

.transfer-sender__label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Ligne de transfert avec particules */
.transfer-line {
    flex: 1;
    position: relative;
    height: 4px;
    background: linear-gradient(90deg,
        rgba(12, 129, 228, 0.2) 0%,
        rgba(12, 129, 228, 0.05) 50%,
        rgba(12, 129, 228, 0.2) 100%
    );
    border-radius: 2px;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Label de l'étape au centre de la ligne */
.transfer-line__step {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--color-white);
    border: 2px solid var(--color-primary);
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(12, 129, 228, 0.2);
    animation: labelPulse 2s ease-in-out infinite;
    z-index: 10;
}

@keyframes labelPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 4px 12px rgba(12, 129, 228, 0.2);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 6px 16px rgba(12, 129, 228, 0.3);
    }
}

/* Particules de données */
.transfer-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    animation: particleFlow 2s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(12, 129, 228, 0.6);
}

.transfer-particle:nth-child(1) {
    animation-delay: 0s;
}

.transfer-particle:nth-child(2) {
    animation-delay: 0.4s;
    width: 6px;
    height: 6px;
}

.transfer-particle:nth-child(3) {
    animation-delay: 0.8s;
    width: 10px;
    height: 10px;
}

.transfer-particle:nth-child(4) {
    animation-delay: 1.2s;
    width: 7px;
    height: 7px;
}

.transfer-particle:nth-child(5) {
    animation-delay: 1.6s;
    width: 9px;
    height: 9px;
}

@keyframes particleFlow {
    0% {
        left: -10px;
        opacity: 0;
        transform: translateY(-50%) scale(0);
    }
    10% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    100% {
        left: calc(100% + 10px);
        opacity: 0;
        transform: translateY(-50%) scale(0);
    }
}

/* Robot IA (récepteur) */
.transfer-receiver {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    position: relative;
}

.transfer-receiver__icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(12, 129, 228, 0.9) 0%, rgba(12, 129, 228, 1) 100%);
    border-radius: var(--border-radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(12, 129, 228, 0.3);
    position: relative;
    animation: robotThink 2s ease-in-out infinite;
}

.transfer-receiver__icon svg {
    width: 48px;
    height: 48px;
    color: var(--color-white);
}

@keyframes robotThink {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.05) rotate(-2deg);
    }
    75% {
        transform: scale(1.05) rotate(2deg);
    }
}

/* Cercles de "pensée" du robot */
.transfer-receiver__thinking {
    position: absolute;
    top: -20px;
    right: -20px;
    display: flex;
    gap: 4px;
}

.thinking-dot {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    animation: thinkingDot 1.4s ease-in-out infinite;
}

.thinking-dot:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes thinkingDot {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px) scale(1.2);
        opacity: 1;
    }
}

.transfer-receiver__label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 768px) {
    .transfer-animation {
        gap: var(--spacing-xl);
    }

    .transfer-sender__icon,
    .transfer-receiver__icon {
        width: 64px;
        height: 64px;
    }

    .transfer-sender__icon svg,
    .transfer-receiver__icon svg {
        width: 36px;
        height: 36px;
    }

    .transfer-line__step {
        font-size: var(--font-size-xs);
        padding: calc(var(--spacing-xs) * 0.75) var(--spacing-sm);
    }
}
