A standard FFT (not using fftshift) references the phase of any sinusoid to the start of the window. Your two examples start the FFT window at two different points, where a cosine has a different value or phase.
Your input data is a cosine referenced to time 0.
And a phase of 0 will show up as a positive real result in common FFT implementations.
Shift the window 180 degrees, and an out of phase with respect to the window start will show up as a negative real result.
Shifts by 90 degrees will show up in the imaginary component of the complex result.
The above examples are for strictly periodic in FFT aperture sinusoids only.