PA38, no one should call you stupid. There are no stupid questions asked in good faith.
You have mostly answered your own question by mentioning those 'basics of flight' ... thrust, drag, lift ... and the last is gravity.
Any airframe, even one shaped like a brick, will fly if thrust is equal to or greater than drag and lift is equal to or greater than gravity.
Now an aircraft has no idea whether it is inverted or not. It has no idea if it is up-side-down or right-side-up. It cares little if a wing is pointed to the earth or the heavens. But the aircraft will and must respond to those forces of flight above (thrust, drag, lift and gravity).
You also answer your own question by mentioning the 'aerofoil shape'. The shape is only significant in terms of lift when we consider airflow about it.
Think of a box kite, for a moment. See it up there in the sky, steady in the breeze at the end of your string. Now pull it in, retrieve it, and restring it so that the kite is rotated 180 degrees: up-side-down. Send it aloft and lo...it flies!
The point is that the angle of airflow over the kite provides lift whether the kite is inverted or not. Similarly, skillful pilots in some aircraft can arrange the airflow about their aircraft to provide lift by deft adjustment of the attitude of their inverted aircraft in the face of the airflow.
Now, I'm not a skillful pilot. In fact I'm not an engineer or a pilot at all and I'm hoping that some here more qualified than me can assist you better.
Nonetheless, I hope this is a start for you.