くれる basically means "to give", and もらう basically means "to receive". Let's think about this with simpler examples:
My parents gave a book to me.
I received a book from my parents.
In the former, the subject is 両親, and in the latter, the subject is 私. Both has に, but these two に play different ...
と here conveys the idea “at that moment”. Which moment? The one described in the previous sentence.
But it seems you left out some of the following context. I’m guessing but it seems to me that the cat which has been quietly perched on her shoulder now begins to speak.
At any rate, this sort of dramatic use of と is not unusual and gives a sense of immediacy ...
Ok, so the overall structure is like this:
（[a]…たとえで言ったら、） 僕にとって「もてたい」ってやつは 人参でも[b]…程の人参だった。
(Using the metaphor [a],) for me, "I want to be popular" was a carrot, (not just an ordinary carrot, but) a carrot like [b].
The first part of the sentence goes:
Lit. If I say regarding the metaphor where you dangle a carrot in ...
If a verb normally takes に in active voice, it usually retains its original role in a potential sentence.
Verbs that do not take に in active voice:
私には見えます。 I can see it.
彼には食べられます。 He can eat it.
君には分からない。 You cannot understand this.
Verbs that take に in active voice:
東京には行けます。 It's possible to go to Tokyo.
この部屋には入れない。 You cannot enter this room.
It's "the difficulty of being in a parent-child relationship". It probably refers mainly to the difficulty of being a good father (父親であることの難しさ) in this context, but it also includes the difficulty from the children's point of view. 親子である means "to be a parent and a child (to each other)".
論 is a suffix similar to "-ology" in ...
The way I read this, 田中さんに is the key part when combined with 〜られた. When you say だれかさんにこうされた this implies that somebody (だれかさん) did this (こう) to you ( された). The implication being that the thing which was done to you is not something that you liked.
If you just said, 田中さんが窓を開けた that would normally be understood as a simple statement of fact. Tanaka opened the ...