<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ title }}</title>
    <style>
        :root {
            --purple: #bb86fc;
            --bg: #0a0a0a;
            --card: #1a1a1a;
            --text: #ffffff;
            --text-secondary: rgba(255, 255, 255, 0.9);
        }
        [data-theme="light"] {
            --purple: #7f39fb;
            --bg: #f5f5f5;
            --card: #ffffff;
            --text: #000000;
            --text-secondary: rgba(0, 0, 0, 0.9);
        }
        * {margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui; transition: .2s}
        body {background: var(--bg); color: var(--text); min-height: 100vh; padding: 20px}

        .container {max-width: 900px; margin: auto; padding: 20px}

        .header {text-align: center; margin-bottom: 40px}
        .title {
            font-size: 50px;
            color: var(--purple);
            margin-bottom: 10px;
            font-weight: 800;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }
        .subtitle {
            color: var(--purple);
            font-size: 20px;
            opacity: .9;
        }

        .banner {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 20px;
            margin: 20px 0;
            background: var(--card);
            padding: 20px;
            border-radius: 12px;
            border: 2px solid var(--purple);
            box-shadow: 0 4px 12px rgba(187,134,252,0.2);
        }

        .premium-text {
            font-size: 24px;
            font-weight: 600;
            color: var(--text);
        }
        .discord-img {
            height: 35px;
            transition: transform .2s;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
        }
        .discord-img:hover {
            transform: scale(1.1);
            filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
        }

        .item {
            display: flex;
            align-items: center;
            gap: 20px;
            background: var(--card);
            padding: 20px;
            margin: 15px 0;
            border-radius: 12px;
            border: 2px solid transparent;
            animation: slideIn .3s ease-out forwards;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .item:hover {
            border-color: var(--purple);
            transform: translateX(10px);
            box-shadow: 0 4px 12px rgba(187,134,252,0.2);
        }

        .icon {
            width: 60px;
            height: 60px;
            border-radius: 10px;
            overflow: hidden;
            border: 2px solid var(--purple);
            box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--purple);
        }
        .icon img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .details {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex: 1;
            color: var(--text);
        }

        .name {
            font-size: 20px;
            font-weight: 600;
            color: var(--text);
        }
        .neon-tag {
            margin-left: 10px;
            color: #39FF14;
            font-weight: 600;
            text-shadow: 0 0 5px #39FF14;
        }
        .mega-neon-tag {
            margin-left: 10px;
            font-weight: 600;
            animation: rainbow 2s linear infinite;
            text-shadow: 0 0 5px currentColor;
        }
        .value {
            color: var(--purple);
            font-weight: 700;
            font-size: 20px;
            background: var(--card);
            padding: 8px 16px;
            border-radius: 8px;
            border: 2px solid var(--purple);
            box-shadow: 0 2px 6px rgba(187,134,252,0.2);
        }

        .theme-btn {
            position: fixed;
            top: 20px;
            right: 20px;
            background: var(--purple);
            color: var(--bg);
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }
        .theme-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }

        .error {
            height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 30px;
            text-align: center;
            color: var(--text);
        }

        .error-message {
            font-size: 28px;
            color: var(--purple);
            font-weight: 600;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
            max-width: 600px;
            line-height: 1.4;
        }

        .error-discord {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 15px;
            padding: 20px;
            background: var(--card);
            border-radius: 12px;
            border: 2px solid var(--purple);
            box-shadow: 0 4px 12px rgba(187,134,252,0.2);
        }

        .error-discord img {
            height: 50px;
            margin-bottom: 10px;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
        }

        .error-discord a {
            color: var(--purple);
            text-decoration: none;
            font-size: 20px;
            font-weight: 600;
            transition: .2s;
        }

        .error-discord a:hover {
            transform: scale(1.05);
            text-shadow: 0 2px 4px rgba(187,134,252,0.3);
        }

        @keyframes slideIn {
            from {opacity: 0; transform: translateY(20px)}
            to {opacity: 1; transform: translateY(0)}
        }

        @keyframes rainbow {
            0% {color: red;}
            17% {color: orange;}
            33% {color: yellow;}
            50% {color: green;}
            67% {color: blue;}
            84% {color: purple;}
            100% {color: red;}
        }

        @media (max-width: 768px) {
            .banner {flex-direction: column}
            .details {flex-direction: column; align-items: flex-start; gap: 10px}
            .title {font-size: 40px}
            .error-message {font-size: 24px; padding: 0 20px}
        }
    </style>
</head>
<body data-theme="dark">
    {% if error %}
    <div class="error">
        <div class="error-message">{{ error }}</div>
        <div class="error-discord">
            <img class="discord-img" src="https://cdn.prod.website-files.com/6257adef93867e50d84d30e2/636e0a6a49cf127bf92de1e2_icon_clyde_blurple_RGB.png">
            <a href="https://discord.gg/CRRTDBwSwy">Join Our Discord Server</a>
        </div>
    </div>
    {% else %}
    <button class="theme-btn" onclick="toggleTheme()">Toggle Theme</button>
    <div class="container">
        <div class="header">
            <div class="title">Hits List</div>
            <div class="subtitle">Make sure to join the discord server!</div>
            <div class="banner">
                <div class="premium-text">Premium hits for free ONLY on Vlorp 🤑</div>
                <a href="https://discord.gg/CRRTDBwSwy">
                    <img class="discord-img" src="https://cdn.prod.website-files.com/6257adef93867e50d84d30e2/636e0a6a49cf127bf92de1e2_icon_clyde_blurple_RGB.png">
                </a>
            </div>
        </div>
        {% for item in items %}
            {% if item.get('Name') %}
            <div class="item" style="animation-delay: {{ loop.index * 0.1 }}s">
                {% if item.get('Icon') %}
                <div class="icon">
                    <img src="{{ item['Icon'] }}" alt="{{ item['Name'] }}">
                </div>
                {% endif %}
                <div class="details">
                    <div class="name">
                        {{ item['Name'] }}
                        {% if item.get('Type') == 'neon' %}
                            <span class="neon-tag">Neon</span>
                        {% elif item.get('Type') == 'mega' %}
                            <span class="mega-neon-tag">Mega Neon</span>
                        {% endif %}
                    </div>
                    {% if item.get('Value') is not none %}
                    <div class="value">
                        {% if item['Value']|string|float is number %}
                            {{ item['Value'] }}$
                        {% else %}
                            {{ item['Value'] }}
                        {% endif %}
                    </div>
                    {% endif %}
                </div>
            </div>
            {% endif %}
        {% endfor %}
    </div>
    {% endif %}
    <script>
        function toggleTheme() {
            document.body.setAttribute('data-theme', 
                document.body.getAttribute('data-theme') === 'dark' ? 'light' : 'dark'
            );
        }
    </script>
</body>
</html>