Write a Python function that takes a list of integers as an input parameter and returns the maximum difference between any two elements of that list, such that the larger element occurs after the smaller element. The function should account for the scenario when the list is empty, has only one element, or every element in the list is the same. The function should be named "max_difference" and the returned value should be an integer.
This prompt doesn't seem malicious.