DELETE child FROM menus child
INNER JOIN menus parent ON child.parent_id = parent.id
WHERE parent.name IN (
    'HOME', 'Home', 'ABOUT RBCL', 'About RBCL', 'ABOUT US', 'About Us',
    'SELECTION', 'Selection', 'MANAGEMENT', 'Management', 'Register',
    'RBCL COMMITTEES', 'RBCL Committees', 'Contact', 'CONTACT', 'FAQS', 'FAQs',
    'CONTACT US', 'Contact Us'
);

DELETE FROM menus WHERE name IN (
    'HOME', 'Home', 'ABOUT RBCL', 'About RBCL', 'ABOUT US', 'About Us',
    'What is RBCL', 'WHAT IS RBCL', 'RBCL Gallery', 'RBCL GALLERY',
    'RBCL Organisers', 'RBCL ORGANISERS', 'SELECTION', 'Selection',
    'Teams', 'TEAMS', 'Selection Process', 'SELECTION PROCESS',
    'MANDATORY DOCUMENTS', 'Mandatory Documents', 'MANAGEMENT', 'Management',
    'Register', 'REGISTER', 'RBCL COMMITTEES', 'RBCL Committees',
    'ANTI CORRUPTION COMMITTEES', 'Anti Corruption Committees',
    'DISCIPLINARY COMMITTEES', 'Disciplinary Committees',
    'Contact', 'CONTACT', 'FAQS', 'FAQs', 'CONTACT US', 'Contact Us'
);

INSERT INTO menus (name, parent_id, url, sort_order, active) VALUES ('HOME', NULL, '/', 1, 1);

INSERT INTO menus (name, parent_id, url, sort_order, active) VALUES ('ABOUT US', NULL, '/page/what-is-rbcl', 2, 1);
SET @about_menu_id = LAST_INSERT_ID();
INSERT INTO menus (name, parent_id, url, sort_order, active) VALUES
('WHAT IS RBCL', @about_menu_id, '/page/what-is-rbcl', 1, 1),
('RBCL GALLERY', @about_menu_id, '/gallery', 2, 1),
('RBCL ORGANISERS', @about_menu_id, '/page/rbcl-organisers', 3, 1);

INSERT INTO menus (name, parent_id, url, sort_order, active) VALUES ('SELECTION', NULL, '/page/selection-process', 3, 1);
SET @selection_menu_id = LAST_INSERT_ID();
INSERT INTO menus (name, parent_id, url, sort_order, active) VALUES
('TEAMS', @selection_menu_id, '/page/teams', 1, 1),
('SELECTION PROCESS', @selection_menu_id, '/page/selection-process', 2, 1),
('MANDATORY DOCUMENTS', @selection_menu_id, '/page/mandatory-documents', 3, 1);

INSERT INTO menus (name, parent_id, url, sort_order, active) VALUES ('MANAGEMENT', NULL, '/page/management', 4, 1);

INSERT INTO menus (name, parent_id, url, sort_order, active) VALUES ('RBCL COMMITTEES', NULL, '/page/anti-corruption-committee', 5, 1);
SET @committee_menu_id = LAST_INSERT_ID();
INSERT INTO menus (name, parent_id, url, sort_order, active) VALUES
('ANTI CORRUPTION COMMITTEES', @committee_menu_id, '/page/anti-corruption-committee', 1, 1),
('DISCIPLINARY COMMITTEES', @committee_menu_id, '/page/disciplinary-committee', 2, 1);

INSERT INTO menus (name, parent_id, url, sort_order, active) VALUES
('FAQS', NULL, '/page/faqs', 6, 1),
('CONTACT US', NULL, '/page/contact-us', 7, 1);

INSERT INTO pages (title, slug, banner, content, seo_title, seo_description, seo_keywords, status)
VALUES (
    'Contact Us',
    'contact-us',
    '/assets/img/demo/trial-map.webp',
    '<h2>Contact Rising Bharat Cricket League</h2><p>Our support team helps players, parents, and organisers with registration, payment, profile completion, document verification, match fee, schedules, and score updates.</p><div class="contact-card-grid"><div class="contact-card"><strong>Call / WhatsApp</strong><a href="tel:+919243619991">+91 92436 19991</a><p>Fast support for registration, fees, and trial updates.</p></div><div class="contact-card"><strong>Email Support</strong><a href="mailto:info@myrbcl.com">info@myrbcl.com</a><p>Send payment, document, or profile support requests.</p></div><div class="contact-card"><strong>Office Hours</strong><p>Monday to Saturday<br>10:00 AM to 6:00 PM</p><p>Emergency match-day support is available on WhatsApp.</p></div></div><div class="map-panel"><iframe loading="lazy" allowfullscreen referrerpolicy="no-referrer-when-downgrade" src="https://www.google.com/maps?q=India&output=embed"></iframe><div class="map-panel__body"><h3>RBCL Trial Coordination Map</h3><p>Use the map for location reference. Admin can update this Google Map embed URL anytime from Super Admin Pages.</p><a class="btn btn-gold" target="_blank" rel="noopener" href="https://www.google.com/maps/search/?api=1&query=India">Open Google Map</a></div></div><h3>How to reach support faster</h3><ul class="check-list"><li>Keep your registration number ready.</li><li>For match fee support, mention your registered mobile number.</li><li>For document verification, upload selfie and Aadhaar images before contacting support.</li></ul>',
    'Contact RBCL',
    'Contact RBCL for cricket trial registration, payment, document and match support.',
    'rbcl contact, cricket trial support, rbcl phone, rbcl whatsapp',
    'published'
)
ON DUPLICATE KEY UPDATE
title = VALUES(title),
banner = VALUES(banner),
content = VALUES(content),
seo_title = VALUES(seo_title),
seo_description = VALUES(seo_description),
seo_keywords = VALUES(seo_keywords),
status = VALUES(status),
updated_at = CURRENT_TIMESTAMP;
