FedGCS: A Generative Framework for Efficient Client Selection in Federated Learning via Gradient-based Optimization