Structural and electronic properties of dense liquid and amorphous nitrogen