<?php

// Auto-detect base URL
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http';
$host = $_SERVER['HTTP_HOST'] ?? 'localhost';
$script = $_SERVER['SCRIPT_NAME'] ?? '';
// Strip script name to get clean root path
$basePath = str_replace(['/public/index.php', '/index.php'], '', $script);

return [
    // Dynamic URL for portability
    'url' => $protocol . '://' . $host . $basePath,
];
