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

# Fix the syntax error in the print media query
$css = $css -replace '(\.nav-bg\{background:#fff !important;\}) backdrop-filter[^}]+}', "`$1`n}"

# Now safely add glassmorphism to the main .nav-bg
$css = $css -replace '(?s)(\.nav-bg\{[^\}]+)(?=\})', "`$1`n  backdrop-filter: blur(12px);`n  -webkit-backdrop-filter: blur(12px);`n  background: rgba(255, 255, 255, 0.85) !important;"

# To ensure we don't break the CSS further, I'll do a safe manual string replace for the print one if it was corrupted
$css = $css -replace '\.nav-bg\{background:#fff !important;\} backdrop-filter[^;]+; -webkit-backdrop-filter[^;]+; background: rgba[^!]+!important;', '.nav-bg{background:#fff !important;}'

Set-Content -Path $cssPath -Value $css -Encoding UTF8
Write-Host "CSS fixed."
