Okay call me stupid, but really it's ignorance, I just graduated from college and learned absolutely nothing about how airline pay works

. The pay rate shown, per diem, etc are confusing, but let me explain what I think I know and maybe someone can straighten me out if I'm going the wrong way.
Hourly rate (the time you're actually flying the damn airplane right?) lets say $20 an hour
Per Diem $1.50 an hour for each hour you are away from home but still on your 3-4 day trip right?
Oh and the time you're on duty and not flying, yeah I don't have a clue how you folks are getting paid for that or at what rate.
some airlines guarantee you X number of hours which are the full $20 an hour, hourly rate right?
any other types of pay I have no clue about, so I would appreciate any help. Thanks a bunch!