-- Multilingual homepage content (structured JSON per locale)
-- Run after schema.sql on existing installs

CREATE TABLE IF NOT EXISTS homepage_translations (
  id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  locale VARCHAR(10) NOT NULL UNIQUE,
  meta_title VARCHAR(500) NOT NULL DEFAULT '',
  meta_description TEXT NOT NULL,
  content JSON NOT NULL,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  CONSTRAINT fk_homepage_locale FOREIGN KEY (locale) REFERENCES languages(code) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO homepage_translations (locale, meta_title, meta_description, content) VALUES
(
  'en',
  'TikTok Video Downloader',
  'Download TikTok videos without watermark',
  JSON_OBJECT(
    'hero', JSON_OBJECT(
      'mobileTitleOrange', 'Free Video',
      'mobileTitleBlue', 'Downloader',
      'subtitle', 'How to save video without watermark?',
      'downloaderTitleOrange', 'TikTok',
      'downloaderTitleBlue', 'Video Downloader',
      'inputPlaceholder', 'Insert Url here...'
    ),
    'features', JSON_OBJECT(
      'headingOrange', 'Download Free,',
      'headingBlue', 'From anywhere.',
      'ctaText', 'Join for free',
      'watchText', 'Watch how it works',
      'cards', JSON_ARRAY(
        JSON_OBJECT('label', 'Unlimited', 'text', 'Save Tiktok videos as much as you need - without any limits'),
        JSON_OBJECT('label', 'No Watermark', 'text', 'Save Tiktok videos without watermark or remove a TT Logo'),
        JSON_OBJECT('label', 'MP4 & MP3', 'text', 'Save files in HD quality, convert Tiktok to MP3 / MP4')
      )
    ),
    'steps', JSON_OBJECT(
      'headingBlue', 'How to Download TikTok',
      'headingOrange', 'MP3 with Savefrom.net?',
      'items', JSON_ARRAY(
        JSON_OBJECT('title', 'Find your File Video', 'description', 'Browse the Tiktok app or site to find the video that you want to convert to MP3.'),
        JSON_OBJECT('title', 'Paste URL', 'description', 'Copy the TikTok video link and paste it into the Savefrom.net input field.'),
        JSON_OBJECT('title', 'MP3 Saved', 'description', 'Hit Download to grab the MP3 file and save it to your device in seconds.')
      )
    ),
    'whyDownload', JSON_OBJECT(
      'headingBlue', 'Why You Should Use',
      'headingOrange', 'TikTok Video Downloader',
      'intro', 'MusicallyDown is the most popular TikTok download tool that lets you save TikTok videos without watermark in HD quality. Save TikTok videos online in MP4 format with the highest quality on any device, including Full HD and 4K resolution.',
      'items', JSON_ARRAY(
        JSON_OBJECT('title', 'High Quality', 'description', 'Our TikTok video downloader helps you download Full HD and 4K TikTok videos. Save as many videos as you want in MP4 format and remove the watermark to enjoy the best quality.'),
        JSON_OBJECT('title', 'Easy to Use', 'description', 'MusicallyDown is incredibly easy to use. No sign up, no app install — just paste the TikTok URL into the input field and your video is ready in seconds.'),
        JSON_OBJECT('title', 'Free and Fast', 'description', 'MusicallyDown is 100% free. No account, no extension. Save TikTok videos to MP4 in HD quality at top speed, on any device or browser.')
      )
    ),
    'bestFeatures', JSON_OBJECT(
      'headingBlue', 'Best Features of',
      'headingOrange', ' MusicallyDown',
      'intro', 'Download TikTok videos in MP4 or MP3 with our TikTok watermark remover. MusicallyDown works on any browser and operating system for high-speed TikTok video downloads.',
      'items', JSON_ARRAY(
        JSON_OBJECT('text', 'TikTok downloader works on any browser and operating system.'),
        JSON_OBJECT('text', 'TikTok video download in MP4 or MP3.'),
        JSON_OBJECT('text', 'No software required — fast TT watermark remover and link copier.'),
        JSON_OBJECT('text', 'High-speed TikTok video download in HD.'),
        JSON_OBJECT('text', 'Download TikTok videos for free and in unlimited amounts.'),
        JSON_OBJECT('text', 'Perfect solution for post-editing and publishing.')
      )
    ),
    'faq2', JSON_OBJECT(
      'headingBlue', 'This is how you',
      'headingOrange', ' can use TikTok downloader without watermark:',
      'items', JSON_ARRAY(
        JSON_OBJECT(
          'title', 'Download TikTok video on your mobile phone',
          'paragraphs', JSON_ARRAY(
            'To start a tiktok download or remove a TT watermark on Android or iPhone, launch the TT app and choose a video.',
            'On the video page you''ll see the arrow-shaped "Share" button on the right side of the screen. Tap it and select "Copy link".',
            'Open the web page and paste the link into the input at the top of our tiktok video downloader. Press the "Download video TikTok" button to get the link — the file from TT (Musically) is saved without any logos in mp4 format.'
          )
        ),
        JSON_OBJECT(
          'title', 'TikTok video downloader without watermark for PC',
          'paragraphs', JSON_ARRAY(
            'To start a tiktok download or remove a TT watermark on Android or iPhone, launch the TT app and choose a video.',
            'On the video page you''ll see the arrow-shaped "Share" button on the right side of the screen. Tap it and select "Copy link".',
            'Open the web page and paste the link into the input at the top of our tiktok video downloader. Press the "Download video TikTok" button to get the link — the file from TT (Musically) is saved without any logos in mp4 format.'
          )
        )
      )
    ),
    'faq', JSON_OBJECT(
      'heading', 'People also ask',
      'items', JSON_ARRAY(
        JSON_OBJECT('question', 'Do I have to pay to use TikTok download without watermark?', 'answer', 'No. MusicallyDown is completely free. There are no hidden fees, no sign-up required, and no limit on how many videos you can download.'),
        JSON_OBJECT('question', 'Do I need to install an extension to use the TikTok Downloader?', 'answer', 'No installation is required. Our TikTok downloader works in any modern browser on desktop or mobile - just paste the link and download.'),
        JSON_OBJECT('question', 'Where are TikTok videos saved after downloading?', 'answer', 'Downloaded videos are saved to your device''s default Downloads folder.'),
        JSON_OBJECT('question', 'Do I need to have a TT account to download TikTok videos?', 'answer', 'No TikTok account is needed. You only need the public link of the video you want to save.'),
        JSON_OBJECT('question', 'Can the HD TikTok Downloader save videos from private accounts?', 'answer', 'No. We only support publicly available TikTok videos.'),
        JSON_OBJECT('question', 'How do I get a link for TikTok videos?', 'answer', 'Open the TikTok app, find the video you want, tap the Share icon and choose Copy link.'),
        JSON_OBJECT('question', 'How to save from TikTok video to mp4 on iPhone (iOS)?', 'answer', 'Copy the TikTok link from the Share menu, open MusicallyDown in Safari, paste the URL and tap Download.'),
        JSON_OBJECT('question', 'Can I use your TikTok downloader without watermark on my Android phone?', 'answer', 'Yes. The downloader works in any Android browser.'),
        JSON_OBJECT('question', 'How can I download TikTok videos without a watermark in HD?', 'answer', 'Just paste the TikTok URL and choose Download Without Watermark.'),
        JSON_OBJECT('question', 'Is TikTok Downloader available in MP4 format?', 'answer', 'Yes. All TikTok video downloads are delivered in MP4 format.')
      )
    )
  )
)
ON DUPLICATE KEY UPDATE meta_title = VALUES(meta_title);
