Structures and phase transitions in thin liquid-crystal films