<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>cs-banana.shop</title>
    <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto+Mono:wght@300;400;700&display=swap" rel="stylesheet">
    <style>
        /* Общие стили */
        body {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            margin: 0;
            background-color: #000;
            font-family: 'Orbitron', sans-serif;
            color: #9370DB;
            transition: background-color 0.5s ease, color 0.5s ease;
            animation: shimmer 5s infinite alternate;
        }

        @keyframes shimmer {
            0% { color: #FF00FF; }
            50% { color: #800080; }
            100% { color: #FF00FF; }
        }

        .header {
            width: 100%;
            position: fixed;
            top: 0;
            left: 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px;
            background-color: rgba(0, 0, 0, 0.9);
            z-index: 1000;
            transition: background-color 0.5s ease, color 0.5s ease;
        }

        .graffiti {
            font-size: 60px;
            font-weight: bold;
            text-shadow:
                2px 2px 0 #ff0000,
                -2px -2px 0 #00ff00,
                2px -2px 0 #0000ff,
                -2px 2px 0 #ffff00;
            animation: gradient 3s infinite alternate;
        }

        @keyframes gradient {
            0% {
                text-shadow:
                    2px 2px 0 #ff0000,
                    -2px -2px 0 #00ff00,
                    2px -2px 0 #0000ff,
                    -2px 2px 0 #ffff00;
            }
            100% {
                text-shadow:
                    2px 2px 0 #00ff00,
                    -2px -2px 0 #ffff00,
                    2px -2px 0 #ff0000,
                    -2px 2px 0 #0000ff;
            }
        }

        .toggle-button {
            padding: 10px;
            font-size: 24px;
            cursor: pointer;
            background-color: transparent;
            border: none;
            color: inherit;
            margin-left: 10px;
            display: none;
        }

        .link {
            font-size: 24px;
            color: inherit;
            text-decoration: none;
        }

        .nav-buttons {
            display: flex;
            gap: 20px;
        }

        .nav-button {
            font-size: 24px;
            color: inherit;
            text-decoration: none;
            cursor: pointer;
            border: 2px solid #9370DB;
            padding: 10px 20px;
            border-radius: 5px;
            transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
        }

        .nav-button:hover {
            background-color: #9370DB;
            color: #fff;
            transform: translateY(-5px);
        }

        .login-button {
            font-size: 24px;
            color: inherit;
            text-decoration: none;
            cursor: pointer;
            border: 2px solid #9370DB;
            padding: 10px 20px;
            border-radius: 5px;
            transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
            margin-left: 20px;
        }

        .login-button:hover {
            background-color: #9370DB;
            color: #fff;
            transform: translateY(-5px);
        }

        .data-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 20px;
            width: 90%;
            max-width: 1200px;
            padding: 20px;
            margin-top: 140px;
        }

        input[type="number"] {
            -moz-appearance: textfield;
        }

        .categories-container {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 20px;
            width: 100%;
            padding: 20px;
            margin-top: 20px;
        }

        .category-section {
            flex: 1 1 calc(20% - 40px);
            min-width: 200px;
        }

        .category-section h2 {
            font-size: 24px;
            margin-bottom: 10px;
            color: #9370DB;
            font-family: 'Roboto Mono', monospace;
        }

        .skins-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            width: 100%;
        }

        form {
            color: inherit;
            transition: color 0.3s;
        }

        .filter-form {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 10px;
            margin-top: 140px;
            margin-bottom: 10px;
            padding: 10px;
            background-color: rgba(17, 17, 17, 0.9);
            border: 2px solid #9370DB;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(147, 112, 219, 0.7);
            animation: border-shimmer 2s infinite alternate;
        }

        .filter-form input[type="text"],
        .filter-form input[type="number"] {
            padding: 10px;
            font-size: 16px;
            border: 2px solid #9370DB;
            border-radius: 5px;
            background-color: #000;
            color: #9370DB;
            transition: border-color 0.3s, color 0.3s;
        }

        .filter-form input::placeholder {
            color: #9370DB;
        }

        .filter-form input:focus {
            border-color: #FF00FF;
            color: #FF00FF;
        }

        .filter-form button {
            padding: 10px 20px;
            font-size: 16px;
            border: 2px solid #9370DB;
            border-radius: 5px;
            background-color: #000;
            color: #9370DB;
            cursor: pointer;
            transition: background-color 0.3s, color 0.3s;
        }

        .filter-form button:hover {
            background-color: #9370DB;
            color: #fff;
        }

        .price-input-container {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .price-input-container input {
            width: 80px;
            text-align: center;
        }

        .data-item {
            background-color: rgba(34, 34, 34, 0.9);
            border: 1px solid #9370DB;
            border-radius: 5px;
            padding: 10px;
            text-align: center;
            transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
            margin: 10px;
            animation: border-shimmer 2s infinite alternate;
        }

        .data-item:hover {
            transform: scale(1.05);
            box-shadow: 0 0 20px rgba(147, 112, 219, 0.7);
        }

        .data-item h2 {
            font-size: 18px;
            margin-bottom: 5px;
            font-family: 'Roboto Mono', monospace;
        }

        .data-item p {
            font-size: 14px;
            margin: 5px 0;
            font-family: 'Roboto Mono', monospace;
        }

        .data-item img {
            width: 150px;
            height: auto;
            margin: 10px 0;
            border-radius: 5px;
        }

        .button-link {
            background: linear-gradient(90deg, #800080, #800080);
            border: none;
            color: white;
            padding: 0.5em 1em;
            font-size: 1em;
            cursor: pointer;
            transition: background 0.3s, transform 0.3s;
            text-decoration: none;
            display: inline-block;
            margin: 0.5em 0;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(128, 0, 128, 0.8);
        }

        .button-link:hover {
            background: linear-gradient(90deg, #660066, #800080);
            transform: scale(1.05);
        }

        @keyframes border-shimmer {
            0% { border-color: #FF00FF; }
            50% { border-color: #800080; }
            100% { border-color: #FF00FF; }
        }

        /* Стили для маленьких экранов */
        @media (max-width: 768px) {
            .toggle-button {
                display: block;
                position: fixed;
                top: 20px;
                right: 20px;
                z-index: 1001;
                background-color: #000;
                border: 2px solid #9370DB;
                border-radius: 5px;
                padding: 10px;
            }

            .header {
                padding: 10px;
            }

            .filter-form {
                margin-top: 250px;
                flex-direction: column;
                align-items: center;
                gap: 10px;
                width: 90%;
                padding: 20px;
                border-width: 3px;
            }

            .filter-form input[type="text"],
            .filter-form input[type="number"] {
                width: 100%;
                margin-right: 0;
            }

            .filter-form .price-input-container {
                flex-direction: row;
                justify-content: center;
                gap: 10px;
                width: 100%;
            }

            .filter-form button {
                width: 100%;
            }

            .categories-container {
                margin-top: 20px;
            }

            .category-section {
                flex: 1 1 100%;
                min-width: 100%;
            }

            .data-item {
                width: calc(100% - 40px);
                margin: 10px 0;
                border: 2px solid #9370DB;
                animation: border-shimmer 2s infinite alternate;
            }

            .data-item img {
                width: 200px;
                height: auto;
            }

            .data-item h2 {
                font-size: 16px;
            }

            .data-item p {
                font-size: 14px;
            }

            .button-link {
                width: 50%;
                font-size: 0.8em;
                padding: 0.3em 0.6em;
            }

            .nav-buttons {
                display: none;
                flex-direction: column;
                gap: 10px;
                position: absolute;
                top: 100%;
                left: 10px;
                background-color: #000;
                padding: 10px;
                border: 2px solid #9370DB;
                border-radius: 5px;
                z-index: 1000;
            }

            .nav-buttons.active {
                display: flex;
            }
        }

        .reset-link {
            font-size: 16px;
            border: 2px solid #9370DB;
            border-radius: 5px;
            background-color: #000;
            color: #9370DB;
            cursor: pointer;
            transition: background-color 0.3s, color 0.3s;
            padding: 10px 20px;
            text-decoration: none;
            display: inline-block;
            margin-left: 10px;
        }

        .reset-link:hover {
            background-color: #9370DB;
            color: #fff;
        }
    </style>
</head>
<body>

<div class="header">
    <a href="/" class="link"><div class="graffiti">cs-banana.shop</div></a>
    <button class="toggle-button" onclick="toggleMenu()">☰</button>
    <div class="nav-buttons">
        <a href="/posts" class="nav-button">News</a>
        <a href="/skins" class="nav-button">Shop</a>
        <a href="/cheatCSs" class="nav-button">Cheats</a>
        <a href="/autoisation" class="login-button" th:text="${root} != null ? '👨🏻‍💻' : 'Sign up'">Sign up</a>
        <button class="login-button" onclick="toggleBackground()">💡️|</button>
    </div>
</div>

<div>
    <form class="filter-form" th:action="@{/filter}" method="post">
        <div class="price-input-container">
            <input type="number" id="min-price" name="minPrice" placeholder="Min.price" min="0">
            <input type="number" id="max-price" name="maxPrice" placeholder="Max.price" min="0">
        </div>
        <input type="text" id="search-name" name="searchName" placeholder="Name search">
        <button type="submit">Apply</button>
        <a href="/sbrosfilters" class="reset-link">Reset</a>
    </form>
</div>

<div class="categories-container">
    <div id="avtomaty" class="category-section">
        <h2>Automatic</h2>
        <div class="skins-list">
            <div th:each="skin : ${skinsAvtomaty}" class="data-item">
                <h2 th:text="${skin.name}">Title</h2>
                <img th:src="${skin.put_img1}" alt="img 1">
                <p th:text="'Price: ' + ${skin.cena} + '$'">Price</p>
                <a th:href="@{/skinsAvtomaty/{id}(id=${skin.id})}" class="button-link">🛒</a>
                <p th:text="'Quantity: ' + ${skin.kolvo}">Quantity</p>
            </div>
        </div>
    </div>

    <div id="knives" class="category-section">
        <h2>Knives</h2>
        <div class="skins-list">
            <div th:each="skin : ${skinsNoshi}" class="data-item">
                <h2 th:text="${skin.name}">Title</h2>
                <img th:src="${skin.put_img1}" alt="img 1">
                <p th:text="'Price: ' + ${skin.cena} + '$'">Price</p>
                <a th:href="@{/skinsNoshi/{id}(id=${skin.id})}" class="button-link">🛒</a>
                <p th:text="'Quantity: ' + ${skin.kolvo}">Quantity</p>
            </div>
        </div>
    </div>

    <div id="stickers" class="category-section">
        <h2>Stickers</h2>
        <div class="skins-list">
            <div th:each="skin : ${skinsNakleyki}" class="data-item">
                <h2 th:text="${skin.name}">Title</h2>
                <img th:src="${skin.put_img1}" alt="img 1">
                <p th:text="'Price: ' + ${skin.cena} + '$'">Price</p>
                <a th:href="@{/skinsNakleyki/{id}(id=${skin.id})}" class="button-link">🛒</a>
                <p th:text="'Quantity: ' + ${skin.kolvo}">Quantity</p>
            </div>
        </div>
    </div>

    <div id="gloves" class="category-section">
        <h2>Gloves</h2>
        <div class="skins-list">
            <div th:each="skin : ${skinsPertatki}" class="data-item">
                <h2 th:text="${skin.name}">Title</h2>
                <img th:src="${skin.put_img1}" alt="img 1">
                <p th:text="'Price: ' + ${skin.cena} + '$'">Price</p>
                <a th:href="@{/skinsPertatki/{id}(id=${skin.id})}" class="button-link">🛒</a>
                <p th:text="'Quantity: ' + ${skin.kolvo}">Quantity</p>
            </div>
        </div>
    </div>

    <div id="pistols" class="category-section">
        <h2>Pistols</h2>
        <div class="skins-list">
            <div th:each="skin : ${skinsPistolets}" class="data-item">
                <h2 th:text="${skin.name}">Title</h2>
                <img th:src="${skin.put_img1}" alt="img 1">
                <p th:text="'Price: ' + ${skin.cena} + '$'">Price</p>
                <a th:href="@{/skinsPistolets/{id}(id=${skin.id})}" class="button-link">🛒</a>
                <p th:text="'Quantity: ' + ${skin.kolvo}">Quantity</p>
            </div>
        </div>
    </div>
</div>

<script>
    function toggleBackground() {
        const body = document.body;
        const header = document.querySelector('.header');
        const button = document.querySelector('.toggle-button');
        const items = document.querySelectorAll('.data-item');
        const navButtons = document.querySelectorAll('.nav-button');
        const forms = document.querySelectorAll('form');
        const inputs = document.querySelectorAll('input');
        const formButtons = document.querySelectorAll('form button');
        const resetLinks = document.querySelectorAll('.reset-link');

        if (body.style.backgroundColor === 'black') {
            body.style.backgroundColor = 'white';
            body.style.color = 'black';
            header.style.backgroundColor = 'white';
            header.style.color = 'black';
            button.style.color = 'black';
            navButtons.forEach(navButton => {
                navButton.style.color = 'black';
                navButton.style.borderColor = 'black';
            });
            items.forEach(item => {
                item.style.backgroundColor = 'white';
                item.style.color = 'black';
                item.style.borderColor = 'black';
            });
            forms.forEach(form => {
                form.style.color = 'black';
                form.style.backgroundColor = 'white';
            });
            inputs.forEach(input => {
                input.style.color = 'black';
                input.style.borderColor = 'black';
                input.style.backgroundColor = 'white';
            });
            formButtons.forEach(formButton => {
                formButton.style.color = 'black';
                formButton.style.borderColor = 'black';
                formButton.style.backgroundColor = 'white';
            });
            resetLinks.forEach(resetLink => {
                resetLink.style.color = 'black';
                resetLink.style.borderColor = 'black';
                resetLink.style.backgroundColor = 'white';
            });
        } else {
            body.style.backgroundColor = 'black';
            body.style.color = '#FF00FF';
            header.style.backgroundColor = 'black';
            header.style.color = '#FF00FF';
            button.style.color = '#FF00FF';
            navButtons.forEach(navButton => {
                navButton.style.color = '#FF00FF';
                navButton.style.borderColor = '#FF00FF';
            });
            items.forEach(item => {
                item.style.backgroundColor = '#111';
                item.style.color = '#FF00FF';
                item.style.borderColor = '#FF00FF';
            });
            forms.forEach(form => {
                form.style.color = '#FF00FF';
                form.style.backgroundColor = 'black';
            });
            inputs.forEach(input => {
                input.style.color = '#FF00FF';
                input.style.borderColor = '#FF00FF';
                input.style.backgroundColor = 'black';
            });
            formButtons.forEach(formButton => {
                formButton.style.color = '#FF00FF';
                formButton.style.borderColor = '#FF00FF';
                formButton.style.backgroundColor = 'black';
            });
            resetLinks.forEach(resetLink => {
                resetLink.style.color = '#FF00FF';
                resetLink.style.borderColor = '#FF00FF';
                resetLink.style.backgroundColor = 'black';
            });
        }
    }

    function toggleMenu() {
        const navButtons = document.querySelector('.nav-buttons');
        navButtons.classList.toggle('active');
    }
</script>

</body>
</html>