Structural and Magnetic Phase Transitions in Minerals