# حماية مجلد البيانات
<IfModule mod_rewrite.c>
    RewriteEngine On
    
    # منع الوصول المباشر لملفات PHP في المجلد
    # RewriteRule ^data/ - [F,L]
</IfModule>

# منع عرض قائمة المجلدات
Options -Indexes

# حماية ملفات معينة
<FilesMatch "\.(db|sqlite|log)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# السماح بالـ CORS للـ API
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
    Header set Access-Control-Allow-Headers "Content-Type, X-Device-ID"
</IfModule>

# ضغط الملفات
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript application/json
</IfModule>

# تعيين نوع المحتوى الافتراضي
AddDefaultCharset UTF-8
