/**
 * Custom Dialog Modal - replaces native alert/confirm
 */
body.modal-open {
    overflow: hidden;
}
#custom-dialog-modal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#custom-dialog-modal.modal-overlay[style*="flex"] {
    display: flex !important;
}

#custom-dialog-modal .modal-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

#custom-dialog-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

#custom-dialog-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

#custom-dialog-modal .modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

#custom-dialog-modal .modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

#custom-dialog-modal .modal-body {
    padding: 24px;
}

#custom-dialog-modal .custom-dialog-message {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
}

/*
 * Modo confirm: somente Cancelar + um botão primário (Confirmar) no rodapé.
 * O X do header também some — fechar = Cancelar.
 */
#custom-dialog-modal.dialog-mode-confirm .modal-close {
    display: none !important;
}

/* Alerta: só o botão OK no rodapé (sem X duplicado) */
#custom-dialog-modal.dialog-mode-alert .modal-close {
    display: none !important;
}

#custom-dialog-modal .modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 24px 24px;
    border-top: 1px solid #e5e7eb;
}

#custom-dialog-modal .modal-footer .action {
    min-width: 80px;
}
