"Afternoon" and "After Midnight" have 2 different values but are essentially the same thing.
"Afternoon" = Anything past 12pm up until about 6pm~
"After midnight" = Generally any event that happens shortly after 12am, but you never greet anyone at 3am with "Good after midnight", you would always say "Good evening" or some other generic phrase.