Optimization of transition from open-pit to underground mining considering environmental costs