Smart nanostructured coatings