<?php
ob_start();
ob_clean();
header('Content-Type: application/xml; charset=utf-8');
header('X-Robots-Tag: noindex, follow');

$base = 'https://pashusos.com';
$today = date('Y-m-d');

$urls = [

    /* ── CORE PAGES ─────────────────────────────────────────── */
    ['loc' => $base . '/',                          'changefreq' => 'daily',   'priority' => '1.0', 'lastmod' => $today],
    ['loc' => $base . '/about',                     'changefreq' => 'monthly', 'priority' => '0.8', 'lastmod' => $today],
    ['loc' => $base . '/contact',                   'changefreq' => 'monthly', 'priority' => '0.7', 'lastmod' => $today],
    ['loc' => $base . '/faq',                       'changefreq' => 'monthly', 'priority' => '0.7', 'lastmod' => $today],
    ['loc' => $base . '/privacy-policy',            'changefreq' => 'yearly',  'priority' => '0.4', 'lastmod' => $today],
    ['loc' => $base . '/terms-and-conditions',      'changefreq' => 'yearly',  'priority' => '0.4', 'lastmod' => $today],
    ['loc' => $base . '/disclaimer',                'changefreq' => 'yearly',  'priority' => '0.4', 'lastmod' => $today],

    /* ── SERVICES ────────────────────────────────────────────── */
    ['loc' => $base . '/services',                  'changefreq' => 'weekly',  'priority' => '0.9', 'lastmod' => $today],
    ['loc' => $base . '/emergency-vet',             'changefreq' => 'weekly',  'priority' => '0.9', 'lastmod' => $today],
    ['loc' => $base . '/online-vet-consultation',   'changefreq' => 'weekly',  'priority' => '0.9', 'lastmod' => $today],
    ['loc' => $base . '/livestock-health',          'changefreq' => 'weekly',  'priority' => '0.8', 'lastmod' => $today],
    ['loc' => $base . '/cattle-treatment',          'changefreq' => 'weekly',  'priority' => '0.8', 'lastmod' => $today],
    ['loc' => $base . '/animal-vaccination',        'changefreq' => 'monthly', 'priority' => '0.8', 'lastmod' => $today],
    ['loc' => $base . '/deworming-service',         'changefreq' => 'monthly', 'priority' => '0.7', 'lastmod' => $today],
    ['loc' => $base . '/pregnancy-diagnosis',       'changefreq' => 'monthly', 'priority' => '0.7', 'lastmod' => $today],
    ['loc' => $base . '/milk-fever-treatment',      'changefreq' => 'monthly', 'priority' => '0.7', 'lastmod' => $today],
    ['loc' => $base . '/fmd-treatment',             'changefreq' => 'monthly', 'priority' => '0.7', 'lastmod' => $today],

    /* ── NANDIBABA AI ────────────────────────────────────────── */
    ['loc' => $base . '/nandibaba',                 'changefreq' => 'weekly',  'priority' => '0.9', 'lastmod' => $today],
    ['loc' => $base . '/nandibaba/about',           'changefreq' => 'monthly', 'priority' => '0.7', 'lastmod' => $today],

    /* ── REGISTRATION / ONBOARDING ───────────────────────────── */
    ['loc' => $base . '/register',                  'changefreq' => 'monthly', 'priority' => '0.8', 'lastmod' => $today],
    ['loc' => $base . '/register/farmer',           'changefreq' => 'monthly', 'priority' => '0.8', 'lastmod' => $today],
    ['loc' => $base . '/register/doctor',           'changefreq' => 'monthly', 'priority' => '0.7', 'lastmod' => $today],
    ['loc' => $base . '/register/pashusevak',       'changefreq' => 'monthly', 'priority' => '0.7', 'lastmod' => $today],

    /* ── BOOK / APPOINTMENT ──────────────────────────────────── */
    ['loc' => $base . '/book',                      'changefreq' => 'daily',   'priority' => '0.9', 'lastmod' => $today],
    ['loc' => $base . '/book/emergency',            'changefreq' => 'daily',   'priority' => '0.9', 'lastmod' => $today],

    /* ── PARTNERS / B2B ──────────────────────────────────────── */
    ['loc' => $base . '/partner',                   'changefreq' => 'monthly', 'priority' => '0.7', 'lastmod' => $today],
    ['loc' => $base . '/partner/fpo',               'changefreq' => 'monthly', 'priority' => '0.6', 'lastmod' => $today],
    ['loc' => $base . '/partner/pharmacy',          'changefreq' => 'monthly', 'priority' => '0.6', 'lastmod' => $today],

    /* ── COVERAGE / AREAS ────────────────────────────────────── */
    ['loc' => $base . '/coverage',                  'changefreq' => 'weekly',  'priority' => '0.7', 'lastmod' => $today],
    ['loc' => $base . '/coverage/bihar',            'changefreq' => 'weekly',  'priority' => '0.7', 'lastmod' => $today],
    ['loc' => $base . '/coverage/jharkhand',        'changefreq' => 'weekly',  'priority' => '0.6', 'lastmod' => $today],
    ['loc' => $base . '/coverage/up',               'changefreq' => 'weekly',  'priority' => '0.6', 'lastmod' => $today],

    /* ── BLOG / RESOURCES ────────────────────────────────────── */
    ['loc' => $base . '/blog',                      'changefreq' => 'daily',   'priority' => '0.8', 'lastmod' => $today],
    ['loc' => $base . '/resources',                 'changefreq' => 'weekly',  'priority' => '0.7', 'lastmod' => $today],

    /* ── AHCS / CREDIT SCORE ─────────────────────────────────── */
    ['loc' => $base . '/ahcs',                      'changefreq' => 'monthly', 'priority' => '0.8', 'lastmod' => $today],
    ['loc' => $base . '/ahcs/certificate',          'changefreq' => 'monthly', 'priority' => '0.7', 'lastmod' => $today],

    /* ── APP DOWNLOAD ────────────────────────────────────────── */
    ['loc' => $base . '/app',                       'changefreq' => 'monthly', 'priority' => '0.8', 'lastmod' => $today],

];

echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"' . "\n";
echo '        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' . "\n";
echo '        xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9' . "\n";
echo '          http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">' . "\n";

foreach ($urls as $url) {
    echo '  <url>' . "\n";
    echo '    <loc>' . htmlspecialchars($url['loc'], ENT_XML1, 'UTF-8') . '</loc>' . "\n";
    echo '    <lastmod>' . $url['lastmod'] . '</lastmod>' . "\n";
    echo '    <changefreq>' . $url['changefreq'] . '</changefreq>' . "\n";
    echo '    <priority>' . $url['priority'] . '</priority>' . "\n";
    echo '  </url>' . "\n";
}

echo '</urlset>';