Long-time Dynamics of the Sine-Gordon Equation