
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Spam Filter & Follower Details</title>
<style>
    :root {
        --primary-color: #007bff;
        --primary-hover: #0056b3;
        --bg-color: #ffffff;
        --card-bg: #f9f9f9;
        --text-color: #333;
        --border-color: #e0e0e0;
        --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.05);
    }

    body {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        background-color: #f1f3f6;
        margin: 0;
        padding: 20px;
        color: var(--text-color);
    }

    .custom-form {
        max-width: 600px;
        margin: 0 auto 30px auto;
        padding: 25px;
        border-radius: 12px;
        background-color: var(--card-bg);
        box-shadow: var(--shadow-light);
        transition: all 0.3s ease;
    }

    .custom-form h5 {
        text-align: center;
        margin-bottom: 25px;
        font-size: 1.4rem;
        font-weight: 600;
        color: var(--text-color);
    }

    .form-label {
        display: block;
        font-weight: 500;
        margin-bottom: 8px;
        color: #555;
    }

    .form-controlnew {
        width: 100%;
        padding: 14px;
        margin-bottom: 20px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        font-size: 1rem;
        transition: border 0.2s ease;
        background-color: #fff;
    }

    .form-controlnew:focus {
        border-color: var(--primary-color);
        outline: none;
        box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    }

    .btn-submitnew {
        display: block;
        width: 100%;
        padding: 14px;
        background-color: var(--primary-color);
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.2s ease;
    }

    .btn-submitnew:hover {
        background-color: var(--primary-hover);
        transform: translateY(-2px);
    }

    .loader {
        display: block;
        margin: 20px auto 10px auto;
        width: 45px;
        height: 45px;
        border: 4px solid #eee;
        border-top: 4px solid var(--primary-color);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    .response-box {
        background-color: #fff;
        padding: 15px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        white-space: pre-wrap;
        font-size: 0.95rem;
        line-height: 1.5;
        color: #444;
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    }

    /* Responsive Design */
    @media (max-width: 768px) {
        .custom-form {
            padding: 20px;
            margin: 15px;
        }

        .form-controlnew,
        .btn-submitnew {
            font-size: 0.95rem;
            padding: 12px;
        }
    }

    @media (max-width: 480px) {
        .custom-form {
            padding: 15px;
            margin: 10px;
        }

        .form-controlnew,
        .btn-submitnew {
            font-size: 0.9rem;
            padding: 10px;
        }

        .custom-form h5 {
            font-size: 1.2rem;
        }
    }
    .alert-box {
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    margin-top: 10px;
    line-height: 1.5;
    font-size: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

</style>

    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
    <div class="custom-form">
        <h5>Check Spam Filter</h5>
        <div class="mb-3">
            <label for="usernameSpam" class="form-label">Username</label>
            <input type="text" id="usernameSpam" class="form-controlnew" placeholder="Enter Username" required="">
        </div>
        <div id="loaderSpam" class="loader" style="display: none;"></div>

        <div id="responses" class="mt-4">
            <pre id="responseOutputs" class="response-box"></pre>
        </div>
        <button type="button" id="checkSpamBtn" class="btn-submitnew" onclick="checkSpam()">Check Spam Filter</button>
    </div>

    <div class="custom-form">
        <h5>Check Follower Details</h5>
        <div class="mb-3">
            <label for="usernameFollower" class="form-label">Username</label>
            <input type="text" id="usernameFollower" class="form-controlnew" placeholder="Enter Username" required="">
        </div>

        <div id="loaderFollower" class="loader" style="display: none;"></div>

        <div id="responsef" class="mt-4">
            <pre id="responseOutputf" class="response-box"></pre>
        </div>
        <button type="button" id="checkFollowerBtn" class="btn-submitnew" onclick="checkFollower()">Check Follower Count</button>
    </div>

    <script>
        function makeRequest(username, type, loaderId, responseId, responseOutputId, successCallback) {
            if (!username.trim()) {
                document.getElementById(responseId).style.display = 'block';
                document.getElementById(responseOutputId).innerHTML = 
                    '<span style="color: red; font-weight: bold;">Error: Username cannot be empty.</span>';
                return;
            }

            document.getElementById(loaderId).style.display = 'block';
            document.getElementById(responseOutputId).textContent = '';
            document.getElementById(responseId).style.display = 'none';

            $.ajax({
                url: 'https://cdn.myrentalpanel.com/instagram/instacall',
                type: 'POST',
                data: { username, type },
                success: successCallback,
                error: function () {
                    document.getElementById(responseOutputId).textContent = 'An error occurred.';
                },
                complete: function () {
                    document.getElementById(loaderId).style.display = 'none';
                }
            });
        }

function checkSpam() {
    makeRequest(
        document.getElementById('usernameSpam').value,
        2,
        'loaderSpam',
        'responses',
        'responseOutputs',
        function (response) {
            let data = JSON.parse(response);
            document.getElementById('responses').style.display = 'block';

            let outputElem = document.getElementById('responseOutputs');
            outputElem.className = 'alert-box'; // reset class first

            if (data.message === "Flag is off. You are able to order.") {
                outputElem.classList.add('alert-success');
                outputElem.innerHTML = '✅ Response: ' + data.message;
            } else {
                outputElem.classList.add('alert-error');
                outputElem.innerHTML = '🚫 Response: ' + data.message;
            }
        }
    );
}


function checkFollower() {
    makeRequest(
        document.getElementById('usernameFollower').value,
        1,
        'loaderFollower',
        'responsef',
        'responseOutputf',
        function (response) {
            let data = JSON.parse(response);
            document.getElementById('responsef').style.display = 'block';

            let outputElem = document.getElementById('responseOutputf');
            outputElem.className = 'alert-box'; // reset class first

            if (data.followers === null || data.followers === undefined || isNaN(data.followers)) {
                outputElem.classList.add('alert-error');
                outputElem.innerHTML = '🚫 Error: Username not given or wrong username.';
            } else if (data.followers < 1000) {
                outputElem.classList.add('alert-warning');
                outputElem.innerHTML = '⚠️ Followers: ' + data.followers;
            } else {
                outputElem.classList.add('alert-success');
                outputElem.innerHTML = '✅ Followers: ' + data.followers;
            }
        }
    );
}

    </script>
</body>
</html>
