ATLANTIC CITY — Over the Fourth of July weekend, this town was packed. Hotel occupancy soared to 95 percent, and shoppers coursed through the outlet stores opposite Trump Plaza. At Revel, the city’s newest casino resort, the lively, dressed-up crowd gazed out through the floor-to-ceiling glass to see the surfers riding the day’s last waves onto the wide beach.

But the booming weekend belied the wrenching problems plaguing this New Jersey resort. In the winter and even midweek in the summer, Atlantic City — battered by storms, declining property values and, increasingly, crushing competition from gambling operations in neighboring states — is relatively quiet.

Since January, four of the city’s 12 casinos announced plans to shut down if they failed to find buyers. In the latest blow, workers at Trump Plaza Hotel and Casino received notices on Monday that the white-towered complex with the bright red letters was expected to lock its doors as soon as Sept. 16. The Atlantic Club is already closed, and Showboat and Revel would close in late summer. The four represent 25 percent of the city’s casino work force: more than 8,000 jobs that could be lost, according to union leaders.

The remaking of Atlantic City’s defining industry is driving a furious effort to reimagine what this beach town can be now that casino gambling has a foothold in neighboring states, and may even be permitted in northern New Jersey. Gamblers who once crossed state lines to get to Atlantic City are now staying closer to home, playing at 20 casinos or slot parlors in Delaware, Maryland, New York and Pennsylvania. And more competition is coming.