@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Raleway:ital,wght@0,300..800;1,300..800&display=swap');

:root{
    --primary: #CF2923;
    --primary-dark: #992722;
    --light-blue-gray: #F6F8FC;
    --light-gray: #757575;
    --dark-gray: #363131;
    --white: #FFF;
    --black: #000;
    --raleway: "Raleway", serif;
    --retro: "Press Start 2P", serif;
}

*{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 1 EM = 16 PX */

body{
    background-color: var(--light-blue-gray);
    padding: 16px;
    font-family: var(--raleway);
}

input, select, button, label{
    font-family: var(--raleway);
}

/* HEADER */

.header{
    margin: 0 auto;
    max-width: 1280px;
}

.nav{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav__pokedex{
    width: 48px;
    aspect-ratio: 1/1;
}

.nav__menu{
    width: 28px;
    aspect-ratio: 1/1;
    cursor: pointer;
}

.sidebar{
    width: 256px;
    background-color: #fff;
    position: fixed;
    z-index: 10;
    right: 0;
    top: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    transition: .5s ease-in-out right;
}

.sidebar.hidden{
    right: -80%;
}

.sidebar__close{
    width: 28px;
    height: 28px;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--light-blue-gray);
    position: absolute;
    right: 24px;
    cursor: pointer;
}

.sidebar__profile{
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile__avatar{
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.profile__content{
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.profile__role{
    font-weight: 500;
    font-size: 12px;
    line-height: 12px;
    letter-spacing: 0.4px;
    color: var(--light-gray);
}

.profile__user{
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
}

.sidebar__line{
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background-color: var(--light-blue-gray);
}

.sidebar__links{
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.links__title{
    font-weight: 500;
    font-size: 12px;
    line-height: 12px;
    letter-spacing: 0.4px;
    color: var(--light-gray);
    padding-left: 12px;
}

.links__list{
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    list-style: none;
}

.links__item{
    border-radius: 8px;
    transition: .3s ease-in-out background-color;
}

.links__anchor{
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -2%;
    text-decoration: none;
    color: var(--light-gray);
    cursor: pointer;
}

.links__icon--dropdown{
    rotate: 180deg;
    transition: .3s ease-in-out rotate;
}

.links__icon--dropdown.rotate{
    rotate: 0deg;
}

.links__item:hover{
    background-color: var(--light-blue-gray);
}

#dropdown-button.selected{
    background-color: var(--light-blue-gray);
}

.links__item--dropdown{
    border-left: 1px solid var(--light-gray);
    margin-left: 36px;
    overflow: hidden;
    transition: .3s ease-in-out height;
}

.links__item--dropdown.hidden{
    height: 0px;
}

.links__item--dropdown{
    height: 75px;
}

.links__dropdown{
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    list-style-type: none;
    padding-left: 16px;
}

.dropdown__item{
    padding: 8px 0;
}

.dropdown__item a{
    text-decoration: none;
    color: var(--light-gray);
    font-weight: 600;
    font-size: 14px;
    line-height: 16px;
    letter-spacing: -2%;
}

/* Hero */

.hero{
    max-width: 1280px;
    padding-top: 24px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.hero__img{
    width: 100%;
    max-width: 600px;
}

.hero__search{
    width: 100%;
    max-width: 500px;
    padding: 0 5px;
}

.hero__form{
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero__form .form__label{
    font-size: 18px;
    line-height: 12px;
    letter-spacing: 0.2%;
    color: var(--light-gray);
}

.form__wrapper{
    position: relative;
}

.form__input{
    width: 100%;
    height: 50px;
    background-color: #fff;
    border: 1px solid #000;
    outline: none;
    padding: 0 14px;
    border-radius: 8px;
    font-weight: 500;
    line-height: 16px;
    font-size: 16px;
}

.form__submit{
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    border: none;
    outline: none;
    border-radius: 8px;
    right: 0;
    cursor: pointer;
    transition: .3s ease-in-out background-color;
}

.form__submit img{
    width: 32px;
    height: 32px;
}

.form__submit:hover{
    background-color: var(--primary-dark);
}

/* Main Cards */

.main{
    margin: 0 auto;
    max-width: 1280px;
    padding-top: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.main:has(.main__wrapper.show){
    flex-direction: row;
}

#spinner.hidden{
    display: none;
}

.sk-chase {
    width: 40px;
    height: 40px;
    position: relative;
    animation: sk-chase 2.5s infinite linear both;
}
  
.sk-chase-dot {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0; 
    animation: sk-chase-dot 2.0s infinite ease-in-out both; 
}

.sk-chase-dot:before {
    content: '';
    display: block;
    width: 25%;
    height: 25%;
    background-color: var(--primary);
    border-radius: 100%;
    animation: sk-chase-dot-before 2.0s infinite ease-in-out both; 
}

.sk-chase-dot:nth-child(1) { animation-delay: -1.1s; }
.sk-chase-dot:nth-child(2) { animation-delay: -1.0s; }
.sk-chase-dot:nth-child(3) { animation-delay: -0.9s; }
.sk-chase-dot:nth-child(4) { animation-delay: -0.8s; }
.sk-chase-dot:nth-child(5) { animation-delay: -0.7s; }
.sk-chase-dot:nth-child(6) { animation-delay: -0.6s; }
.sk-chase-dot:nth-child(1):before { animation-delay: -1.1s; }
.sk-chase-dot:nth-child(2):before { animation-delay: -1.0s; }
.sk-chase-dot:nth-child(3):before { animation-delay: -0.9s; }
.sk-chase-dot:nth-child(4):before { animation-delay: -0.8s; }
.sk-chase-dot:nth-child(5):before { animation-delay: -0.7s; }
.sk-chase-dot:nth-child(6):before { animation-delay: -0.6s; }

@keyframes sk-chase {
    100% { transform: rotate(360deg); } 
}

@keyframes sk-chase-dot {
    80%, 100% { transform: rotate(360deg); } 
}

@keyframes sk-chase-dot-before {
    50% {
        transform: scale(0.4); 
    } 100%, 0% {
        transform: scale(1.0); 
    } 
}

.main__wrapper{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 32px;
    scale: 0;
    opacity: 0;
    transition: .5s ease-in-out opacity, .5s ease-in-out scale;
}

.main__wrapper.show{
    scale: 1;
    opacity: 1;
}

.main__card{
    width: 250px;
    border-radius: 20px;
    background-color: #fff;
    padding: 16px;
    padding-top: 8px;
    box-shadow: 0 21px 25.9px -14px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    position: relative;
    cursor: pointer;
    transition: .3s ease-in-out scale;
}

.main__card.hidden{
    display: none;
}

.main__card:hover{
    scale: 1.05;
}

.card__id{
    position: absolute;
    right: 16px;
    top: 16px;
    font-weight: bold;
    color: var(--dark-gray);
}

.card__img{
    width: 100px;
    aspect-ratio: 1/1;
}

.card__info{
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card__name{
    font-family: var(--retro);
    font-size: 18px;
    text-transform: capitalize;
    color: var(--dark-gray);
}

.card__types, .modal__types{
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.card__type, .modal__type{
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--dark-gray);
    border: 1px solid #000;
    border-radius: 50px;
    text-transform: capitalize;
}

.card__description{
    margin-top: 8px;
    font-size: 14px;
    color: var(--dark-gray);
    text-align: center;
}

/* Modal */

.modal{
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    bottom: 0;
    z-index: 20;
    border: none;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    display: none;
}

.modal[open]{
    display: flex;
}

.modal__close{
    position: fixed;
    z-index: 30;
    right: 16px;
    top: 16px;
    background-color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    border: none;
    outline: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: .3s ease-in-out scale;
}

.modal__close:hover{
    scale: 1.1;
}

.modal__card{
    width: 280px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    padding: 16px;
    position: relative;
}

.modal[open] .modal__card{
    animation: modalOpen 0.5s ease forwards;
}

.modal[open] .modal__card.closing {
    animation: modalClose 0.5s ease forwards;
}

@keyframes modalOpen {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalClose {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.modal__background{
    width: 100%;
    height: 180px;
    background-color: var(--primary);
    position: absolute;
    top: 0;
    left: 0;
}

.modal__content{
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal__pokemon{
    display: flex;
    flex-direction: column;
}

.modal__top{
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    padding-bottom: 10px;
}

.modal__top__pokemon{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.modal__name{
    font-family: var(--retro);
    font-size: 15px;
    text-transform: capitalize;
}

.modal__sound--pop{
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: .3s ease-in-out scale;
    border: 0;
    outline: 0;
}


.modal__sound--pop:hover{
    scale: 1.1;
}

.modal__sound{
    display: none;
}

.modal__id{
    font-family: var(--retro);
    font-size: 12px;
}

.modal__img{
    width: 150px;
    align-self: center;
    margin-bottom: 12px;
    aspect-ratio: 1/1;
    margin-top: 5px;
}

.modal__types{
    margin-top: 0px;
    margin-bottom: 12px;
}

.modal__subtitle{
    font-size: 14px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 2px;
}

.modal__description{
    font-size: 12px;
}

.modal__measures{
    margin: 8px 0 12px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
}

.modal__measure{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.measure__icon{
    width: 24px;
    height: 24px;
}

.measure__title{
    font-size: 10px;
    color: var(--light-gray);
    line-height: 12px;
}

.measure__number{
    font-size: 12px;
    color: var(--dark-gray);
    line-height: 14px;
}

.modal__stats{
    margin-top: 10px;
    display: flex;
}

.stats__names{
    display: flex;
    flex-direction: column;
    padding-right: 10px;
    border-right: 1px solid var(--light-gray);
}

.stats__names h6{
    font-size: 10px;
    line-height: 16px;
    color: var(--primary);
}

.stats__values{
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-left: 10px;
}

.stat__item{
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat__value{
    font-size: 10px;
    line-height: 16px;
}

.stat__progress{
    width: 100%;
    height: 8px;
    appearance: none;
    -webkit-appearance: none;
}

.stat__progress::-webkit-progress-bar {
    background-color: rgba(207, 41, 35, 0.2);
    border-radius: 4px;
}

.stat__progress::-webkit-progress-value {
    background-color: var(--primary);
    border-radius: 4px;
}

#audio{
    display: none;
}

/* Pagination */

.pagination{
    padding-top: 42px;
    padding-bottom: 16px;
    display: flex;
    justify-content: center;
}

.pagination__search{
    width: fit-content;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
}

.pagination__button{
    width: 32px;
    height: 32px;
    background-color: var(--primary);
    border: none;
    outline: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: .3s ease-in-out background-color;
}

.pagination__button:disabled{
    pointer-events: none;
    opacity: .5;
}

.pagination__button:hover{
    background-color: var(--primary-dark);
}

.pagination__form{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
}

.form__label{
    font-size: 14px;
    color: var(--dark-gray);
    font-weight: 600;
}

.form__select{
    width: 70px;
    height: 42px;
    padding: 0 15px;
    background-color: #fff;
    border: 1px solid #DDDDDD;
    outline: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    -webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background: url("../assets/svg/chevron-down-icon.svg") no-repeat center / contain;
	background-size: 16px;
	background-position: calc(100% - 15px);
    transition: .3s ease-in-out border;
}

.form__select:focus{
    border: 1px solid var(--dark-gray);
}

/* Media Queries */

@media screen and (min-width: 744px) {
    body{
        padding: 32px 40px;
    }

    /* NavBar */

    .nav__pokedex{
        width: 64px;
    }

    .nav__menu{
        width: 36px;
    }

    /* Hero */
    .hero__form .form__label{
        font-size: 20px;
    }

    .form__input{
        line-height: 18px;
        font-size: 18px;
    }

    /* Modal */
    .modal__close{
        right: 24px;
        top: 24px;
        width: 38px;
        height: 38px;
    }

    .modal__close img{
        width: 24px;
        height: 24px;
    }
    
    .modal__card{
        width: 350px;
        padding: 20px;
    }

    .modal__name{
        font-family: var(--retro);
        font-size: 18px;
    }

    .modal__id{
        font-size: 14px;
    }

    .modal__img{
        width: 164px;
    }

    .modal__type{
        font-size: 14px;
    }
    
    .modal__subtitle{
        font-size: 16px;
        margin-bottom: 4px;
    }

    .modal__description{
        font-size: 14px;
    }

    .measure__icon{
        width: 28px;
        height: 28px;
    }
    
    .measure__title{
        font-size: 12px;
    }
    
    .measure__number{
        font-size: 14px;
    }

    .stats__names{
        gap: 2px;
    }
    
    .stats__values{
        gap: 2px;
    }

    .stats__names h6{
        font-size: 12px;
    }
    
    .stat__value{
        font-size: 12px;
    }
    
    .stat__progress{
        height: 9px;
        appearance: none;
        -webkit-appearance: none;
    }
}

@media screen and (min-width: 912px) {
    /* Modal */    
    .modal__card{
        width: 650px;
        padding: 25px;
    }

    .modal__background{
        width: 50%;
        height: 100%;
        background-color: var(--primary);
        position: absolute;
        top: 0;
        left: 0;
    }
    
    .modal__content{
        position: relative;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal__pokemon{
        display: flex;
        flex-direction: column;
    }
    
    .modal__top{
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 16px;
    }
    
    .modal__top__pokemon{
        order: 1;
    }

    .modal__name{
        font-size: 24px;
    }
    
    .modal__sound--pop{
        display: none;
    }

    .modal__sound{
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: var(--primary);
        color: #fff;
        padding: 8px 16px;
        border-radius: 16px;
        border: none;
        outline: none;
        margin: 16px auto 0 auto;
        cursor: pointer;
        transition: .5s ease-in-out background-color;
    }

    .modal__sound:hover{
        background-color: var(--primary-dark);
    }
    
    .modal__id{
        font-size: 15px;
    }

    .modal__img{
        width: 250px;
        padding-bottom: 10px;
    }

    .modal__types{
        margin-bottom: 0px;
    }

    .modal__type{
        background-color: #fff;
        color: #000;
    }

    .modal__info{
        padding-left: 25px;
    }
    
    .modal__subtitle{
        font-size: 20px;
    }

    .modal__description{
        font-size: 16px;
    }

    .measure__icon{
        width: 36px;
        height: 36px;
    }

    .stats__names{
        gap: 4px;
    }
    
    .stats__values{
        gap: 4px;
    }

    .stats__names h6{
        font-size: 14px;
    }
    
    .stat__value{
        font-size: 14px;
    }
}