<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" 
                xmlns:html="http://www.w3.org/TR/REC-html40"
                xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>XML Sitemap - signature-resize.com</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <style type="text/css">
          body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
            color: #334155;
            background-color: #ffffff;
            margin: 0;
            padding: 30px;
          }
          #content {
            max-width: 1100px;
            margin: 0 auto;
          }
          h1 {
            font-size: 2rem;
            font-weight: 700;
            color: #0f172a;
            margin-top: 0;
            margin-bottom: 0.5rem;
          }
          p.desc {
            font-size: 0.95rem;
            color: #64748b;
            margin-bottom: 0.5rem;
            line-height: 1.6;
          }
          p.desc a {
            color: #2563eb;
            text-decoration: underline;
          }
          p.count {
            font-size: 1rem;
            font-weight: 600;
            color: #1e293b;
            margin-top: 1.5rem;
            margin-bottom: 1.5rem;
          }
          table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.9rem;
          }
          th {
            text-align: left;
            padding: 10px 12px;
            font-weight: 700;
            color: #475569;
            border-bottom: 2px solid #cbd5e1;
            background-color: #ffffff;
          }
          td {
            padding: 10px 12px;
            border-bottom: 1px solid #e2e8f0;
          }
          tr:nth-child(even) {
            background-color: #f8fafc;
          }
          tr:hover {
            background-color: #f1f5f9;
          }
          a {
            color: #2563eb;
            text-decoration: none;
            word-break: break-all;
          }
          a:hover {
            text-decoration: underline;
          }
          .badge {
            background-color: #e0e7ff;
            color: #3730a3;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 600;
            margin-left: 8px;
          }
        </style>
      </head>
      <body>
        <div id="content">
          <h1>XML Sitemap</h1>
          <p class="desc">
            Generated by <strong>signature-resize.com</strong>, this is an XML Sitemap, meant for consumption by search engines.
          </p>
          <p class="desc">
            You can find more information about XML sitemaps on <a href="https://sitemaps.org" target="_blank">sitemaps.org</a>.
          </p>
          <p class="count">
            This XML Sitemap contains <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> URLs (including all blog posts, articles, categories, and tools).
          </p>
          <table>
            <thead>
              <tr>
                <th style="width: 70%;">URL</th>
                <th style="width: 10%;">Images</th>
                <th style="width: 20%;">Last Mod.</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>0</td>
                  <td>
                    <xsl:value-of select="concat(substring(sitemap:lastmod,0,11), ' ', substring(sitemap:lastmod,12,5), ' +00:00')"/>
                  </td>
                </tr>
              </xsl:for-each>
            </tbody>
          </table>
        </div>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
