/* Boîte de dialogue de confirmation personnalisée */

/* z-index très élevé pour passer au-dessus du burger menu (9999) et du footer */
.custom-confirm-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px);
    z-index: 9999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
    margin: 0 !important;
    overflow: auto !important;
}

.custom-confirm-overlay.show {
    opacity: 1;
}

.custom-confirm-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    position: relative;
    z-index: 100000 !important;
}

.custom-confirm-overlay.show .custom-confirm-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.custom-confirm-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 3px solid #1976D2;
}

.custom-confirm-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.custom-confirm-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    flex: 1;
}

.custom-confirm-body {
    padding: 1.5rem;
}

.custom-confirm-message {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    white-space: pre-line;
}

.custom-confirm-message--html {
    white-space: normal;
}

.custom-confirm-dialog--recap {
    max-width: 560px;
}

.custom-confirm-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.custom-confirm-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    outline: none;
}

.custom-confirm-btn:focus {
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.2);
}

.custom-confirm-btn-cancel {
    background: white;
    color: #666;
    border-color: #ccc;
}

.custom-confirm-btn-cancel:hover {
    background: #f5f5f5;
    border-color: #999;
    color: #333;
}

.custom-confirm-btn-cancel:active {
    background: #e0e0e0;
}

.custom-confirm-btn-confirm {
    background-color: #1976D2;
    color: white;
    border-color: #1976D2;
}

.custom-confirm-btn-confirm:hover {
    background-color: #1565C0;
    border-color: #1565C0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.custom-confirm-btn-confirm:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* S'assurer que la modale est toujours au-dessus du footer */
body:has(.custom-confirm-overlay) {
    overflow: hidden !important;
}

/* Responsive */
@media (max-width: 600px) {
    .custom-confirm-overlay {
        padding: 0.5rem !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .custom-confirm-dialog {
        max-width: 95% !important;
        margin: 0 !important;
        max-height: 85vh !important;
    }
    
    .custom-confirm-header {
        padding: 1.25rem 1.25rem 0.75rem;
    }
    
    .custom-confirm-icon {
        font-size: 1.75rem;
    }
    
    .custom-confirm-title {
        font-size: 1.125rem;
    }
    
    .custom-confirm-body {
        padding: 1.25rem;
    }
    
    .custom-confirm-footer {
        flex-direction: column-reverse;
        padding: 1rem 1.25rem 1.25rem;
    }
    
    .custom-confirm-btn {
        width: 100%;
    }
}

/* Animation pour les types */
.custom-confirm-dialog[data-type="danger"] .custom-confirm-header {
    border-bottom-color: #C62828;
}

.custom-confirm-dialog[data-type="warning"] .custom-confirm-header {
    border-bottom-color: #F57C00;
}

.custom-confirm-dialog[data-type="success"] .custom-confirm-header {
    border-bottom-color: #117333;
}

.custom-confirm-dialog[data-type="info"] .custom-confirm-header {
    border-bottom-color: #1976D2;
}

