Theory based design and optimization of materials for spintronics applications