<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9">
  <xsl:output method="html" encoding="UTF-8" indent="yes" />

  <xsl:template match="/">
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>HealthSpeak XML Sitemap</title>
        <style>
          body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; margin: 2rem; color: #111; }
          h1 { margin-bottom: 0.4rem; }
          p { margin-top: 0; color: #555; }
          table { border-collapse: collapse; width: 100%; margin-top: 1rem; }
          th, td { border: 1px solid #ddd; padding: 0.55rem; text-align: left; font-size: 0.9rem; }
          th { background: #f7f7f7; font-weight: 600; }
          tr:nth-child(even) { background: #fcfcfc; }
          a { color: #0a66c2; text-decoration: none; }
          a:hover { text-decoration: underline; }
          .meta { margin-top: 0.5rem; font-size: 0.85rem; color: #666; }
        </style>
      </head>
      <body>
        <h1>HealthSpeak XML Sitemap</h1>
        <p>Canonical sitemap endpoint: <a href="https://healthspeakapp.com/sitemap.xml">https://healthspeakapp.com/sitemap.xml</a></p>
        <table>
          <thead>
            <tr>
              <th>URL</th>
              <th>Last Modified</th>
              <th>Change Frequency</th>
              <th>Priority</th>
            </tr>
          </thead>
          <tbody>
            <xsl:for-each select="sitemap:urlset/sitemap:url">
              <tr>
                <td><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc"/></a></td>
                <td><xsl:value-of select="sitemap:lastmod"/></td>
                <td><xsl:value-of select="sitemap:changefreq"/></td>
                <td><xsl:value-of select="sitemap:priority"/></td>
              </tr>
            </xsl:for-each>
          </tbody>
        </table>
        <p class="meta">Generated by HealthSpeak static sitemap file.</p>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
