const ConfirmationDialog = ({
  open,
  title,
  message,
  confirmLabel,
  cancelLabel,
  confirmTone = 'primary',
  onConfirm,
  onCancel
}) => {
  if (!open) {
    return null;
  }

  const confirmClasses =
    confirmTone === 'danger'
      ? 'bg-red-600 hover:bg-red-700 focus:ring-red-500'
      : 'bg-blue-600 hover:bg-blue-700 focus:ring-blue-500';

  return (
    <div className="fixed inset-0 z-50 flex items-center justify-center bg-slate-900/60 px-4">
      <div className="bg-white rounded-lg shadow-2xl max-w-md w-full p-6">
        <h3 className="text-lg font-semibold text-gray-800 mb-2">{title || 'Bitte bestätigen'}</h3>
        <p className="text-sm text-gray-600 mb-4">{message || 'Bist du sicher?'}</p>
        <div className="flex flex-col gap-2 sm:flex-row sm:justify-end">
          <button
            onClick={onCancel}
            className="bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded focus:outline-none focus:ring-2 focus:ring-gray-300"
          >
            {cancelLabel || 'Abbrechen'}
          </button>
          <button
            onClick={onConfirm}
            className={`${confirmClasses} text-white px-4 py-2 rounded focus:outline-none focus:ring-2`}
          >
            {confirmLabel || 'Ja'}
          </button>
        </div>
      </div>
    </div>
  );
};

export default ConfirmationDialog;
