Israel declares state of war after surprise Hamas attack