Let $q = p^e$ for some prime $p$. Consider the trace function $\mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p}:\mathbb{F}_q\to \mathbb{F}_p$ defined by $\mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p}(x) = \sum_{i=0}^{e-1}x^{p^i}$. Let $C \subseteq \mathbb{F}_q^n$ be a linear subspace and let $\zeta = e^{2\pi i/p}$. What I would like to show is $$\sum_{c \in C}\zeta^{\mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p}(\langle c, z\rangle)} = \begin{cases}|C|&\text{if }z\in C^\perp\\0 & \text{otherwise}\end{cases}.$$
What I know is that the trace function is surjective and each element of $\mathbb{F}_p$ is mapped to by $p^{e-1}$ elements of $\mathbb{F}_q$. Additionally, I see why the first case is true because if $z \in C^\perp$ we get $\langle c, z\rangle = 0$ for all $c$ and the result follows.
I also know that $\sum_{i=0}^{p-1}\zeta^i = \frac{\zeta^p - 1}{\zeta - 1} = 0$ so my idea was to try and show that each power of $\zeta$ is obtained the same number of times $t$. In other words, for each $i = 0, 1, \ldots, p-1$, we have $|c \in C : \mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p}(\langle c, z\rangle) = i| = t$.
In the case of $e = 1$ and $p = 2$, we have $$\sum_{c \in C}\zeta^{\mathrm{Tr}_{\mathbb{F}_q/\mathbb{F}_p}(\langle c, z\rangle)} = \sum_{c\in C}(-1)^{c\cdot z}$$ and since $z \not \in C^\perp$, there is some $c_0 \in C$ such that $c_0 \cdot z = 1$. Then $$-\sum_{c\in C}(-1)^{c\cdot z} = (-1)^{c_0\cdot z}\sum_{c\in C}(-1)^{c\cdot z} = \sum_{c \in C}(-1)^{(c+c_0)\cdot z} = \sum_{c'\in C}(-1)^{c'\cdot z}$$ and the result follows.
Any help would be greatly appreciated!