Great question! In this case, you could use the word theory interchangeably with idea.
The meaning can be different in nuance, however, especially in a scientific context.
Idea is a thought about the state of something, the relationship between multiple things or a course of action.
Theory, in a scientific context, has some experimental data to support it. A non-supported theory is called a hypothesis, which is the scientific word for what we could casually call an idea.
In everyday speech, theory and idea can generally be used interchangeably except in cases where we describe a complex relationship, system or subject, it's preferable to use theory in those cases. In contrast, idea is preferred when describing a problem's solution that has just recently come up in the speaker's mind.
Ex: Music theory is difficult but important if you want to get better at playing guitar. (subject)
Ex: I have an idea, why don't we ask the professor if we can change the topic of our paper! (solution)