Causal Dynamic Variational Autoencoder for Counterfactual Regression in Longitudinal Data