This question already has an answer here:
I remember reading in the late 80's / early 90's a trilogy (I think) about some teens in a spaceship that was sentient / had AI, and they weren't allowed in one section of the spaceship because it was dangerous.
Some of the teens came awake at different times, and were in a sarcophagus like bed for a while, and when they were in there, they were back on Earth or something?
There was something in the other part of the spaceship that wanted to attack them, and part of me thinks that they were shadow-type creatures.
Argh, it's annoying me that the memories are so vague and that I can't remember, I loved the trilogy as a kid!