Temperature- and pressure-induced structural transformations in NbN: A first-principles study