card ui logic