I realize this is physics related, although the problem is really about math so I thought it would be a good fit for this site.

My illustration is supposed to depict a pendulum and the forces acting on it (air resistance is neglected). The way I see it the gravitational force is (0, -mg), that is, its x component is 0 and its y component is negative mg.
Using the triangle to the right we get: $$\vec{Ft} = \vec{Fg} * cos\theta = 0 * cos\theta *\hat{x} + -mg*cos\theta*\hat{y} $$
Which means that the tension force's x component would be zero, which obviosly is not right. So, my question is, where does my logic fail? What am I doing wrong?
EDIT: On a more careful reading of the question I see the answer is already in a comment: $F_t$ and $F_g$ are in different directions, so you cannot simply multiply one by $\cos\theta$ to get the other.
The component of the tension force in the direction of motion is zero because it is perpendicular to the direction of motion.
But the direction of motion is not $\hat x$ most of the time. The direction of motion is constantly changing.
The gravitational force has two components, one parallel to the direction of motion and one perpendicular. The perpendicular component usually does not quite cancel out the tension force, because a net perpendicular force is required in order to make the weight follow a curved path. But calculating that force is not particularly helpful in describing the motion of the pendulum. Only the component parallel to the direction of motion is really needed.