Obama blasts Trump for fanning racial, economic resentments