<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:s="http://www.sitemaps.org/schemas/sitemap/0.9"
	xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
	<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"/>
				<title>XML Sitemap</title>
				<style>
					body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #1d2327; margin: 0; background: #f6f7f7; }
					.wrap { max-width: 1000px; margin: 0 auto; padding: 30px 20px; }
					h1 { font-size: 22px; margin: 0 0 6px; }
					.meta { color: #646970; font-size: 13px; margin-bottom: 20px; }
					table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); border-radius: 6px; overflow: hidden; }
					th, td { text-align: left; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid #f0f0f1; }
					th { background: #2271b1; color: #fff; font-weight: 600; }
					tr:hover td { background: #f6f7f7; }
					a { color: #2271b1; text-decoration: none; word-break: break-all; }
					a:hover { text-decoration: underline; }
					.num { color: #646970; width: 50px; }
				</style>
			</head>
			<body>
				<div class="wrap">
					<h1>XML Sitemap</h1>
					<p class="meta">
						This sitemap contains <strong><xsl:value-of select="count(s:urlset/s:url)"/></strong> URLs.
						Generated by XML Nest Creator.
					</p>
					<table>
						<tr>
							<th class="num">#</th>
							<th>URL</th>
							<th>Priority</th>
							<th>Change Freq.</th>
							<th>Last Modified</th>
						</tr>
						<xsl:for-each select="s:urlset/s:url">
							<tr>
								<td class="num"><xsl:value-of select="position()"/></td>
								<td>
									<a href="{s:loc}"><xsl:value-of select="s:loc"/></a>
								</td>
								<td><xsl:value-of select="s:priority"/></td>
								<td><xsl:value-of select="s:changefreq"/></td>
								<td><xsl:value-of select="s:lastmod"/></td>
							</tr>
						</xsl:for-each>
					</table>
				</div>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
