<!DOCTYPE html>
<html>

<head>
    <title>MovieWeb</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f5f5f5;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-image: url('/cinema');
            background-size: cover;
            background-position: 0 40%;
        }

        h1 {
            font-size: 36px;
            color: #333333;
            margin-bottom: 20px;
            /* Agregamos margen inferior para separar del input */
        }

        form {
            text-align: center;
        }

        input[type="text"] {
            padding: 10px;
            width: 300px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 18px;
            margin-right: 10px;
        }

        button[type="submit"],
        button {
            background-color: #0078d4;
            color: white;
            border: none;
            border-radius: 4px;
            padding: 10px 20px;
            font-size: 18px;
            cursor: pointer;
        }

        button[type="submit"]:hover,
        button:hover {
            background-color: #0056b3;
        }

        #usuario {
            width: 7vw;
            aspect-ratio: 1 / 1;
            height: auto;
            display: flex;
            position: absolute;
            top: 1%;
            right: 1%;
            background-color: white;
            border-radius: 100%;
            outline: .5vw solid black;
            text-align: center;
            justify-content: center;
            align-items: center;
            text-decoration: none;
            color: black;
        }
    </style>
</head>

<body>
    <a href="/" id="usuario"></a>
    <h1>MovieWeb</h1>
    <form action="/buscar" method="GET">
        <input type="text" name="q" placeholder="Buscar pelÃ­culas o personas..." />
        <button type="submit">Buscar</button>
    </form>
    <button onclick="window.location.href = '/keyword'" style="margin-top: 3vh;">Buscar por palabras clave</button>
    <button onclick="window.location.href = '/watchlist'" style="margin-top: 3vh;">Lista de reproduccion</button>
    <script>
        const usuario = document.getElementById("usuario");
        usuario.textContent = localStorage.getItem("userName");
    </script>
</body>

</html>