<?php

return [
    /*
    | Force HTTPS redirects (recommended on production behind SSL).
    */
    'force_https' => env('FORCE_HTTPS', false),

    /*
    | Admin notification email for form submissions.
    */
    'admin_notification_email' => env('ADMIN_NOTIFICATION_EMAIL'),

    /*
    | Public form submissions rate limit attempts per decay minutes window.
    */
    'forms_rate_limit' => [
        'max_attempts' => (int) env('PUBLIC_FORMS_RATE_LIMIT_ATTEMPTS', 5),
        'decay_minutes' => (int) env('PUBLIC_FORMS_RATE_LIMIT_DECAY', 10),
    ],

    /*
    | Contact form anti-spam shield.
    */
    'contact_spam' => [
        'score_threshold' => (int) env('CONTACT_SPAM_SCORE_THRESHOLD', 4),
        'blocked_email_domains' => array_values(array_filter(array_map('trim', explode(',', (string) env('CONTACT_BLOCKED_EMAIL_DOMAINS', ''))))),
        'blocked_keywords' => array_values(array_filter(array_map('trim', explode(',', (string) env('CONTACT_BLOCKED_KEYWORDS', 'bitcoin,crypto,casino,poker,loan offer,seo service,payday'))))),
        'weighted_keywords' => [
            'free money' => 3,
            'quick cash' => 3,
            'loan' => 2,
            'seo' => 2,
            'backlink' => 2,
            'gambling' => 3,
            'betting' => 3,
            'crypto' => 2,
            'bitcoin' => 2,
            'forex' => 2,
            'adult' => 3,
            'viagra' => 3,
            'whatsapp' => 1,
            'telegram' => 1,
        ],
    ],

    /*
    | Optional Cloudflare Turnstile protection for contact form.
    | Enable only when site/secret keys are present.
    */
    'turnstile' => [
        'enabled' => (bool) env('CONTACT_TURNSTILE_ENABLED', false),
        'site_key' => env('CONTACT_TURNSTILE_SITE_KEY'),
        'secret_key' => env('CONTACT_TURNSTILE_SECRET_KEY'),
        'verify_endpoint' => env('CONTACT_TURNSTILE_VERIFY_ENDPOINT', 'https://challenges.cloudflare.com/turnstile/v0/siteverify'),
        'timeout_seconds' => (int) env('CONTACT_TURNSTILE_TIMEOUT', 4),
        'fail_open' => (bool) env('CONTACT_TURNSTILE_FAIL_OPEN', true),
    ],

    /*
    | Singleton site settings caching (Redis when CACHE_STORE=redis).
    */
    'cache' => [
        'settings_key' => env('SETTINGS_CACHE_KEY', 'hillcrest:settings:v1'),
        'settings_ttl_seconds' => (int) env('SETTINGS_CACHE_TTL', 900),
        'sitemap_key' => env('SITEMAP_CACHE_KEY', 'hillcrest:sitemap:v1'),
        'sitemap_ttl_seconds' => (int) env('SITEMAP_CACHE_TTL', 3600),
    ],

    /*
    | Referral form: multi-select labels (values stored as keys).
    */
    'referral_support_options' => [
        'daily_routine' => 'Daily routine and wellbeing support',
        'medication_prompt' => 'Medication prompting',
        'shopping' => 'Shopping and errands',
        'appointments' => 'Appointment support',
        'domestic' => 'Light domestic support and organisation',
        'social' => 'Social engagement and companionship',
        'community' => 'Community access and activities',
        'life_admin' => 'Budgeting and basic life admin support',
    ],
];
