<?php
// Simple home page with session tracking
// In production, you'd use $_SESSION to track login state
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Home Page</title>
    <link rel="stylesheet" href="style.css">
    <style>
        .home-container {
            background-color: yellow;
            color: brown;
            width: 100%;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            padding: 20px;
        }

        .home-content {
            text-align: center;
        }

        .home-content h1 {
            font-size: 32px;
            margin-bottom: 20px;
            color: brown;
        }

        .home-content p {
            font-size: 18px;
            color: brown;
            margin-bottom: 30px;
        }

        .logout-btn {
            background-color: brown;
            color: white;
            padding: 12px 30px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            text-decoration: none;
            display: inline-block;
            margin-top: 20px;
        }

        .logout-btn:hover {
            background-color: darkbrown;
        }
    </style>
</head>
<body>
    <div class="home-container">
        <div class="home-content">
            <h1>Welcome to Home Page</h1>
            <p>You are successfully logged in!</p>
            <p>Explore amazing features and content</p>
            <a href="logout.php" class="logout-btn" id="logoutLink">Logout</a>
        </div>
    </div>
    <script>
        // Clear local login flag on logout click so landing popup will reappear
        const logoutLink = document.getElementById('logoutLink');
        if (logoutLink) {
            logoutLink.addEventListener('click', function() {
                try { localStorage.setItem('userLoggedIn', 'false'); } catch(e) {}
            });
        }
    </script>
</body>
</html>
