/**
 * MODAL DE CONFIRMATION STANDARD
 *
 * Composant réutilisable pour les confirmations d'actions destructives
 * Utilisé pour : purges, suppressions, réinitialisations
 *
 * USAGE :
 * 1. Inclure ce fichier CSS : <link rel="stylesheet" href="assets/css/modal-confirm.css">
 * 2. Inclure le JS : <script src="assets/js/modal-confirm.js"></script>
 * 3. Utiliser la fonction PHP : require_once 'includes/modal_confirm.php';
 */

/* Overlay (fond noir semi-transparent) */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Support de l'ancienne classe pour la compatibilité */
.modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Container de la modal */
.modal-confirm {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    margin: auto;
}

/* Header de la modal */
.modal-header {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 1.25rem;
    text-align: center;
}

.modal-header.warning {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.modal-header.info {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

.modal-header.success {
    background: linear-gradient(135deg, #28a745, #218838);
}

.modal-header i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Corps de la modal */
.modal-body {
    padding: 1.5rem 2rem;
    text-align: center;
}

.modal-body p {
    font-size: 1rem;
    color: #333;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.modal-body .highlight {
    font-size: 1.4rem;
    font-weight: bold;
    color: #dc3545;
    margin: 0.75rem 0;
    display: block;
    word-break: break-word;
}

.modal-body .highlight.large {
    font-size: 1.6rem;
}

.modal-body .warning-text {
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
    padding: 0.75rem;
    border-radius: 6px;
    margin: 0.75rem 0;
    font-weight: 600;
    font-size: 0.9rem;
}

.modal-body .info-text {
    background: #d1ecf1;
    border: 2px solid #17a2b8;
    color: #0c5460;
    padding: 0.75rem;
    border-radius: 6px;
    margin: 0.75rem 0;
    font-weight: 600;
    font-size: 0.9rem;
}

.modal-body .danger-text {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
    padding: 0.75rem;
    border-radius: 6px;
    margin: 0.75rem 0;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Footer de la modal */
.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Boutons de la modal */
.modal-btn {
    padding: 0.65rem 1.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 130px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-btn i {
    font-size: 1rem;
}

/* Bouton Annuler */
.modal-btn-cancel {
    background: #6c757d;
    color: white;
}

.modal-btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Bouton Confirmer (danger) */
.modal-btn-confirm {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.modal-btn-confirm:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Bouton Confirmer (primary) */
.modal-btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.modal-btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

/* Bouton Confirmer (success) */
.modal-btn-success {
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
}

.modal-btn-success:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 576px) {
    .modal-confirm {
        width: 95%;
        max-width: none;
    }

    .modal-header h3 {
        font-size: 1.25rem;
    }

    .modal-header i {
        font-size: 2.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-body p {
        font-size: 1rem;
    }

    .modal-body .highlight {
        font-size: 1.75rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}
