$cssPath = "site\assets\style.css"
$css = Get-Content $cssPath -Raw

# Fix the existing syntax error
$css = $css -replace '(?s)\} animation: pulseGlow 2s infinite;', '}'

# Add animation to all buttons globally, but slightly offset so they don't all pulse at the exact same millisecond
# We will inject the animation directly into the .btn class
$btnReplacement = '.btn{border:none;cursor:pointer;font-family:inherit;font-weight:700;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none;white-space:nowrap;animation: pulseGlow 3s infinite;}'
$css = $css -replace '(?s)\.btn\{border:none;[^}]*\}', $btnReplacement

# Update pulseGlow to use a subtle theme color that works with all buttons
$pulseReplacement = '@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0.1); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}'
$css = $css -replace '(?s)@keyframes pulseGlow\s*\{[^}]*\}', $pulseReplacement

Set-Content -Path $cssPath -Value $css -Encoding UTF8
Write-Host "Added glowing animation to all buttons!"
