Manchester City had to work hard to beat a brave Brighton side at the Etihad Stadium in the Premier League.