I am having trouble understanding the concept of voltage and current having a phase difference in AC circuits.
Since you want to understand the idea of phase shift, I offer you an intuitive approach to explanation illustrated with multiple CircuitLab simulations.
Current-supplied circuit
... voltage could alternatively be viewed as a consequence of current.
Some devices, for example resistors, can be controlled by both voltage and current.
Resistor
If you drive a resistor with an AC current source...

simulate this circuit – Schematic created using CircuitLab
... the voltage across it instantaneously follows the current (there is no phase difference) because there is no accumulation of charge.

Capacitor
Other devices, like capacitor, are more conveniently (without conflict) controlled by current.

simulate this circuit
As you can see from the graphs below, the voltage waveform is shifted exactly 90° to the right (or, as it is commonly said, the current leads the voltage by 90°). This can be explained as follows:

Since the current source is ideal, the moment the current changes its direction does not depend on the voltage across the capacitor, and consequently, on the frequency of the input signal.
Voltage-supplied circuit
Current sources are most easily made using a voltage source Vin and a resistor R1 in series (see Schematic 2.1.1 below). However, these sources are imperfect because the maximum voltage across the load R2 they can create (the so-called compliance voltage) is equal to their internal voltage.
AC circuit operation
Resistor: So, if you drive a resistor with such a resistor-type AC current source...

simulate this circuit
... the voltage across resistor R2...

... and the current through it replicate Vin without any phase shift.

Capacitor: But if we replace the resistor with a capacitor, an interesting effect occurs – now the current is determined not only by Vin but by the difference Vin - Vc.

simulate this circuit
Therefore, the current changes its direction (from positive to negative) not when Vin < 0, but when Vin < Vc, and the phase shift < 90°.

Larger capacitance: As a result, if we increase the capacitance of the capacitor by, for example, 10 times...

simulate this circuit
... the voltage across it will be very small...

... and the phase shift will be close to 90° (like in Schematic 1.2 above).

Higher frequency: The same effect will occur if we increase the frequency (up to 2 kHz) because the capacitor will not have time to charge...

simulate this circuit
... and the voltage across it will remain low.

DC circuit simulation
My confusion arises when considering how there can be a positive potential difference while current flows in the opposite direction.
An effective way to visualize the circuit operation is to take "snapshots" at characteristic points in time (t1, t2, t3 and t4).

For this purpose, we can simulate the capacitor with a "rechargeable battery" Vc that has the corresponding instantaneous voltage of the capacitor.
t1 = 2.5 ms: Vin = 1 V, Vc = 0.25 V. Since Vin > Vc, current flows from Vin to Vc.

simulate this circuit
t2 = 2.83 ms: Vin = Vc = 0.5 V. Now Vin = Vc, so no current flows.

simulate this circuit
t3 = 3.5 ms: Vin = -1 V, Vc = -0.25 V. Since Vin < Vc, current flows from Vc to Vin.

simulate this circuit
t4 = 3.83 ms: Vin = Vc = -0.5 V. As in t2, Vin = Vc, no current flows.

simulate this circuit