Bulgarian PM resigns after presidential election failure