Use PLAYER_TARGET_CHANGED - it's possible that it's faster than UNIT_TARGET (it's more efficient even if it's not faster). Also, you don't have to do Hide/Show in your scripts if your panel is parented to the TargetFrame, as it will automatically hide/show along with it anyways.
Code:
self:RegisterEvent("PLAYER_TARGET_CHANGED")
Code:
if not UnitExists("target") then return end
local cl = UnitClassification("target")
if (cl == "elite") or (cl == "worldboss") or (cl == "rareeleite") then
self:SetBackdropColor(0.1, 0.1, 0.1, 0.1)
else
self:SetBackdropColor(1, 1, 1, 1)
end