Whoo boy! can I relate to this one! I am 49 and realized the same thing a year ago, hell I didn't even know all the key signatures and scales! Do you live near a university that has a music department? I signed up for the freshman music theory course at a local university. The normal class comes in 2 pieces - the "paper" or written theory, which is the "math" of the music, and the ear training piece, which teaches you to hear and recognize the intervals and chords you are being taught inthe theory class. It also encompasses melodic dictation, or being able to write down a melody (eventually to become WITH harmonies) that is played. We also have to sight sing melodies and learn to sing the various chords. The two pieces go together, and many are tempted to skip the ear training, but that's the piece that has done me the most good! I cannot believe that I actually memorize pieces by recognizing the intervals and just "know" by how it goes what to play. It's added a whole new dimension to my playing.
If you lack a university to actually take the class at (I really recommend that approach, though. I am having a blast with the class, and meeting other music folks at the same time - ) then I would recommend a workbook by Paul Harder 0 Basic Materials in Musis Theory. I went through this book, and was amazed at how basic it was, and at the same time how little I really knew. I just never thought of time signatures in the way it was presented, or the modes, or the chord spelling. After a book like this one, you could see how much more you thought you needed.