<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>RolexCoderZ</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #141E30, #243B55);
            background-size: 400% 400%;
            animation: gradientAnimation 15s ease infinite;
            color: #fff;
            margin: 0;
            padding: 20px;
        }

        @keyframes gradientAnimation {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        .container {
            max-width: 800px;
            margin: auto;
            background: rgba(255, 255, 255, 0.1);
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
        }

        h1 {
            text-align: center;
            color: #FFD700;
            font-size: 2.5rem;
            text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
            margin-bottom: 30px;
        }

        .note {
            margin: 20px 0;
            padding: 20px;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.15);
            transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
        }

        .note:hover {
            transform: scale(1.05);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
            background: rgba(255, 255, 255, 0.25);
        }

        .note h3 {
            margin: 0 0 15px;
            color: #FFD700;
            font-size: 1.5rem;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .note button {
            padding: 12px 30px;
            background: linear-gradient(45deg, #FFD700, #FFB300);
            color: #000;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
            transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
        }

        .note button:hover {
            background: linear-gradient(45deg, #FFC300, #FFB300);
            transform: translateY(-2px);
            box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
        }

        .note button:active {
            transform: translateY(2px);
        }

        .popup {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: #FFD700;
            color: #000;
            padding: 15px 20px;
            border-radius: 8px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
            opacity: 0;
            visibility: hidden;
            transform: translateY(20px);
            transition: all 0.4s ease;
        }

        .popup.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .powered-by {
            text-align: center;
            margin-top: 40px;
            font-size: 14px;
            color: rgba(255, 255, 255, 0.6);
            letter-spacing: 1px;
        }

        #error {
            text-align: center;
            color: #FF4C4C;
            font-size: 18px;
            margin-top: 30px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>RolexCoderZ</h1>
        <div id="notes"></div>
        <div id="error" style="display: none;">🤧 Aa Gye Codes Copy Karne Yahi Karo 🤣🤣😅😅</div>
        <div class="powered-by">Powered by RolexCoderZ</div>
    </div>

    <div id="popup" class="popup"></div>

    <script>
        const allowedDomain = "rolexcoderz.netlify.app";
        const currentDomain = window.location.hostname;

        if (currentDomain === allowedDomain) {
            fetch('nn.json')
                .then(response => {
                    if (!response.ok) throw new Error("Failed to load notes");
                    return response.json();
                })
                .then(data => {
                    const notesContainer = document.getElementById('notes');
                    notesContainer.innerHTML = data.map(note => `
                        <div class="note">
                            <h3>${note.title}</h3>
                            <button onclick="copyToClipboard('${note.link}')">📖 View Notes</button>
                        </div>
                    `).join('');
                })
                .catch(error => {
                    document.getElementById('notes').innerHTML = '<p style="color: #FF4C4C;">Failed to load notes.</p>';
                });
        } else {
            document.getElementById('notes').style.display = 'none';
            document.getElementById('error').style.display = 'block';
        }

        function copyToClipboard(link) {
            const fullLink = `${link} by @RolexCoderZOfficial`;
            navigator.clipboard.writeText(fullLink).then(() => {
                showPopup(`Link copied: ${fullLink}`);
            }).catch(() => {
                showPopup("Failed to copy link.");
            });
        }

        function showPopup(message) {
            const popup = document.getElementById('popup');
            popup.textContent = message;
            popup.classList.add('show');
            setTimeout(() => {
                popup.classList.remove('show');
            }, 3000);
        }
    </script>
</body>
</html>