Here are a summary of the orthogonality relations for $\sin x$ and $\cos x$ on the interval $[-\pi, \pi]$
What happens if we change the interval of integration to say $[0, \pi]$ or $[0, 1]$ or most generally $[a, b]$? Do the above orthogonality relations still hold for $\sin$ and $\cos$?

Clearly not.
For example, if you choose an interval, such as $[0, .01]$, over which all the functions (for some $k$ and $n$) have the same sign, then the integral of their product can never be zero.
More generally, use the formulas for $\sin(x)\sin(y)$ and similarly to get the indefinite integrals. You will see why $\int_{-\pi}^{\pi}$ is special.