# AquaStar — SPA routing + caching (Apache)
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /

  # Nu rescrie fișiere/foldere reale
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]

  # Nu rescrie asset-uri statice (chiar dacă lipsește fișierul, evită HTML ca „imagine”)
  RewriteRule \.(?:js|css|png|jpe?g|gif|webp|svg|ico|mp4|woff2?|ttf|eot|map|txt|xml|json)$ - [L,NC]

  # SPA fallback
  RewriteRule ^ index.html [L]
</IfModule>

<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  Header set X-Frame-Options "SAMEORIGIN"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
  ExpiresByType image/jpeg "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType image/webp "access plus 1 month"
  ExpiresByType image/svg+xml "access plus 1 month"
  ExpiresByType font/woff2 "access plus 1 year"
</IfModule>

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml
</IfModule>
