Arduino mega 2560 might be dead
i powered it with a 12v source and i got 12v out on Vin but 0 on 5V
  and 3V.


The fuse or the Vin input diode or the 5V voltage regulator or all of them could be damaged.


  i plugged it into my pc. The power led and the 13 pin led were on but
  my pc couldn't recognize my device.  In arduino ide i couldn't find
  the port and the tx and rx leds didn't blink at all.



The MCU could be damaged.
The USB chip is dead (Because there is no rx blinking during programming).


If you connect the arduino through USB and there was not 3.3v at the 3.3v supply rail, the 3.3v voltage regulator is dead.

You had better buy a new one or if you want to fix it to gain experience go for it.