use mercurys::geology::earthquakes::{
    annual_frequency, crust_p_wave_velocity, crust_s_wave_velocity, major_scarps,
};
use mercurys::geology::erosion::{
    SpaceWeathering, equatorial_temp_swing, thermal_fatigue_crack_growth_rate,
};
use mercurys::geology::mountains::{major_crater_rims, total_relief_m};
use mercurys::geology::plate_tectonics::{MercuryInterior, mean_heat_flux_mw_m2};
use mercurys::geology::volcanism::MercuryVolcanism;

fn main() {
    println!("=== Mercury Interior ===");
    let interior = MercuryInterior::new();
    println!("  Core radius: {:.0} km", interior.core_radius_m / 1000.0);
    println!(
        "  Mantle thickness: {:.0} km",
        interior.mantle_thickness_m / 1000.0
    );
    println!(
        "  Crust thickness: {:.0} km",
        interior.crust_thickness_m / 1000.0
    );
    println!(
        "  Core mass fraction: {:.1}%",
        interior.core_mass_fraction() * 100.0
    );
    println!(
        "  Global contraction: {:.0} km",
        interior.contraction_estimate_km()
    );
    println!("  Mean heat flux: {:.1} mW/m²", mean_heat_flux_mw_m2());

    println!("\n=== Major Lobate Scarps ===");
    let shear_modulus = 3.5e10;
    let scarps = major_scarps();
    for scarp in &scarps {
        let mw = scarp.estimated_magnitude(shear_modulus);
        println!(
            "  {}: length={:.0}km height={:.0}m Mw_max={:.1}",
            scarp.name, scarp.length_km, scarp.height_m, mw
        );
    }

    println!("\n=== Seismic Velocities (crust) ===");
    println!("  Vp: {:.0} m/s", crust_p_wave_velocity());
    println!("  Vs: {:.0} m/s", crust_s_wave_velocity());

    println!("\n=== Annual Quake Frequency ===");
    for m in [2.0, 3.0, 4.0, 5.0] {
        println!("  Mw >= {:.0}: {:.1} per year", m, annual_frequency(m));
    }

    println!("\n=== Ghost Volcanism ===");
    let volcanism = MercuryVolcanism::new();
    println!("  Currently active: {}", volcanism.currently_active);
    println!(
        "  Smooth plains area: {:.0} km²",
        volcanism.smooth_plains_area_km2()
    );
    println!(
        "  Total volcanic coverage: {:.0}%",
        volcanism.total_volcanic_coverage() * 100.0
    );
    println!(
        "  Last eruption: {:.1} Gyr ago",
        volcanism.last_eruption_estimate_gyr()
    );
    println!("  Volcanic vents: {}", volcanism.volcanic_vents_count());

    println!("\n=== Major Crater Rims ===");
    let rims = major_crater_rims();
    for rim in &rims {
        println!(
            "  {}: diameter={:.0}km  rim_height={:.0}m",
            rim.crater_name, rim.diameter_km, rim.rim_height_m
        );
    }
    println!("  Total relief: {:.0} m", total_relief_m());

    println!("\n=== Space Weathering ===");
    let sw = SpaceWeathering::new();
    println!("  Micrometeorite flux: {:.2e}", sw.micrometeorite_flux_rate);
    println!("  Sputtering rate: {:.2e}", sw.solar_wind_sputtering_rate);
    println!(
        "  Regolith depth (1 Gyr): {:.2} m",
        sw.regolith_gardening_depth_m(1.0e9)
    );
    println!("  Temp swing: {:.0} K", equatorial_temp_swing());
    println!(
        "  Crack growth rate: {:.2e}",
        thermal_fatigue_crack_growth_rate(equatorial_temp_swing(), 1.0)
    );
}
