<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Room Selection</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f9;
            margin: 0;
            padding: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        .form-container {
            background: white;
            padding: 25px;
            border-radius: 8px;
            box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
            width: 400px;
            text-align: center;
        }

        h2 {
            color: #333;
            margin-bottom: 20px;
        }

        form {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        label {
            font-weight: bold;
            display: block;
            margin-top: 10px;
            text-align: left;
            width: 100%;
        }

        input {
            width: 100%;
            padding: 10px;
            margin-top: 5px;
            border: 1px solid #ccc;
            border-radius: 5px;
        }

        button {
            width: 100%;
            padding: 12px;
            background-color: #007BFF;
            color: white;
            border: none;
            border-radius: 5px;
            margin-top: 15px;
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
            transition: background 0.3s;
        }

        button:hover {
            background-color: #0056b3;
        }

        .back-link {
            display: block;
            margin-top: 15px;
            font-size: 14px;
            color: #007BFF;
            text-decoration: none;
            font-weight: bold;
        }

        .back-link:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div class="form-container">
    <h2>Room Selection</h2>
    <form action="/apply-room" method="post">
        <input type="hidden" name="studentId" th:value="${studentId}">

        <label for="preferredRoom">Preferred Room:</label>
        <input type="text" id="preferredRoom" name="preferredRoom" required placeholder="101-A">

        <label for="roommateEmail">Roommate Email (Optional):</label>
        <input type="email" id="roommateEmail" name="roommateEmail" placeholder="example@domain.com">

        <button type="submit">Submit Room Request</button>
    </form>

    <a class="back-link" th:href="@{/upload-documents(studentId=${studentId})}">← Go Back</a>
</div>
</body>
</html>
