<?php
return [
    'name' => $_ENV['APP_NAME'] ?? 'Crawl Audit Engine',
    'env' => $_ENV['APP_ENV'] ?? 'production',
    'debug' => filter_var($_ENV['APP_DEBUG'] ?? false, FILTER_VALIDATE_BOOL),
    'url' => rtrim($_ENV['APP_URL'] ?? '', '/'),
    'timezone' => $_ENV['APP_TIMEZONE'] ?? 'UTC',
    'session_name' => $_ENV['SESSION_NAME'] ?? 'crawl_engine_session',
    'crawl_defaults' => [
        'max_depth' => max(0, (int)($_ENV['CRAWL_DEFAULT_MAX_DEPTH'] ?? 2)),
        'max_pages' => max(0, (int)($_ENV['CRAWL_DEFAULT_MAX_PAGES'] ?? 0)),
        'concurrency' => max(1, (int)($_ENV['CRAWL_DEFAULT_CONCURRENCY'] ?? 5)),
    ],
    'crawler' => [
        'user_agent'      => $_ENV['CRAWL_USER_AGENT']      ?? 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
        'timeout_seconds' => max(5, (int)($_ENV['CRAWL_TIMEOUT_SECONDS'] ?? 15)),
    ],
    'pagespeed_api_key' => $_ENV['PAGESPEED_API_KEY'] ?? '',
];
