<?xml version="1.0" encoding="UTF-8"?>
<?php
header('Content-Type: application/xml; charset=utf-8');
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
$host   = $_SERVER['HTTP_HOST'] ?? '';
$base   = $scheme . '://' . $host;
$today  = date('Y-m-d');
$urls = [
  ['loc'=>'/',              'priority'=>'1.0', 'changefreq'=>'daily'],
  ['loc'=>'/videos/',       'priority'=>'0.9', 'changefreq'=>'daily'],
  ['loc'=>'/services/',     'priority'=>'0.8', 'changefreq'=>'weekly'],
  ['loc'=>'/about/',        'priority'=>'0.7', 'changefreq'=>'monthly'],
  ['loc'=>'/contact/',      'priority'=>'0.7', 'changefreq'=>'monthly'],
];
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
        http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<?php foreach($urls as $u): ?>
  <url>
    <loc><?php echo htmlspecialchars($base . $u['loc']); ?></loc>
    <lastmod><?php echo $today; ?></lastmod>
    <changefreq><?php echo $u['changefreq']; ?></changefreq>
    <priority><?php echo $u['priority']; ?></priority>
  </url>
<?php endforeach; ?>
</urlset>
