Text this: Sharp bounds for the second Zagreb index and co-index under trees of given conditions