The human mind is a strange thing. There can be one central thing in life keeping you happy. So you have a base of being happy. A day will go horrible, and so you have a subset of a bad mood, but that is only surface emotion. You are still happy. So your mind can process being happy and upset at the same time.