* {
    text-decoration: none;
    font-family: Overpass, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
    color: inherit;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    width: 100%;
    font-size: 1.1rem;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
    line-height: 1.4;
    align-items: center;
}

.hidden {
    display: none !important;
}

:root {
    --bg: #09121b;
    --clear: #1a2232;
    --clearer: #2f3951;
    --grey: #9c978c;
    --text: white;
    --text-darker: #9cb5c9;
}

.loader {
    background-image: url(https://www.pokepedia.fr/images/9/93/Sprite_0285_PinRS.gif);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    image-rendering: crisp-edges;
    width: 100px;
    height: 100px;
    display: inline-block;
}

button {
    border: none;
    padding: 10px;
    border-radius: 5px;
    background-color: var(--clearer);

    &:enabled:hover {
        background-color: var(--grey);
    }

    &:disabled {
        background-color: var(--clear);
        cursor: not-allowed;
    }
}

/**************** BANNER ****************/

#banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    align-content: center;
    background-color: var(--bg);
    z-index: 10;

    & h1 {
        font-size: 4rem;
        margin: 10px;
    }

    & h2,h3 {
        color: var(--grey);
        font-style: italic;

        & a {
            color: var(--text-darker);
        }
    }
    & h3 {
        font-weight: normal;
    }

    & h4 {
        padding: 0 30%;
        font-size: 1.5rem;
        font-style: italic;
        color: var(--text-darker);
    }

    & button {
        font-size: 2rem;
        padding: 25px;
    }
}


/**************** FILTERS ****************/


.wrapper {
    width: 100%;
    margin: 0 auto;
    border-bottom: 1px solid var(--clearer);
    padding: 50px;
}

#search-toggle {
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 25px;
    display: flex;
    gap: 25px;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--clearer);
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;

    &:before {
        position: absolute;
        content: "";
        height: 26px;
        width: 26px;
        left: 4px;
        bottom: 4px;
        background-color: var(--text-darker);
        -webkit-transition: .4s;
        transition: .4s;
        border-radius: 50%;
    }
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

.filters {

    display: flex;
    gap: 20px 50px;
    align-items: center;
    flex-wrap: wrap;
    flex-direction: row;

    & > div {
        min-width: 380px;
        position: relative;
        cursor: pointer;
        font-size: 0.8rem;
        font-weight: 600;
        white-space: normal;
        letter-spacing: .03rem;
        color: var(--grey);
        transition: all .15s cubic-bezier(.07, .95, 0, 1);
    }
}

.search {
    & input {
        height: 40px;
        width: 100%;
        padding: 20px;
        background-color: var(--clear);
        border-radius: 6px;
        font-weight: bold;

        &:focus {
            background-color: var(--clearer);
        }

        border: none;
    }

    & input:focus + ul, & ul:hover {
        display: list-item;
    }

    & ul {
        display: none;
        max-height: 400px;
        overflow: scroll;
        padding: 0;
        position: absolute;
        width: 100%;
        border-radius: 15px;
        z-index: 2;
    }

    & li {
        border-bottom: 2px solid var(--clearer);
        background-color: var(--clear);
        padding: 12px;
        text-decoration: none;
        font-size: 18px;
        display: block;

        &:hover {
            background-color: var(--clearer);
        }
    }
}

.name {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 20px 0;
    color: #9cb5c9;
}

.custom-checkmark {
    display: block;
    position: relative;
    cursor: pointer;

    & input {
        display: none;

        &:checked ~ .checkmark {
            background-color: var(--clearer);

            &:after {
                display: block;
            }
        }

    }

    & > label {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;

        & p {
            margin: 0;
        }

        /*TODO replace with id*/

    }

    &:hover input ~ .checkmark {
        background-color: var(--clearer);
    }
}

#filter-dex input {
    & ~ p:after {
        content: "Searching with name only"
    }

    &:checked ~ p:after {
        content: "Searching with name and dex #";
    }
}

#filter-iframe {
    & ~ p:after {
        content: "Using previews (fast, but buggy)"
    }

    &:checked ~ p:after {
        content: "Using iframes (slow)";
    }
}

.checkmark {
    display: block;
    height: 30px;
    width: 30px;
    margin: 5px 0;
    border-radius: 6px;
    background-color: var(--clear);

    &:after {
        content: "";
        position: absolute;
        display: none;
    }
}


/* Style the checkmark/indicator */
.custom-checkmark .checkmark:after {
    position: relative;
    left: 9px;
    top: 3px;
    width: 8px;
    height: 15px;
    border: solid white;
    border-width: 0 4px 4px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}

/************* CARDS *************/
main {
    width: 100%;

    & > div {
        margin: 30px 0;
        width: 100%;
        font-weight: bold;
    }
}

#buttons {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 1.2rem;
    justify-content: center;
    margin-bottom: 30px;
}

#no-data {
    display: flex;
    align-items: center;
    font-size: 1.6rem;
    color: var(--text-darker);
    justify-content: center;
}

#cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    max-width: 1900px;
}

.card {
    height: 250px;
    width: 250px;
    margin: 10px;
    background-position: top;
    background-size: cover;
    background-repeat: no-repeat;
    border: 3px solid black;
    border-radius: 15px;
    position: relative;
    color: var(--text);

    & iframe {
        width: 100%;
        height: 100%;
        border: none;
    }

    & .footer {
        bottom: 0;
        position: absolute;
        background-color: var(--clear);
        padding: 10px;
        width: 100%;
        max-height: 100px;
        overflow: hidden;
    }

    &:hover .footer {
        background-color: var(--clearer);
    }
}

/******************** FOOTER ********************/
footer {
    position: fixed;
    bottom: 20px;
    text-align: center;
    z-index: 15;
    background-color: var(--clearer);
    padding: 10px 12px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    width: 250px;
    left: calc(50% - 125px);
}
