-- Seed data (3 muscles, 3 equipment, 6 exercises)
-- Uses deterministic slugs for dynamic routing.

INSERT INTO muscle_groups (name, slug, description, image_url) VALUES
  ('Abs', 'abs', 'Core-focused movements that build abdominal strength and stability.', 'https://images.unsplash.com/photo-1599058917212-d750089bc07e?auto=format&fit=crop&w=900&q=60'),
  ('Biceps', 'biceps', 'Exercises that target the front of the upper arm for size and strength.', 'https://images.unsplash.com/photo-1594381898411-846e7d193883?auto=format&fit=crop&w=900&q=60'),
  ('Chest', 'chest', 'Pressing and fly variations to build the pectorals and upper body power.', 'https://images.unsplash.com/photo-1517836357463-d25dfeac3438?auto=format&fit=crop&w=900&q=60');

INSERT INTO equipment (name, slug) VALUES
  ('Bodyweight', 'bodyweight'),
  ('Dumbbell', 'dumbbell'),
  ('Cable Machine', 'cable');

-- ABS (2)
INSERT INTO exercises (
  title, slug, muscle_group_id, equipment_id, difficulty,
  instructions_json, video_url, target_images_json
)
VALUES
(
  'Cable Crunch',
  'cable-crunch',
  (SELECT id FROM muscle_groups WHERE slug = 'abs'),
  (SELECT id FROM equipment WHERE slug = 'cable'),
  'Intermediate',
  json_array(
    'Attach a rope to a high pulley and kneel facing the machine.',
    'Hold the rope by your temples and brace your core.',
    'Crunch your torso down by flexing your abs (do not pull with arms).',
    'Pause briefly, then return under control.'
  ),
  'https://www.youtube.com/watch?v=dummy-cable-crunch',
  json_object(
    'thumbnail', 'https://images.unsplash.com/photo-1599058917212-d750089bc07e?auto=format&fit=crop&w=600&q=60',
    'targets', json_array('rectus_abdominis', 'obliques')
  )
),
(
  'Hanging Knee Raise',
  'hanging-knee-raise',
  (SELECT id FROM muscle_groups WHERE slug = 'abs'),
  (SELECT id FROM equipment WHERE slug = 'bodyweight'),
  'Beginner',
  json_array(
    'Hang from a pull-up bar with a firm grip.',
    'Tuck your pelvis slightly and brace your core.',
    'Raise your knees toward your chest without swinging.',
    'Lower slowly to a dead hang and repeat.'
  ),
  'https://www.youtube.com/watch?v=dummy-hanging-knee-raise',
  json_object(
    'thumbnail', 'https://images.unsplash.com/photo-1526401485004-2aa7b7b73391?auto=format&fit=crop&w=600&q=60',
    'targets', json_array('lower_abs', 'hip_flexors')
  )
);

-- BICEPS (2)
INSERT INTO exercises (
  title, slug, muscle_group_id, equipment_id, difficulty,
  instructions_json, video_url, target_images_json
)
VALUES
(
  'Dumbbell Curl',
  'dumbbell-curl',
  (SELECT id FROM muscle_groups WHERE slug = 'biceps'),
  (SELECT id FROM equipment WHERE slug = 'dumbbell'),
  'Beginner',
  json_array(
    'Stand tall with dumbbells at your sides, palms facing forward.',
    'Curl the weights up while keeping elbows close to your torso.',
    'Squeeze at the top without shrugging.',
    'Lower under control until arms are fully extended.'
  ),
  'https://www.youtube.com/watch?v=dummy-dumbbell-curl',
  json_object(
    'thumbnail', 'https://images.unsplash.com/photo-1593079831268-3381b0db4a77?auto=format&fit=crop&w=600&q=60',
    'targets', json_array('biceps_brachii', 'brachialis')
  )
),
(
  'Hammer Curl',
  'hammer-curl',
  (SELECT id FROM muscle_groups WHERE slug = 'biceps'),
  (SELECT id FROM equipment WHERE slug = 'dumbbell'),
  'Intermediate',
  json_array(
    'Hold dumbbells with a neutral grip (palms facing each other).',
    'Curl the weights up without rotating the wrists.',
    'Keep shoulders down and elbows pinned.',
    'Lower slowly and repeat.'
  ),
  'https://www.youtube.com/watch?v=dummy-hammer-curl',
  json_object(
    'thumbnail', 'https://images.unsplash.com/photo-1583454110551-21f2fa2afe61?auto=format&fit=crop&w=600&q=60',
    'targets', json_array('brachialis', 'forearms')
  )
);

-- CHEST (2)
INSERT INTO exercises (
  title, slug, muscle_group_id, equipment_id, difficulty,
  instructions_json, video_url, target_images_json
)
VALUES
(
  'Push-Up',
  'push-up',
  (SELECT id FROM muscle_groups WHERE slug = 'chest'),
  (SELECT id FROM equipment WHERE slug = 'bodyweight'),
  'Beginner',
  json_array(
    'Place hands slightly wider than shoulder-width on the floor.',
    'Brace your core and keep a straight line from head to heels.',
    'Lower until your chest is close to the ground.',
    'Press back up while keeping elbows at about a 45° angle.'
  ),
  'https://www.youtube.com/watch?v=dummy-push-up',
  json_object(
    'thumbnail', 'https://images.unsplash.com/photo-1598971457999-ca4ef48a9a71?auto=format&fit=crop&w=600&q=60',
    'targets', json_array('pectoralis_major', 'triceps')
  )
),
(
  'Cable Fly',
  'cable-fly',
  (SELECT id FROM muscle_groups WHERE slug = 'chest'),
  (SELECT id FROM equipment WHERE slug = 'cable'),
  'Advanced',
  json_array(
    'Set cables to chest height and step forward into a split stance.',
    'With a slight bend in elbows, bring handles together in front of you.',
    'Squeeze your chest at peak contraction.',
    'Return slowly until you feel a stretch across the pecs.'
  ),
  'https://www.youtube.com/watch?v=dummy-cable-fly',
  json_object(
    'thumbnail', 'https://images.unsplash.com/photo-1517963879433-6ad2b056d712?auto=format&fit=crop&w=600&q=60',
    'targets', json_array('chest', 'anterior_delts')
  )
);

