-- =============================================
-- MIGRATION: Contact Page CMS Settings
-- Singleton settings table for the public /contact page
-- Pattern: same as branding_settings (single row, id=1)
-- =============================================

CREATE TABLE IF NOT EXISTS contact_page_settings (
    id INT PRIMARY KEY DEFAULT 1,
    -- Hero Section
    hero_title VARCHAR(500) NOT NULL DEFAULT 'Get in Touch',
    hero_subtitle TEXT NOT NULL,
    -- Office Details
    office_title VARCHAR(500) NOT NULL DEFAULT 'Dubai Headquarters',
    office_address TEXT NOT NULL,
    phone_numbers TEXT NOT NULL,
    email_addresses VARCHAR(500) NOT NULL DEFAULT 'info@wilddubai.com',
    working_hours TEXT NOT NULL,
    -- Map Section
    map_image VARCHAR(1000) NOT NULL DEFAULT 'https://images.unsplash.com/photo-1524661135-423995f22d0b?auto=format&fit=crop&q=80&w=800',
    map_google_url VARCHAR(1000) NOT NULL DEFAULT 'https://maps.google.com',
    -- Timestamps
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

-- Seed with the exact defaults currently hardcoded in the contact page
INSERT IGNORE INTO contact_page_settings (
    id, hero_title, hero_subtitle,
    office_title, office_address, phone_numbers,
    email_addresses, working_hours,
    map_image, map_google_url
) VALUES (
    1,
    'Get in Touch',
    'Whether you''re looking to buy, sell, or require expert advisory, our team of luxury real estate specialists is at your service.',
    'Dubai Headquarters',
    'Level 42, Boulevard Plaza Tower 1\nSheikh Mohammed Bin Rashid Blvd\nDowntown Dubai, UAE',
    '+971 4 123 4567\nToll Free: 800 WILD',
    'info@wilddubai.com',
    'Mon - Fri: 9:00 AM - 6:00 PM\nSat - Sun: By appointment',
    'https://images.unsplash.com/photo-1524661135-423995f22d0b?auto=format&fit=crop&q=80&w=800',
    'https://maps.google.com'
);

-- Verification
SELECT 'contact_page_settings' AS tbl, COUNT(*) AS row_count FROM contact_page_settings;
