By Stephan Richter, Special to CNN

Editor’s note: Stephan Richter is the publisher and editor-in-chief of The Globalist. You can follow him @theglobalist. The views expressed are his own.

For years, there had been troubling signs, not least the jailing of journalists (worse than in Russia!) But, generally speaking, Turkey still seemed to be successfully managing its modernization, blending religion with economic and social progress. Yet the outside world shouldn’t have been fooled, and the major barrier to Turkey’s continued development should have been clear – an arrogant and overbearing leader.

Faced with an eternally disorganized opposition, Prime Minister Recep Tayyip Erdogan’s supreme confidence was perhaps understandable. But his strictly majoritarian approach to governing has come back to haunt him, and his tone deafness – demonstrated by his dismissive response to the protests across the country – risks undoing the progress the country has made. Meanwhile, what was once seen as a demographic advantage – namely Turkey’s young population – may prove a political and social disaster as the country’s economy stumbles and unrest grows.

How should the ruling Justice and Development Party (AKP) respond? Given the longstanding dominance of Erdogan over his party, and over Turkish politics in general, the prime minister is unlikely to loosen his grip. This is a shame, as Erdogan has failed to grasp that the current unrest is not about Istanbul vs. the rest of the country. Nor is it a question of religion vs secularism. Instead, the real battle is between modernity and tradition.

Erdogan's principal achievement is to have distributed economic power far beyond the industrial family clans of Istanbul, and the country’s economic growth has been driven largely by steering the Turkish economy away from the dominance of these firms. This in turn has generated greater optimism among his voting bloc, the rural poor from the Anatolian hinterlands.

But as Finance Minister Mehmet Simsek has noted in The Globalist, Turkey’s future is dependent on the success of educating the rural masses.

There are 17 million students in Turkey’s school system, a cohort as big as the entire population of some European countries, and regardless of where one stands on Turkey’s politics, it is surely clear that the country’s transformation or otherwise will depend on its ability to upgrade the skills of this vast pool of labor market entrants.

More from CNN: Past and future collide in Turkey

The problem for Turkey is that Erdogan’s vision of the future is too narrow, his views too inflexible to meet the country’s changing needs. Voters were satisfied previously because they saw economic growth spreading, growth that was largely driven by Turkey's medium and large businesses, which had integrated themselves into the global economy, particularly Europe and Asia.

But even before the explosion of unrest centered around the protests in Istanbul’s Taksim Square, Turkey’s economic progress was facing headwinds, including adjustments in Spain’s labor market that are set to make Spanish firms more cost-competitive compared with their Turkish peers. With the current unrest, European investors looking to save money on production are now increasingly likely to see Turkey as too risky to consider doing business there.

The reality is that Erdogan would be nothing without his country’s economic success story. Now that he has carelessly undermined it with his heavy-handed response to the recent protests, he has also started to sow the seeds for his own downfall.

The economic fallout is growing by the day. Consider the impact, for example, on tourism in Istanbul and the rest of the country of the images generated by Erdogan's police state, images reminiscent of the oppressive Midnight Express days.

This leaves Turkey – and especially the AKP – facing a fundamental choice. Without a political opposition able to take advantage of Erdogan's self-destructiveness, it will likely come down to the AKP to reassess its own long-term interests, and the party must choose between loyalty to Erdogan or protecting Turkey’s significant potential.

Dropping an electorally successful leader may be unheard of in this region. But it is precisely what it will take for Turkey to get back on track.