Find a 95% confidence interval for the fraction of votes that candidate A will receive. I have problem of understanding this question:

Of the first 10,000 votes cast in an election, 5,180 were for candidate A. Find
a 95% confidence interval for the fraction of votes that candidate A will receive.

I used this formula to calculate it:
$$ x̄ ± z \frac{σ}{\sqrt{n}} $$ 
First I calculated the σ: 
$$ σ = \sqrt{n\cdot p \cdot q} = \sqrt{10000\cdot\frac{5180}{10000} \cdot\frac{4820}{10000}}  $$
$$ σ = \sqrt{\frac{5180 \cdot 4820}{10000}}  $$
Then I just filled in the formula:
$$ \frac{5180}{10000} ± 1.96 \cdot \frac{\sqrt{\frac{5180\cdot 4820}{10000}}}{\sqrt{10000}} $$
$$ =\frac{5180}{10000} ± 1.96 \cdot \sqrt{\frac{5180\cdot 4820}{10000^2}} $$
This gives the wrong answer. The answer from the textbook is $(0.51 ,0.53)$. I think I'm doing something wrong with calculating the σ, but I do not know what part is going wrong.

The error becomes clear when you think about the standard deviation of the sampling distribution:  that is to say, if $X$ counts the number of votes for $A$, then $\sigma_X = \sqrt{n p q}$ as you wrote, but this is the standard deviation of the count, not the proportion.  The estimated standard deviation of the proportion $\hat p = X/n$ is $$\hat \sigma = \sqrt{\hat p \hat q/n}.$$  Then the standard error of $\hat p$ is $$SE(\hat p) =  \frac{\hat \sigma }{ \sqrt{n}},$$ and the margin of error is $$ME = z^* SE(\hat p).$$  So your confidence interval should be $$\hat p \pm ME = \hat p \pm z^* \frac{\sqrt{\hat p (1 - \hat p)}}{n},$$ where $\hat p = X/n = 5180/10000 = 0.518$, and $z^* \approx 1.96$ is the critical value for a $95\%$ confidence interval under approximation with a normal distribution.
