<?php
header("Content-Type: application/xml; charset=utf-8");
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

  <!-- Main Homepage -->
  <url>
    <loc>https://yogvistaar.com/</loc>
    <lastmod><?php echo date('Y-m-d'); ?></lastmod>
    <changefreq>daily</changefreq>
    <priority>1.00</priority>
  </url>

  <!-- Instructor Profiles -->
  <url>
    <loc>https://yogvistaar.com/pages/teacher-details.php?id=sachin</loc>
    <lastmod><?php echo date('Y-m-d'); ?></lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.80</priority>
  </url>
  <url>
    <loc>https://yogvistaar.com/pages/ekta.php</loc>
    <lastmod><?php echo date('Y-m-d'); ?></lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.80</priority>
  </url>

  <!-- AUTOMATIC DYNAMIC BLOG PAGES DETECTOR -->
  <?php
  // Root directory ke sabhi blog-*.php files ko auto-detect karega
  $blogFiles = glob("blog-*.php");
  
  foreach ($blogFiles as $file) {
      $lastMod = date("Y-m-d", filemtime($file));
      echo "  <url>\n";
      echo "    <loc>https://yogvistaar.com/" . htmlspecialchars($file) . "</loc>\n";
      echo "    <lastmod>" . $lastMod . "</lastmod>\n";
      echo "    <changefreq>weekly</changefreq>\n";
      echo "    <priority>0.80</priority>\n";
      echo "  </url>\n";
  }
  ?>

  <!-- Legal & Policy Pages -->
  <url>
    <loc>https://yogvistaar.com/privacy-policy</loc>
    <lastmod><?php echo date('Y-m-d'); ?></lastmod>
    <changefreq>yearly</changefreq>
    <priority>0.30</priority>
  </url>
  <url>
    <loc>https://yogvistaar.com/terms-and-conditions</loc>
    <lastmod><?php echo date('Y-m-d'); ?></lastmod>
    <changefreq>yearly</changefreq>
    <priority>0.30</priority>
  </url>

</urlset>