<?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.xsl.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 - Çorum Bronz</title>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <style type="text/css">
                    body {
                        font-family: Arial, sans-serif;
                        font-size: 13px;
                        color: #545353;
                    }
                    table {
                        border: none;
                        border-collapse: collapse;
                        width: 100%;
                        margin-top: 20px;
                    }
                    #sitemap tr:nth-child(odd) {
                        background-color: #f7f7f7;
                    }
                    #sitemap tbody tr:hover {
                        background-color: #efefef;
                    }
                    #sitemap thead th {
                        text-align: left;
                        border-bottom: 1px solid #ccc;
                        padding: 10px;
                        color: #000;
                    }
                    #sitemap td {
                        padding: 10px;
                        border-bottom: 1px solid #eee;
                    }
                    a {
                        color: #c09d5c;
                        text-decoration: none;
                    }
                    a:hover {
                        text-decoration: underline;
                    }
                    .header {
                        background-color: #c09d5c;
                        color: #fff;
                        padding: 30px;
                        border-radius: 10px 10px 0 0;
                    }
                    .header h1 {
                        margin: 0;
                        font-size: 24px;
                    }
                    .header p {
                        margin: 10px 0 0;
                        opacity: 0.8;
                    }
                    .container {
                        max-width: 1000px;
                        margin: 50px auto;
                        box-shadow: 0 0 20px rgba(0,0,0,0.1);
                        border-radius: 10px;
                        overflow: hidden;
                        background: #fff;
                    }
                    .stats {
                        background: #f9f9f9;
                        padding: 20px;
                        border-bottom: 1px solid #eee;
                        display: flex;
                        gap: 40px;
                    }
                    .stat-item {
                        display: flex;
                        flex-direction: column;
                    }
                    .stat-label {
                        font-size: 11px;
                        text-transform: uppercase;
                        font-weight: bold;
                        color: #999;
                    }
                    .stat-value {
                        font-size: 18px;
                        font-weight: bold;
                        color: #333;
                    }
                </style>
            </head>
            <body>
                <div class="container">
                    <div class="header">
                        <h1>XML Sitemap</h1>
                        <p>Bu sitemap arama motorları için hazırlanmıştır ancak bu sayfadan da tüm linklere erişebilirsiniz.</p>
                    </div>
                    <div class="stats">
                        <div class="stat-item">
                            <span class="stat-label">Toplam URL</span>
                            <span class="stat-value"><xsl:value-of select="count(sitemap:urlset/sitemap:url)"/></span>
                        </div>
                        <div class="stat-item">
                            <span class="stat-label">Oluşturulma Tarihi</span>
                            <span class="stat-value"><xsl:value-of select="sitemap:urlset/sitemap:url[1]/sitemap:lastmod"/></span>
                        </div>
                    </div>
                    <table id="sitemap">
                        <thead>
                            <tr>
                                <th width="70%">URL</th>
                                <th width="10%">Öncelik</th>
                                <th width="10%">Frekans</th>
                                <th width="10%">Son Güncelleme</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:priority"/>
                                    </td>
                                    <td>
                                        <xsl:value-of select="sitemap:changefreq"/>
                                    </td>
                                    <td>
                                        <xsl:value-of select="sitemap:lastmod"/>
                                    </td>
                                </tr>
                            </xsl:for-each>
                        </tbody>
                    </table>
                </div>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>