Text this: Efficient Legged Robot Locomotion Through Optimized Gait Planning for Unstructured Planetary Terrain