* {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}
body {
    background-color: #121212;
    background-image: url("../img/bg.jpeg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    line-height: 1.5;  
    position:relative;
    font-family: 'Montserrat', sans-serif;
}
body::before {
    display: block;
    height: 100%;
    content: "";
    position: absolute;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px;
    background-color: rgba(0, 0, 0, 0.8);
    min-height: 100vh;
}
#content {
    position: relative;
    animation-name: move-up;
    animation-duration: 3s;
    animation-delay: -1.5s;
}
h1 {
    font-size: 2.8rem;
    color: rgb(255,203,5);
    text-align: center;
    padding: 3rem 0 0.7rem 0;
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 0.3rem 0.3rem rgb(42,117,187);
    animation: h1-animation 3s;
    animation-timing-function: ease-out;
}
#main-1, #adv-search, #main-2 {
    margin: 3% 2%
}
#main-1 {
    display: flex;
    justify-content: center;
}

/*----------------MAIN 1: SEARCH OPTION------------*/
form {
    position: relative;
    background-color: #1d1c1b;
    width: 40vw;
    min-width: fit-content;
    height:fit-content;
    display: flex;
    justify-content: center;
    padding: 10px;
    border-radius: 2em;
    border: 1px solid rgb(169, 164, 164);
}
input::placeholder {
    text-align: center;
}
#text-form {
    width: 30vw;
    font-size: 1.1rem;
    background-color: #1d1c1b;
    font-style: italic;
    border-style: hidden;
    color: antiquewhite;
}
#text-form:focus {
    outline: none;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:active,
input:-webkit-autofill:focus {
    box-shadow: 0 0 0 1000px  #1d1c1b inset;
    -webkit-text-fill-color: antiquewhite;
}  
.submit {
    cursor: pointer;
    border: none;
    background-color: transparent; 
}
#icon {
    font-size: 20px;
    position: absolute;
    top: 10px;
    right: 10px;
}
/*----------------------ADVANCED SEARCH-----------------------*/
#adv-search {
    margin-bottom: 1.5rem;
}
#adv-search-title {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
h2 {
    cursor: pointer;
    font-size: 1.2rem;
    margin: 0 5px;
    padding: 10px 10px 0 0;
}
label {
    margin-right: 10px;
}
fieldset {
    display: none;
    flex-wrap: wrap;
    justify-content: space-between;
    font-size: 1rem;
}
fieldset.show {
    display: flex;
}
#adv-submit, select, option, .select-ability-text, .options-ability, #reset {
    padding: 0;
    font-size: 1rem;
    width: 100px;
    background-color: #1d1c1b;
}
.filter {
    margin: 20px;
}
#adv-submit, #reset {
    cursor: pointer;
    margin-left: 10px;
    border-radius: 1em;
    background-color: #1d1c1b;
    box-shadow: 0.2rem 0.2rem 0.2rem rgba(255, 255, 255, 0.6)
}
.options-ability.show{
    display: block;
}
.options-ability {
    height: 150px;
    min-width: fit-content;
    overflow-y: scroll;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgb(210, 207, 207);
}
li {
    list-style: none;
    color: black;
    padding-left: 10%;
}
.select-ability-text{
    border: 1px solid gray;
}
#ability-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}
#filter-ability {
    position: relative;
}
#arrow {
    margin-top: 10px;
    font-size: 25px;
}

/*---------------MAIN 2: SAMPLE OF POKEMON----------*/
#main-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill,170px);
    justify-content: space-evenly;
    column-gap: 20px;
    row-gap: 20px;
    margin-bottom: 0;
    padding-bottom: 50px;
}
.pokemon-card {
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    box-shadow: 0rem 0.3rem 0.5rem rgba(255, 255, 255, 0.6);
    text-align: center;
    cursor: pointer;
    height: 200px;
}
.pokemon-img-container {
    margin: 2rem 0 0 0;
    max-height: 80%;
}
.pokemon-image {
    max-width: 90%;
}
.pokemon-name {
    position: absolute;
    left: 0;
    right: 0;
    top: 160px;
    text-transform: capitalize;
    text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.7);
    line-height: 1;
    font-size: 16px;
}

/*----------------------MODAL-----------------------*/
.modal-container {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0px;
    left: 0px;
    height: 100vh;
    width: 100vw;
    opacity: 0;
    pointer-events: none;
    background-color: rgba(45, 30, 98, 0.5);
}
.modal-container.show {
    opacity: 1;
    pointer-events: visible;
}
.modal {
    background-color: rgba(45, 30, 98);
    position: relative;
    width: 50%;
    height: 50%;
    text-align: center;
    border: 2px solid #10072c;
    box-shadow: 0px 10px 10px rgba(255, 255, 255, 0.6);
}
.close {
    color:rgba(45, 30, 98);
    position: absolute;
    top: 0px;
    right: 0px;
    font-weight: 900;
    font-size: 1rem;
    cursor: pointer;
}
.modal-name {
    text-transform: uppercase;
    background-color: #10072c;
    padding: 10px 60px 10px 10px;
    text-align: right;
    font-size: 1.3rem;
    text-shadow: 0px 0px 1px rgba(255, 255, 255, 0.7);
}
#modal-mtp-img {
    position: absolute;
    top: 18%;
    right: 15%;
    height: 150px;
    width: 150px;
    transition: opacity 1s;
}
.modal-image {
    position: absolute;
    top: 0;
    right: 0;
    height: 150px;
    width: 150px;
}
#modal-img1 {
    opacity: 1;
    animation: go, show, hide;
    animation-duration: 1s, 1s, 1s;
    animation-delay: 0s, 1s, 2s;
    transform: scale(1.5)
}
#modal-img2 {
    opacity: 0;
    animation: hide, show;
    animation-duration: 2s, 1s;
    animation-delay: 0s, 2s;
    transform: scale(1.5)
}
.modal-text {
    position: absolute;
    width: 100%;
    bottom: 5%;
    text-transform: capitalize;
    font-size: 1.2rem;
    display: grid;
    grid-template-columns: 30% 70%;
    justify-content: space-between;
    text-align: left;
    row-gap: 0.5rem;
}
.left {
    padding-left: 1rem;
    font-weight: bolder;
}
.modal-no-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bolder;
    background-color: #10072c;
    padding: 20px;
}

/*------------------LOADER---------------------*/
#loader-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0px;
    left: 0px;
    height: 100vh;
    width: 100vw;
    background-color: rgb(9, 8, 13);
}
#loader-container.hide {
    display: none;
}
#content {
    visibility: visible;
    opacity: 1;
}
#content.hide {
    visibility: hidden;
    opacity: 0
}
#loader-container, #loader-container.hide, #content, #content.hide {
    transition: opacity 1s;
}
#loader {
    border: 8px solid lightgray;
    border-top: 8px solid gray;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spinning-loader 1s linear infinite;
}

/*------------------ANIMATION--------------------*/
@keyframes shaking {
    0%{
        transform: translate(3px, -5px);
        background-color: rgba(255, 255, 0, 0.2);
    }
    20%{
        transform: translate(-3px, -4px);
        background-color: rgba(255, 255, 0, 0.4);
    }
    40%{
        transform: translate(2px,-3px);
        background-color: rgba(255, 255, 0, 0.6);
    }
    60%{
        transform: translate(-2px,-2px);
        background-color: rgba(255, 255, 0, 0.8);
    }
    80%{
        transform: translate(1px,-1px);
        background-color: rgba(255, 255, 0, 0.6);
    }
    100%{
        transform: translate(-1px,0px);
        background-color: rgba(255, 255, 0, 0.3);
    }
}

@keyframes spinning-loader {
    0%{
        transform: rotate(0deg)
    }
    100%{
        transform: rotate(360deg)
    }
}
@keyframes h1-animation {
    0% {
        transform: scale(1);
        translate: 0 -150px 0;
    }
    50% {
        transform: scale(2);
        translate: 0 0px 150px;
    }
    100% {
        transform: scale(1);
    }
}
@keyframes move-up {
    0% {
        translate: 0 4000px 0;
    }
    100% {
        translate: 0 0 0;
    }
}
@keyframes go {
    0% {
        transform: rotate3d(0,1,0,180deg) scale(0.75);
        translate: -300px 0 0;
    }
    50% {
        translate: 0 0 0;
    }
    60% {
        transform: rotate3d(0,1,0,200deg);
    }
    80% {
        transform: rotate3d(0,1,0,300deg);
    }
    90% {
        transform: rotate3d(0,1,0,360deg);
    }
    100% {
        transform: scale(1.25)
    }
}
@keyframes show{
    0%{
        opacity: 1; 
    }
    100%{
        opacity: 1; 
        transform: scale(1.5)
    }
}
@keyframes hide {
    0%{
        opacity: 0;   
    }
    100%{
        opacity: 0;   
    }
}

/*-------------------MEDIA QUERY------------------*/
@media screen and (max-width: 600px) {
    html {
        font-size: 14px;
    }
    body {
        line-height: 1.2;
    }
    form {
        width: 60vw;
    }
    #text-form {
        width: 50vw;
    }
    .modal {
        width: 90%;
    }
    .select-ability-text{
        border-radius: 1rem;
    }
}
@media (hover: hover) {
    ion-icon:hover {
        color: rgba(255, 222, 0, 0.7);
    }
    .pokemon-card:hover {
        animation: shaking 1s;
        border: 2px solid rgba(255, 222, 0, 0.7);
        box-shadow: 0rem 0.3rem 0.3rem rgba(255, 222, 0, 0.7);
    }
    #adv-search-title:hover .change-color {
        color:rgba(255, 222, 0, 0.7);
        box-shadow: 0rem 0.3rem 0.4rem rgba(255, 222, 0, 0.7);
    }
}
@media screen and (max-height: 600px) {
    .modal {
        width: 90%;
        height: 90%;
    }
}