<!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;
            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);
        }

        .container {
            display: flex;
            justify-content: space-between;
            width: 90%;
            max-width: 1200px;
            padding: 20px;
            margin-top: 100px; /* Уменьшил отступ сверху */
            gap: 20px;
        }

        .product-details {
            background-color: rgba(17, 17, 17, 0.9);
            border: 2px solid #9370DB;
            border-radius: 10px;
            padding: 20px;
            width: 60%;
            box-shadow: 0 0 20px rgba(147, 112, 219, 0.7);
            transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .product-details:hover {
            transform: scale(1.02);
            box-shadow: 0 0 30px rgba(147, 112, 219, 1);
        }

        .product-details h2 {
            font-size: 28px;
            margin-bottom: 20px;
            font-family: 'Roboto Mono', monospace;
        }

        .product-details p {
            font-size: 18px;
            margin: 10px 0;
            font-family: 'Roboto Mono', monospace;
        }

        .product-details img {
            width: 320px;
            height: auto;
            margin: 20px 0;
            border-radius: 10px;
        }

        .payment-form {
            background-color: rgba(17, 17, 17, 0.9);
            border: 2px solid #9370DB;
            border-radius: 10px;
            padding: 20px;
            width: 35%;
            box-shadow: 0 0 20px rgba(147, 112, 219, 0.7);
            transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            position: relative; /* Для стрелочки */
        }

        .payment-form:hover {
            transform: scale(1.02);
            box-shadow: 0 0 30px rgba(147, 112, 219, 1);
        }

        .payment-form h2 {
            font-size: 22px;
            margin-bottom: 10px;
            font-family: 'Roboto Mono', monospace;
        }

        .payment-form input {
            margin: 10px 0;
            padding: 10px;
            width: 80%;
            border: 1px solid #9370DB;
            border-radius: 5px;
            background-color: #222;
            color: #fff;
            transition: border-color 0.3s ease, color 0.3s ease;
        }

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

        .payment-form button {
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            background-color: #9370DB;
            color: #fff;
            cursor: pointer;
            transition: background-color 0.3s ease, color 0.3s ease;
        }

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

        .payment-options {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }

        .payment-options button {
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            background-color: #9370DB;
            color: #fff;
            cursor: pointer;
            transition: background-color 0.3s ease, color 0.3s ease;
            font-family: Arial, sans-serif; /* Более стандартный шрифт */
        }

        .payment-options button:hover {
            background-color: #fff;
            color: #9370DB;
        }

        .promo-form {
            margin-top: 20px;
        }

        .promo-form h3 {
            color: #FF00FF;
            animation: shimmer 2s infinite alternate;
            font-family: 'Roboto Mono', monospace;
        }

        .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 ease, transform 0.3s ease;
            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);
        }

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

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

        .price-text {
            animation: purpleShimmer 2s infinite alternate;
        }

        @keyframes purpleShimmer {
            0% { color: #800080; }
            50% { color: #9370DB; }
            100% { color: #FF00FF; }
        }

        /* Стрелочка вниз */
        .arrow-down {
            position: absolute;
            bottom: -20px; /* Расположение стрелочки внутри рамки */
            left: 50%;
            transform: translateX(-50%);
            font-size: 40px;
            font-weight: bold; /* Толще стрелочка */
            color: #9370DB;
            animation: arrow-bounce 1.5s infinite;
            cursor: pointer;
        }

        @keyframes arrow-bounce {
            0%, 100% {
                transform: translateX(-50%) translateY(0);
            }
            50% {
                transform: translateX(-50%) translateY(10px);
            }
        }

        .arrow-down:hover {
            color: #FF00FF;
        }

        /* Остальные стили */
        .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 ease, color 0.3s ease;
        }

        .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 ease, color 0.3s ease;
        }

        .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;
        }

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

        .reset-link:hover {
            background-color: #9370DB;
            color: #fff;
        }

        /* Стили для похожих скинов */
        .similar-skins {
            width: 100%;
            padding: 20px;
            margin-top: 20px;
            text-align: center;
        }

        .skins-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            max-width: 1200px;
            margin: 0 auto;
        }

        .data-item {
            background-color: rgba(34, 34, 34, 0.9);
            border: 2px solid #9370DB;
            border-radius: 10px;
            padding: 10px;
            text-align: center;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

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

        .data-item img {
            width: 40%;
            height: auto;
            border-radius: 5px;
        }

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

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

        .data-item .button-link {
            margin-top: 10px;
        }

        pre {
            font-family: 'Roboto Mono', monospace;
            font-size: 16px;
            line-height: 1.5;
            margin: 10px 0;
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        @media (max-width: 1024px) {
            .container {
                flex-direction: column;
                align-items: center;
            }

            .product-details, .payment-form {
                width: 90%;
            }
        }

        @media (max-width: 768px) {
            .header {
                flex-direction: column;
                align-items: stretch;
            }

            .nav-buttons {
                display: none;
                flex-direction: column;
                width: 100%;
            }

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

            .nav-button, .login-button {
                width: 100%;
                text-align: center;
                font-size: 20px;
                padding: 15px;
            }

            .toggle-button {
                display: block;
            }

            .filter-form {
                margin-top: 250px; /* Уменьшенный отступ сверху для мобильных устройств */
                padding: 10px;
                width: 90%; /* Ширина формы на маленьких экранах */
                margin-left: auto;
                margin-right: auto;
            }

            .filter-form .price-input-container {
                flex-direction: column; /* Элементы ввода цены в столбик */
                gap: 10px;
            }

            .filter-form input[type="text"],
            .filter-form input[type="number"] {
                width: 100%; /* Полная ширина для мобильных устройств */
            }

            .filter-form button,
            .reset-link {
                width: 100%; /* Полная ширина для кнопок */
                margin: 5px 0; /* Отступы между кнопками */
            }
        }
    </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} ? '👨🏻‍💻' : '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="container">
    <div class="product-details">
        <h2 th:text="${post.name}">Title</h2>
        <img th:src="${post.put_img1}" alt="img 1">
        <pre th:text="'Description: ' + ${post.opisanie}">Description</pre>
        <h2 class="price-text" th:text="'Price: ' + ${post.cena} + '$'">Price</h2>
        <p th:text="'Quantity: ' + ${post.kolvo}">Quantity</p>
    </div>

    <div class="payment-form">
        <br><br><br>
        <h2>Payment</h2>
        <br>
        <div class="payment-options">
            <a th:href="@{/skinsNoshi/card/bay/{id}(id=${post.id})}" class="button-link">Card</a>
            <a th:href="@{/skinsNoshi/crypto/bay/{id}(id=${post.id})}" class="button-link">Cryptocurrency</a>
        </div>
        <br><br><br><br>
        <form class="promo-form" action="/promocode" method="POST">
            <h3>Promocode</h3><br>
            <input type="text" name="promocode" placeholder="Enter the promocode" required>
            <button type="submit" class="apply-button">Apply</button>
        </form>
        <!-- Стрелочка вниз -->
        <div class="arrow-down" onclick="scrollToSimilarSkins()">↓</div>
    </div>
</div>

<!-- Похожие скины -->
<div class="similar-skins" id="similar-skins">
    <h1>Similar skins</h1>
    <br>
    <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>

<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('.payment-form, .promo-form, .product-details, .filter-form');
        const inputs = document.querySelectorAll('.payment-form input, .filter-form input');
        const buttons = document.querySelectorAll('.payment-form button, .filter-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.backgroundColor = 'white';
                form.style.color = 'black';
            });
            inputs.forEach(input => {
                input.style.backgroundColor = 'white';
                input.style.color = 'black';
                input.style.borderColor = 'black';
            });
            buttons.forEach(button => {
                button.style.backgroundColor = 'white';
                button.style.color = 'black';
                button.style.borderColor = 'black';
            });
            resetLinks.forEach(resetLink => {
                resetLink.style.backgroundColor = 'white';
                resetLink.style.color = 'black';
                resetLink.style.borderColor = 'black';
            });
        } 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.backgroundColor = '#111';
                form.style.color = '#FF00FF';
            });
            inputs.forEach(input => {
                input.style.backgroundColor = '#222';
                input.style.color = '#FF00FF';
                input.style.borderColor = '#FF00FF';
            });
            buttons.forEach(button => {
                button.style.backgroundColor = '#000';
                button.style.color = '#FF00FF';
                button.style.borderColor = '#FF00FF';
            });
            resetLinks.forEach(resetLink => {
                resetLink.style.backgroundColor = '#000';
                resetLink.style.color = '#FF00FF';
                resetLink.style.borderColor = '#FF00FF';
            });
        }
    }

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

    function scrollToSimilarSkins() {
        const similarSkinsSection = document.getElementById('similar-skins');
        similarSkinsSection.scrollIntoView({ behavior: 'smooth' });
    }
</script>
</body>
</html>