Erdogan rival Imamoglu detained on graft, terror charges; opposition calls it a coup attempt, sparking protests.