NSA collected thousands of domestic communications in 2011, court document shows