import os
import re

# List of ALL HTML pages
all_pages = [
    # Main pages
    'index.html', 'quotation.html', 'fleet.html', 'contact.html',
    'locations.html', 'sitemap-towns.html', 'q-and-a.html', 
    'privacy.html', 'terms.html',
    # Admin pages
    'admin-drivers.html', 'admin-messages.html', 'admin-new-booking.html',
    'admin-pricing.html', 'admin-quotes.html', 'admin.html', 'admin-login.html',
    # Other pages
    'acceptable-use.html', 'gdpr.html', 'promotional-terms.html',
    'sign-in.html', 'sign-up.html', 'success.html', 'test-menu.html',
    'terms_temp.html', 'terms_old_backup.html', 'reset-password.html'
]

for page in all_pages:
    if not os.path.exists(page):
        print(f"⚠️  {page} - File not found")
        continue
    
    with open(page, 'r', encoding='utf-8') as f:
        content = f.read()
    
    original_content = content
    
    # Update ALL Mercedes images to 60px height and 30px margin
    # Pattern: Find all Mercedes images and update their height
    content = re.sub(
        r'(<img[^>]*src="/mercedes-logo-final\.png"[^>]*style="[^"]*?)height:\s*\d+px;([^"]*margin-left:\s*)\d+px;',
        r'\1height: 60px;\2 30px;',
        content
    )
    
    # Also handle images without margin-left
    content = re.sub(
        r'(<img[^>]*src="/mercedes-logo-final\.png"[^>]*style="[^"]*?)height:\s*\d+px;',
        r'\1height: 60px;',
        content
    )
    
    if content != original_content:
        with open(page, 'w', encoding='utf-8') as f:
            f.write(content)
        print(f"✅ Updated {page} - Mercedes now 60px")
    else:
        print(f"ℹ️  {page} - No Mercedes image or already updated")

print("\n✅ ALL 27 PAGES NOW HAVE 60px MERCEDES! CONSISTENT SIZE!")
