# ========================================
# Forex Calculator - Minimal Configuration
# ========================================

# Allow access to this directory
Options +FollowSymLinks -Indexes

# Set default index file
DirectoryIndex index.html

# Enable RewriteEngine
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /forexcalc1/
</IfModule>

# ========================================
# MIME Types for JavaScript
# ========================================
<IfModule mod_mime.c>
  AddType application/javascript .js
  AddType text/css .css
  AddType application/manifest+json .webmanifest
  AddType image/png .png
</IfModule>

# ========================================
# Allow access to all files
# ========================================
<FilesMatch "\.(html|js|css|png|webmanifest)$">
  <IfModule mod_authz_core.c>
    Require all granted
  </IfModule>
  <IfModule !mod_authz_core.c>
    Order allow,deny
    Allow from all
  </IfModule>
</FilesMatch>

# ========================================
# Security Headers (Optional)
# ========================================
<IfModule mod_headers.c>
  # Allow inline scripts for service worker
  Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:;"
  
  # Basic security
  Header set X-Content-Type-Options "nosniff"
  Header set X-Frame-Options "SAMEORIGIN"
</IfModule>

# ========================================
# Service Worker
# ========================================
<Files "sw.js">
  <IfModule mod_headers.c>
    Header set Cache-Control "public, max-age=0, must-revalidate"
    Header set Service-Worker-Allowed "/"
  </IfModule>
</Files>
