#!/bin/bash
# Script to fix all broken headers in customer-facing pages

PAGES=(
  "fleet.html"
  "privacy.html"
  "terms.html"
  "q-and-a.html"
  "locations.html"
  "sitemap-towns.html"
)

cd /home/user/ashtransfer-fullstack/public

for page in "${PAGES[@]}"; do
  echo "Fixing $page..."
  
  # Create temporary file with the fix
  sed '/<a href="\/" class="logo">/,/^$/c\
      <a href="/" class="logo">\
        <img src="/logo.svg" alt="Ash Transfer" style="height: 50px;">\
        <img src="/mercedes-logo-final.png" alt="Mercedes E Class 2025" style="height: 70px; margin-left: 30px; background: white; padding: 5px; border-radius: 8px;">\
      </a>\
      \
      <button class="menu-toggle" id="menuToggle" aria-label="Toggle menu">\
        <span></span>\
        <span></span>\
        <span></span>\
      </button>\
      \
      <nav class="nav" id="mainNav">\
        <a href="/index.html"><i class="fas fa-home"></i> Home</a>\
        <a href="/quotation.html"><i class="fas fa-calculator"></i> Get Quote</a>\
        <a href="/fleet.html"><i class="fas fa-car"></i> Our Fleet</a>\
        <a href="/contact.html"><i class="fas fa-headset"></i> Contact</a>\
        <a href="/admin-login.html" class="btn-quote"><i class="fas fa-shield-alt"></i> Admin</a>\
      </nav>\
    </div>\
  </header>' "$page" > "$page.tmp"
  
  mv "$page.tmp" "$page"
  echo "Fixed $page"
done

echo "All pages fixed!"
