I feel you are experiencing grief for the loss of your friendship. It happens when you realize there is or will be a loss and there is nothing you can do about it. Things will never be the same as they were, but they still might be wonderful.
Here is an article about grief over a loss of a friendship.
Surviving a Friendship Break Up | World of Psychology