The Middle East declined when Europe (around the 1600-1800) started to modernize. Europeans started to colonize, where as the Muslim Empires (Safavids, Ottoman, and Mughals) were limited to the Old World. The Battle of Lepanto prevented any colonization hopes for the Muslims. Meanwhile, later, the Muslim empires struggled to modernize because of the orthodox ulama, who prevented any modern reforms. I can give a better explanation if needed.