<?php include('auth_guard.php'); ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>remotely UX Greeter </title>
    
    <style>
        body {
            background-color: #0f172a;
            color: white;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        .app-container {
            background: #1e293b;
            padding: 40px;
            border-radius: 20px;
            text-align: center;
            box-shadow: 0 15px 35px rgba(0,0,0,0.6);
            border: 1px solid #334155;
            width: 100%;
            max-width: 400px;
        }
        h2 { color: #38bdf8; margin-bottom: 25px; font-weight: 600; }
        
        input {
            width: 90%;
            padding: 12px;
            margin-bottom: 20px;
            border-radius: 8px;
            border: 2px solid #334155;
            background: #0f172a;
            color: white;
            outline: none;
            font-size: 16px;
            transition: 0.3s;
        }
        input:focus { border-color: #38bdf8; }

        button {
            width: 100%;
            padding: 12px;
            background: #0284c7;
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-weight: bold;
            font-size: 16px;
            transition: 0.3s;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        button:hover { background: #38bdf8; transform: translateY(-2px); }

        /* Output Message Area */
        #welcomeMessage {
            margin-top: 30px;
            font-size: 1.4rem;
            color: #10b981; /* Success Green */
            font-weight: bold;
            min-height: 50px;
            display: none; /* Initially hidden */
        }
    </style>

    <script src="jquery.min.js"></script>
    <script>
        if (typeof jQuery == 'undefined') {
            document.write('<script src="https://code.jquery.com/jquery-3.7.1.min.js"><\/script>');
        }
    </script>
</head>
<body>

    <div class="app-container">
        <h2>Welcome Module</h2>
        
        <input type="text" id="nameInput" placeholder="Enter your name here..." autocomplete="off">
        
        <button type="button" id="submitBtn">Go!</button>

        <div id="welcomeMessage"></div>
    </div>

    <script>
        $(document).ready(function() {
            // Button Click Event
            $('#submitBtn').on('click', function() {
                // Input value uthana
                var name = $('#nameInput').val().trim();

                if (name !== "") {
                    // Purane message ko hide karke naya message show karna
                    $('#welcomeMessage').fadeOut(200, function() {
                        $(this).text("Welcome to " + name + " portfolio!")
                               .fadeIn(600);
                    });
                } else {
                    alert("Please enter a name first!");
                }
            });

            // Enter key press par bhi kaam karega
            $('#nameInput').keypress(function(e) {
                if(e.which == 13) {
                    $('#submitBtn').click();
                }
            });
        });
    </script>

</body>
</html>