The Definition of Good and Evil in Islamic Theology

Re: If God exists, why is there evil?

god created heaven and hell before the creation of adam and eve.
God is aware , he is cognizant of everything. He is alimul ghaib wa shahadah .. He is aware of our intentions and conscience.
He knew satan will not submit his will to him. He knew his creation will go against him.
His knowledge is great , even if we combine the knowledge of all prophets and humans it doesn't stand 0.00000000000001 percent of his knowledge.

Without evil the system and philosophy of this universe was flawed.