:root::-webkit-scrollbar {
    display: none;
}

:root {
    scrollbar-width: thin;
    -ms-overflow-style: none;
}

/* Min defaults */
@media (min-width: 1px) {
    #search-bar {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 10px;
    }

    #file-input,
    #search-input {
        width: auto;
        margin-right: 0;
    }

    #type-filters,
    #species-filters {
        gap: 10px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    #footer p {
        display: auto;
        text-align: center;
    }
}

/* Extra small devices (landscape phones, 280px and up) */
@media (min-width: 280px) {
    #search-bar {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 10px;
    }

    #type-filters,
    #species-filters {
        width: 90%;
        margin-left: 5%;
        grid-template-columns: repeat(2, 1fr);
    }

    #pokemon-container {
        width: 90%;
        margin-left: 5%;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    #search-bar {
        display: flex;
        gap: 0px;
    }

    #file-input,
    #paste-input {
        width: 15%;
        margin-right: 20px;
    }

    #search-input {
        width: 40%;
    }

    #type-filters,
    #species-filters {
        grid-template-columns: repeat(3, 1fr);
    }

    #footer p {
        display: flex;
        text-align: justify;
        justify-content: center;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {

    #type-filters,
    #species-filters {
        width: 80%;
        margin-left: 10%;
        grid-template-columns: repeat(4, 1fr);
    }

    #pokemon-container {
        width: 80%;
        margin-left: 10%;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {

    #type-filters,
    #species-filters {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* X-Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {

    #type-filters,
    #species-filters {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* XX-Large devices (large desktops, 1400px and up) */
@media (min-width: 1400px) {
    #type-filters {
        display: grid;
        flex-wrap: wrap;
        justify-content: center;
    }
}

body {
    font-family: 'Raleway', sans-serif;
    margin: 0;
    padding: 20px;

    background-color: #452a57;
}

h1 {
    text-align: center;
    color: #f5f5f5;
    font-family: 'Bitter', serif;
}

h1 img {
    max-height: 1.2em;
    vertical-align: bottom;
}

/* Search bar styles */
#search-bar {
    justify-content: center;
    margin-bottom: 20px;
}

#search-input,
#file-input,
#paste-input {
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Raleway', sans-serif;
    color: #f5f5f5;
    border: 0px;
    border-radius: 4px;
    background: linear-gradient(135deg, #7792bb, #362f5a);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    outline: none;
}

#file-input,
#paste-input {
    cursor: pointer;
}

input::file-selector-button {
    color: #f5f5f5;
    background: rgba(0, 0, 0, 0);
    border: 0px;
    border-right: 2px solid #452a57;
    padding-right: 0.5em;
    margin-right: 0.5em;
    cursor: pointer;
}

#search-input:focus {
    border-color: #6200ea;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#search-input::placeholder {
    color: #f5f5f5;
    opacity: 1;
}

#search-bar label {
    position: absolute;
    top: 0;
    left: 16px;
    font-size: 16px;
    color: #888;
    transition: all 0.3s ease;
}

#search-input:not(:placeholder-shown)+label,
#search-input:focus+label {
    top: -20px;
    left: 8px;
    font-size: 12px;
    color: #6200ea;
    background-color: #ffffff;
    padding: 0 4px;
}

/* Type filters styles */
#type-filters,
#species-filters {
    margin-bottom: 20px;
    vertical-align: middle;
}

#type-filters label,
#species-filters label {
    color: #f5f5f5;
    font-family: 'Raleway', sans-serif;
    text-align: center;
}

.type-sprite {
    max-height: 2em;
    vertical-align: middle;
    border-radius: 8px;
}

input.type-filter,
.species-filter,
.type-sprite {
    cursor: pointer;
}

/* Loader styles */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #452a57;
    /*
    background: rgb(29,15,38);
    background: linear-gradient(135deg, rgba(69,42,87,1) 0%, rgba(29,15,38,1) 100%);
    background-attachment: fixed;
    */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#page-loader {
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    border: 5px solid #7792bb;
    border-top: 5px solid #362f5a;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Modal styles */
h2#modal-name {
    font-family: 'Bitter', serif;
}

#modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    /* Center horizontally */
    align-items: center;
    /* Center vertically */
    z-index: 1000;
}

#modal-content {
    /*background: linear-gradient(135deg, #7792bb, #362244);*/
    background: linear-gradient(135deg, #362244 40%, #3f306a);
    border-radius: 8px;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    position: relative;
    /* To position close button absolutely */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #f5f5f5;
}

#modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    color: #ddd;
    cursor: pointer;
}

#modal-bg {
    pointer-events: none;
    position: absolute;
    height: 100%;
    z-index: 0;
    margin: -20px;
    mask-image: linear-gradient(135deg, rgba(0, 0, 0, 1) 30%, rgba(0, 0, 0, 0));
}

#modal-right-column {
    margin-left: 350px;
}

/* Pokemon container styles */
#pokemon-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.perspective-container {
    perspective: 800px;
    animation-fill-mode: forwards;
    /* Ensures the final state is retained */
}

.perspective-container:hover {
    z-index: 990;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pokemon {
    border-radius: 10px;
    margin: 10px;
    padding: 20px;
    height: 200px;
    width: 120px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #7792bb, #362f5a);
    background-image: url('../images/card-bg.png');
    background-image: url('../images/card-bg.png'), linear-gradient(135deg, #7792bb, #362f5a);
    background-size: cover;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Raleway', sans-serif;
    color: #f5f5f5;
    cursor: pointer;
}

.pokemon img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/*
.pokemon:hover {
    transform: scale(1.1);
}
*/
.pokemon h2 {
    margin: 0;
}

.pokemon h2 span {
    font-size: 16px;
    vertical-align: middle;
}

.pokemon.shiny {
    background: linear-gradient(135deg, #3669b6, #21165a);
    background-image: url('../images/card-bg.png');
    background-image: url('../images/card-bg.png'), linear-gradient(135deg, #3669b6, #21165a);
}

.pokemon.legendary {
    background: linear-gradient(135deg, #d0b854, #e85d00);
    background-image: url('../images/card-bg.png');
    background-image: url('../images/card-bg.png'), linear-gradient(135deg, #d0b854, #e85d00);
    ;
}

.pokemon.mythical {
    background: linear-gradient(135deg, rgba(119, 146, 187, 1) 0%, rgb(62, 168, 136) 50%, rgba(54, 47, 90, 1) 100%);
    background-image: url('../images/card-bg.png');
    background-image: url('../images/card-bg.png'), linear-gradient(135deg, rgba(119, 146, 187, 1) 0%, rgb(62, 168, 136) 50%, rgba(54, 47, 90, 1) 100%);
}

.pokemon.error {
    opacity: 0.3;
    cursor: default;
}

.pokemon p {
    margin: 10px 0 0;
}

/* Cardify */
.card {
    box-shadow: 0 1px 5px #00000099;

    position: relative;

    transition-duration: 300ms;
    transition-property: transform, box-shadow;
    transition-timing-function: ease-out;
    transform: rotate3d(0);
    z-index: 1000;

    &:hover {
        z-index: 15000;
        transition-duration: 150ms;
        /*box-shadow: 0 5px 20px 5px #00000044;*/
        box-shadow: 0px 8px 20px 5px #00000099;
    }
}

.card .glow {
    border-radius: 10px;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;

    background-image: radial-gradient(circle at 50% -20%, #ffffff22, #0000000f);
}

.card .glow-border {
    border-radius: 10px;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;

    mask: url(../images/card-bg-alpha.png);
    mask-mode: luminance;
    mask-composite: add;
}

.card .shadow {
    border-radius: 10px;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;

    background: rgba(0, 0, 0, 0);
}

/* Footer */
#footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    color: #f5f5f5;
    margin: 20px 0 0;
}

#footer p {
    width: 100%;
    margin: 5px 0 0;
}

#footer a {
    margin-left: 0.3em;
    margin-right: 0.3em;
    color: #d0b854;
    text-decoration: none;

    &:hover {
        color: #e85d00;
    }
}