In civil engineering, the selection of an appropriate foundation type is crucial for the stability and longevity of a structure. Factors influencing this choice include soil properties, load-bearing requirements, environmental conditions, and construction costs. Discuss the various types of foundations, such as shallow foundations, deep foundations, and specialized foundations, detailing their advantages, limitations, and suitable applications. How do engineers determine the most effective foundation type for specific projects to ensure structural integrity and cost efficiency?