/* ========================================
   ANIMATION 3D HERO SMARTPHONE
======================================== */

/* Container principal de l'animation */
.hero-animation-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    min-height: 600px;
}

.hero-3d-container {
    width: 100%;
    height: 600px;
    position: relative;
    perspective: 1000px;
}
.phone-3d {
    width: 300px;
    height: 580px;
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) rotateY(-15deg) rotateX(5deg);
    transform-style: preserve-3d;
    animation: phoneRotate 20s ease-in-out infinite;
    z-index: 10;
}

@keyframes phoneRotate {
    /* Étape 1: Photo (0-25%) */
    0%, 20% {
        transform: translate(-50%, -50%) rotateY(-15deg) rotateX(5deg);
    }
    /* Étape 2: Analyse (25-50%) */
    25%, 45% {
        transform: translate(-50%, -50%) rotateY(0deg) rotateX(0deg) scale(1.05);
    }
    /* Étape 3: Rapport (50-75%) */
    50%, 70% {
        transform: translate(-50%, -50%) rotateY(15deg) rotateX(-5deg);
    }
    /* Étape 4: Export (75-100%) */
    75%, 95% {
        transform: translate(-50%, -50%) rotateY(0deg) rotateX(0deg) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) rotateY(-15deg) rotateX(5deg);
    }
}

.phone-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #2c3e50 0%, #1a1a2e 100%);
    border-radius: 40px;
    position: relative;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.2);
    border: 3px solid #34495e;
}

.phone-screen {
    width: 90%;
    height: 92%;
    background: #0f172a;
    position: absolute;
    top: 4%;
    left: 5%;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
}

/* ========================================
   ÉTAPE 1: PHOTOGRAPHIEZ (0-25% = 0-5s)
======================================== */
.camera-mode {
    width: 100%;
    height: 100%;
    position: absolute;
    opacity: 0;
    animation: showCamera 20s ease-in-out infinite;
    background: linear-gradient(135deg, #1e3a8a 0%, #312e81 50%, #1e293b 100%);
}

@keyframes showCamera {
    0%, 20% { opacity: 1; }
    25%, 100% { opacity: 0; }
}

.camera-interface {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.camera-viewfinder {
    position: relative;
    width: 220px;
    height: 220px;
}

.viewfinder-corner {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid #fbbf24;
    animation: cornerPulse 2s ease-in-out infinite;
}

@keyframes cornerPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.viewfinder-corner.tl {
    top: 0; left: 0;
    border-right: none;
    border-bottom: none;
}

.viewfinder-corner.tr {
    top: 0; right: 0;
    border-left: none;
    border-bottom: none;
}

.viewfinder-corner.bl {
    bottom: 0; left: 0;
    border-right: none;
    border-top: none;
}

.viewfinder-corner.br {
    bottom: 0; right: 0;
    border-left: none;
    border-top: none;
}

.capture-button {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    border: 5px solid #fbbf24;
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.5);
    animation: captureButton 20s ease-in-out infinite;
}

@keyframes captureButton {
    0%, 18% {
        transform: translateX(-50%) scale(1);
    }
    20% {
        transform: translateX(-50%) scale(0.9);
    }
    22% {
        transform: translateX(-50%) scale(1.2);
    }
    25%, 100% {
        opacity: 0;
        transform: translateX(-50%) scale(0);
    }
}

.camera-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, transparent 60%);
    opacity: 0;
    animation: cameraFlash 20s ease-in-out infinite;
}

@keyframes cameraFlash {
    0%, 21% { opacity: 0; }
    22% { opacity: 1; }
    23%, 100% { opacity: 0; }
}

/* ========================================
   ÉTAPE 2: ANALYSEZ (25-50% = 5-10s)
======================================== */
.ai-analysis {
    width: 100%;
    height: 100%;
    position: absolute;
    opacity: 0;
    animation: showAnalysis 20s ease-in-out infinite;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@keyframes showAnalysis {
    0%, 24% { opacity: 0; }
    25%, 45% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.ai-scanner {
    width: 200px;
    height: 200px;
    position: relative;
    margin-bottom: 30px;
}

.scan-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(0deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: gridMove 2s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

.ai-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: aiPulse 2s ease-in-out infinite;
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.4);
    font-size: 40px;
}

@keyframes aiPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 3px 0;
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    animation: progressFill 20s ease-out infinite;
}

@keyframes progressFill {
    0%, 25% { width: 0%; }
    45% { width: 100%; }
    50%, 100% { width: 100%; }
}

/* ========================================
   ÉTAPE 3: RAPPORT (50-75% = 10-15s)
======================================== */
.report-ready {
    width: 100%;
    height: 100%;
    position: absolute;
    opacity: 0;
    animation: showReport 20s ease-in-out infinite;
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@keyframes showReport {
    0%, 49% { opacity: 0; }
    50%, 70% { opacity: 1; }
    75%, 100% { opacity: 0; }
}

.report-document {
    width: 160px;
    height: 200px;
    background: white;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: documentAppear 20s ease-in-out infinite;
}

@keyframes documentAppear {
    0%, 49% {
        transform: translateY(50px) scale(0);
        opacity: 0;
    }
    52% {
        transform: translateY(0) scale(1.1);
        opacity: 1;
    }
    55%, 70% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    75%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }
}

.document-lines {
    position: absolute;
    top: 25px;
    left: 20px;
    right: 20px;
}

.document-line {
    height: 3px;
    background: #e5e7eb;
    margin-bottom: 8px;
    border-radius: 2px;
}

.document-line:nth-child(1) { width: 80%; }
.document-line:nth-child(2) { width: 100%; }
.document-line:nth-child(3) { width: 90%; }
.document-line:nth-child(4) { width: 100%; }
.document-line:nth-child(5) { width: 70%; }

.success-badge {
    width: 60px;
    height: 60px;
    background: #10b981;
    border-radius: 50%;
    position: absolute;
    top: -30px;
    right: -20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 30px;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    animation: checkAppear 20s ease-in-out infinite;
}

@keyframes checkAppear {
    0%, 52% {
        transform: scale(0);
    }
    55% {
        transform: scale(1.2);
    }
    57%, 70% {
        transform: scale(1);
    }
    75%, 100% {
        transform: scale(0);
    }
}

/* ========================================
   ÉTAPE 4: EXPORT (75-100% = 15-20s)
======================================== */
.export-screen {
    width: 100%;
    height: 100%;
    position: absolute;
    opacity: 0;
    animation: showExport 20s ease-in-out infinite;
    background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@keyframes showExport {
    0%, 74% { opacity: 0; }
    75%, 95% { opacity: 1; }
    100% { opacity: 0; }
}

.export-document-small {
    width: 120px;
    height: 150px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    position: relative;
}

.export-document-small .document-lines {
    top: 20px;
    left: 15px;
    right: 15px;
}

.export-document-small .document-line {
    height: 2px;
    margin-bottom: 6px;
}

.export-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 0 20px;
    animation: optionsAppear 20s ease-in-out infinite;
}

@keyframes optionsAppear {
    0%, 76% {
        transform: scale(0);
        opacity: 0;
    }
    78% {
        transform: scale(1.1);
        opacity: 1;
    }
    80%, 95% {
        transform: scale(1);
        opacity: 1;
    }
    98%, 100% {
        transform: scale(0.8);
        opacity: 0;
    }
}

.export-btn {
    padding: 10px 15px;
    background: white;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.export-btn.pdf { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.export-btn.share { background: linear-gradient(135deg, #0ea5e9, #0284c7); color: white; }
.export-btn.gdocs { background: linear-gradient(135deg, #6b7280, #4b5563); color: white; }
.export-btn.duerp { background: linear-gradient(135deg, #f97316, #ea580c); color: white; }
.export-btn.evrp { background: linear-gradient(135deg, #dc2626, #b91c1c); color: white; }
.export-btn.excel { background: linear-gradient(135deg, #16a34a, #15803d); color: white; }

/* ========================================
   TEXTES D'ÉTAPES
======================================== */
.step-title {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    z-index: 20;
}

.step-title h3 {
    font-size: 32px;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.step-title p {
    font-size: 16px;
    margin-top: 10px;
    opacity: 0.9;
    font-weight: 500;
}

/* Étape 1: PHOTOGRAPHIEZ */
.title-photo {
    animation: titleStep1 20s ease-in-out infinite;
}

@keyframes titleStep1 {
    0%, 2% {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    5%, 20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    23%, 100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
}

/* Étape 2: ANALYSEZ */
.title-analyze {
    animation: titleStep2 20s ease-in-out infinite;
}

@keyframes titleStep2 {
    0%, 25% {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    28%, 45% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    48%, 100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
}

/* Étape 3: RAPPORT */
.title-report {
    animation: titleStep3 20s ease-in-out infinite;
}

@keyframes titleStep3 {
    0%, 50% {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    53%, 70% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    73%, 100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
}

/* Étape 4: PARTAGEZ */
.title-export {
    animation: titleStep4 20s ease-in-out infinite;
}

@keyframes titleStep4 {
    0%, 75% {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    78%, 93% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    96%, 100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
}

/* ========================================
   INDICATEURS D'ÉTAPES
======================================== */
.step-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 20;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.step-dot:nth-child(1) { animation: dot1 20s ease-in-out infinite; }
.step-dot:nth-child(2) { animation: dot2 20s ease-in-out infinite; }
.step-dot:nth-child(3) { animation: dot3 20s ease-in-out infinite; }
.step-dot:nth-child(4) { animation: dot4 20s ease-in-out infinite; }

@keyframes dot1 {
    0%, 20% {
        background: white;
        transform: scale(1.5);
    }
    25%, 100% {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
}

@keyframes dot2 {
    0%, 24% {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    25%, 45% {
        background: white;
        transform: scale(1.5);
    }
    50%, 100% {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
}

@keyframes dot3 {
    0%, 49% {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    50%, 70% {
        background: white;
        transform: scale(1.5);
    }
    75%, 100% {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
}

@keyframes dot4 {
    0%, 74% {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    75%, 95% {
        background: white;
        transform: scale(1.5);
    }
    100% {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .animation-container {
        width: 100vw;
        height: 600px;
    }

    .phone-3d {
        width: 240px;
        height: 480px;
    }

    .step-title h3 {
        font-size: 24px;
    }

    .step-title p {
        font-size: 14px;
    }

    .export-options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .export-btn {
        font-size: 10px;
        padding: 8px 12px;
    }
}