Added logic for displaying selected tab and related styles.