Determination of a safe mud window and analysis of wellbore stability to minimize drilling challenges and non-productive time