/**
 * ProgressTracker Styles 
 */

/* ==========================================================================
   Overlay
   ========================================================================== */

.progress-tracker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   Modal
   ========================================================================== */

.progress-tracker-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    padding: 32px;
    animation: slideUp 0.4s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   Header
   ========================================================================== */

.progress-header h3 {
    margin: 0 0 24px 0;
    font-size: 1.5rem;
    color: #1976d2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.progress-header h3 .success-icon {
    font-size: 1.8rem;
    animation: successBounce 0.6s ease;
}

.progress-header h3 .error-icon {
    font-size: 1.8rem;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(25, 118, 210, 0.2);
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Steps
   ========================================================================== */

.progress-steps {
    margin: 24px 0;
}

.progress-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.step-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    min-width: 32px;
    text-align: center;
}

.step-label {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    flex-grow: 1;
}

.step-message {
    font-size: 0.875rem;
    color: #666;
    display: block;
    margin-top: 4px;
    font-style: italic;
}

/* ==========================================================================
   Step States
   ========================================================================== */

.step-pending {
    opacity: 0.5;
}

.step-processing {
    background: #e3f2fd;
    border-left: 4px solid #1976d2;
    opacity: 1;
}

.step-processing .step-icon {
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.step-success {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    opacity: 1;
}

.step-error {
    background: #ffebee;
    border-left: 4px solid #d32f2f;
    opacity: 1;
}

/* Animation d'étape */
.step-animate {
    animation: stepHighlight 0.6s ease;
}

@keyframes stepHighlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 24px 0 8px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1976d2, #42a5f5);
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(25, 118, 210, 0.5);
}

.progress-percentage {
    text-align: center;
    font-size: 0.875rem;
    color: #666;
    font-weight: 600;
    margin-top: 8px;
}

/* ==========================================================================
   Success Modal
   ========================================================================== */

.success-header {
    margin-bottom: 24px;
}

.success-icon {
    font-size: 4rem;
    animation: successBounce 0.6s ease;
}

@keyframes successBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-info {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
}

.success-info p {
    margin: 8px 0;
}

.redirect-message {
    background: #e3f2fd;
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
    text-align: center;
}

.redirect-message p {
    margin: 0;
    color: #1976d2;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.redirect-message p::before {
    content: "↗️";
    font-size: 1.5rem;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.email-address,
.stage-number {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1976d2;
    margin: 8px 0;
    word-break: break-word;
}

.success-actions {
    margin-top: 24px;
}

.success-actions .btn {
    padding: 12px 32px;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #1976d2;
    color: white;
}

.btn-primary:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.btn-secondary {
    background: #757575;
    color: white;
    margin-left: 8px;
}

.btn-secondary:hover {
    background: #616161;
    transform: translateY(-2px);
}

/* ==========================================================================
   Error Details
   ========================================================================== */

.error-details {
    margin-top: 24px;
    text-align: left;
}

.error-details p {
    margin: 8px 0;
    text-align: left;
}

.error-details button {
    margin-top: 10px;
}

.error-details strong {
    color: #b71c1c;
}

.error-icon {
    font-size: 2rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .progress-tracker-modal {
        padding: 24px;
        max-width: 95%;
        border-radius: 12px;
    }

    .progress-header h3 {
        font-size: 1.25rem;
    }

    .step-label {
        font-size: 0.875rem;
    }

    .step-icon {
        font-size: 1.25rem;
        min-width: 28px;
    }

    .success-icon {
        font-size: 3rem;
    }

    .email-address,
    .stage-number {
        font-size: 1rem;
    }

    .success-actions .btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .progress-tracker-modal {
        padding: 20px;
        width: 95%;
    }

    .progress-header h3 {
        font-size: 1.1rem;
        gap: 8px;
    }

    .step-label {
        font-size: 0.8rem;
    }

    .step-message {
        font-size: 0.75rem;
    }

    .success-actions .btn {
        width: 100%;
        margin: 8px 0;
    }

    .btn-secondary {
        margin-left: 0;
    }
}

/* ==========================================================================
   Scrollbar personnalisé (pour les longs contenus)
   ========================================================================== */

.progress-tracker-modal::-webkit-scrollbar {
    width: 8px;
}

.progress-tracker-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.progress-tracker-modal::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.progress-tracker-modal::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ==========================================================================
   Print (masquer lors de l'impression)
   ========================================================================== */

@media print {
    .progress-tracker-overlay {
        display: none !important;
    }
}
