$htmlPath = "site\tools.html"
$html = Get-Content $htmlPath -Raw

# 1. Product Title Optimizer
$titleHtml = 'href="tools/product-title-optimizer.html">
        <div class="tool-icon" style="background:#fff8e1;color:#f59e0b;box-shadow:0 0 10px rgba(245,158,11,0.2);"><svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 7 4 4 20 4 20 7"/><line x1="9" y1="20" x2="15" y2="20"/><line x1="12" y1="4" x2="12" y2="20"/></svg></div>'

# Regex to find product-title-optimizer.html and replace its icon div completely
$html = $html -replace '(?s)href="tools/product-title-optimizer\.html">\s*<div class="tool-icon"[^>]*>.*?</div>', $titleHtml


# 2. Product Description Generator
$descHtml = 'href="tools/product-description-generator.html">
        <div class="tool-icon" style="background:#e0f2f1;color:#14b8a6;box-shadow:0 0 10px rgba(20,184,166,0.2);"><svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg></div>'

$html = $html -replace '(?s)href="tools/product-description-generator\.html">\s*<div class="tool-icon"[^>]*>.*?</div>', $descHtml


Set-Content -Path $htmlPath -Value $html -Encoding UTF8
Write-Host "Updated title optimizer and description generator logos and colors."
