@import url("/styles/vars.css");

.container {
    display: flex;
    width: clamp(100dvw, 2vw, 80dvw);
    justify-content: center;
    flex-direction: column;
    border-bottom-left-radius: .8rem;
    border-bottom-right-radius: .8rem;
}

.gameplay-container {
    margin: 1em 1.5em;
    display: grid;
    gap: 2em;
    justify-content: center;
    grid-template-columns: repeat(auto-fit, minmax(31em, 1fr));
}

.gameplay-container > .game-item {
    cursor: pointer;
    padding: 2em;
    min-width: 25rem;
    max-width: 100%;
    min-height: 200px;
    max-height: 600px;
    background-color: #1f2124b9;
    border: 1px solid rgba(167, 167, 167, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .5em;
    filter: none;
    backdrop-filter: blur(10px);
    transform-origin: bottom center;
    transform: none;
    gap: 1em;
    transition: transform .3s linear, filter .4s ease-in-out;
}

@media (hover) {
    .game-item:hover {
        transform-origin: bottom center;
        transform: scale(1.04);
    }

    .game-item:hover > .game-details > .game-title {
        color: #1875ff;
    }
}

.game-item > .image {
    height: 128px;
}

.game-item > .image > img {
    width: 8em;
    height: 8em;
    border-radius: .3em;
    -webkit-user-drag: none;
}

.game-details {
    display: flex;
    flex-direction: column;
    padding: .2em;
    width: 100%;
    overflow: hidden;
    word-wrap: break-word;
    font-family: "Inter";
}

@media screen and (max-width: 670px) {
    .gameplay-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        align-self: center;
        padding: 2em;
        width: 20rem;
        gap: 1rem;
    }

    .gameplay-container > .game-item {
        min-width: 100%;
        justify-self: center;
        align-self: center;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .game-details {
        width: fit-content;
        text-align: center;
        align-items: center;
    }

    .game-genres {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        width: max-content;
    }

    .genre {
        width: fit-content;
    }
}

.game-title {
    font-family: "Dosis", serif;
    font-weight: bold;
    font-size: 1.7em;
    width: 100%;
    max-width: 100%;
    display: block;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    transition: .25s ease;
}

.game-genres {
    display: flex;
    gap: .2rem;
    margin: .5em 0;
    flex-wrap: wrap;
}

.game-genres > .genre {
    padding: .2em .4em;
    background-color: var(--secondary-color);
    border-radius: .4rem;
    word-break: break-all;
    outline: 1px solid #565656;
}

.filter-container {
    font-family: "Inter";
    margin: 2em;
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 10px;
}

.custom-filter-dropdown {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.filter-dropdown-button {
    padding: 10px;
    max-height: min-content;
    background-color: var(--primary-color);
    border-radius: 30em;
    border: 2px solid var(--tertiary-color);
    margin-bottom: 20px;
}

.filter-dropdown-menu {
    display: none;
    position: fixed;
    background: var(--secondary-color);
    border: 1px solid #ccc;
    max-height: max-content;
    overflow-y: auto;
    right: 1em;
    z-index: 10;
    width: 300px;
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    border-radius: .8rem;
}

.filter-dropdown-menu.visible {
    display: flex;
}

.filter-item {
    padding: 8px 12px;
    background-color: var(--secondary-color);
    border-radius: 10px;
    border: 1px solid var(--tertiary-color);
    cursor: pointer;
    white-space: nowrap; 
}

.filter-item.disabled {
    color: gray;
    pointer-events: none;
}

.selected-filters {
    display: flex;
    gap: 10px;
    margin-right: auto;
    flex-wrap: wrap;
    margin-top: 10px;
}

.filter-tag {
    padding: 5px 10px;
    background-color: var(--secondary-color);
    border-radius: 15px;
    border: 1px solid var(--tertiary-color);
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.remove-filter {
    margin-left: 5px;
    font-weight: bold;
    font-size: 1.5em;
    cursor: pointer;
    background-color: var(--tertiary-color);
    width: min-content;
    height: min-content;
    margin: 0;
    padding: 0;
    border-radius: .3rem;
    transition: .3s background;
}

.remove-filter:hover {
    background-color: red;
}