
<script setup lang="ts">
const { pb } = usePocketbase()

const sessionid = checkSession()
const session_data = await pb.collection("game_sessions").getOne(sessionid as string, {expand: 'movie_title'})
const movie_data = session_data.expand?.movie_title

</script>
<template>
    <div class="info-container">
        <h1>{{ movie_data?.title }}</h1>
        <div class="poster-content">
            <img class="poster" :src="movie_data.poster_url" alt="">
            <p>{{ movie_data.plot }}</p>
            <NuxtLink class="btn btn-primary" :to="'/gameroom?sessionid=' + sessionid">Aloita</NuxtLink>
        </div>
    </div>
</template>

<style scoped lang="scss">

* {
    font-family: DynaPuff, sans-serif;
}

.info-container {
    display: grid;
    grid-template-rows: auto 1fr;
    width: 100%;
    min-height: 100vh;
    padding: 1rem;
    justify-content: center;
    justify-items: center;
    align-items: center;
    place-items: center;

    > * {
        text-align: center;
    }

    h1 {
        text-align: center;
        text-shadow: 3px 3px 0.5rem hsl(0, 74%, 20%);
        margin-bottom: 1rem;
    }
    .poster-content {
        display: grid;
        grid-template-rows: auto 1fr auto;
        padding: 2rem;
        border: 1px solid hsl(0 74% 10% / 50%);
        border-bottom-color: hsl(0 74% 80% / 10%);
        border-radius: 2rem;
        background-image: linear-gradient(to bottom, hsl(0 74% 80%), hsl(0 74% 70%));
        box-shadow: inset 3px 3px 0.5rem hsl(0 74% 20%);
        height: 100%;
        
        img {
            max-width: 80%;
            border-radius: 1rem;
            box-shadow: 3px 3px 0.5rem hsl(0 74% 20%);
            margin: auto auto 1rem auto;
        }
        p {
            line-height: 1.5;
            font-size: 0.9rem;
            padding: 1rem;
            color: hsl(0, 74%, 20%);
        }    
    }
}
</style>
