*, *::before, *::after {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Oswald', sans-serif;
    color: white;
    background-color: rgb(28, 28, 28);
}

/*===================Header===================*/
.header {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 20px 0;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 1;
    background-color: rgb(28, 28, 28);
}

.logo {
    height: 100px;
    margin-top: 10px;
    padding-bottom: 10px;
}

#search-input {
    padding: 10px 10px 10px 30px;
    border-radius: 5px;
    border: 1px solid grey;
    outline: none;
    font-size: 1rem;
    background-color: rgb(28, 28, 28);
    color: grey;
    background-image: url("../img/search.png");
    background-repeat: no-repeat;
    background-position: 5px center;
    background-size: 20px 20px;
    cursor: pointer;
}

.input-section {
    position: relative;
    display: inline-block;
}

#search-input {
    padding-right: 20px;
}

#reset-search {
    display: none;
}

.reset-btn {
    border: none;
    font-size: 1rem;
    border-radius: 50px;
    border: 1px solid black;
    cursor: pointer;
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
}

/*===================Dropdown===================*/
.dropdown-section {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 110px;
    left: 0;
    z-index: 2;
    background-color: rgb(28, 28, 28);
    margin-bottom: 30px;
}

.dropdown-btn {
    background-color: rgb(28, 28, 28);
    color: grey;
    padding: 16px;
    font-size: 16px;
    border-radius: 10px;
    border: 1px solid grey;
    margin: 10px auto;
    cursor: pointer;
}

.dropdown-btn:active {
    transform: scale(0.99);
}

.dropdown-content {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
    max-width: 60%;
    margin: 0 auto;
    padding: 20px 0;
    display: none;
}

.dropdown-section.show .dropdown-content {
    display: grid;
}

/*===================Poke Types===================*/
.all_select {
    background-color: rgb(36, 36, 36);
}

.select_type {
    display: flex;
    justify-content: center;
    position: relative;
    border: 1px solid rgb(28, 28, 28);
    border-radius: 10px;
    cursor: pointer;
    font-size: .75rem;
    font-weight: bold;
    padding: 8px 5px;
    text-shadow: 1px 1px 1px #333;
    gap: 5px;
    width: 70px;
}

.select_type:hover,
.select_type:active,
.select_type:focus {
    border: 1px solid white;
}

.select_type:active {
    transform: scale(0.95);
}

.select_type img {
    width: 15px;
    height: 15px;
}

/*===================Pokedex===================*/
#pokedex {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 0 8px;
}

/*===================Pokemon card===================*/
.pokemon-card {
    position: relative;
    width: calc((100% - 16px) / 2);
    max-width: 250px;
    height: 150px;
    border-radius: 20px;
    border: 1px solid white;
    cursor: pointer;
    transition: all 0.5s ease-in-out;
    /* flex-grow: 0; */
}

.poke-name {
    margin: 0;
    display: flex;
    font-size: 18px;
    position: relative;
}

.poke-ball::before {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2;
    background-image: url(../img/pokeball-bg.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.pokemon-card:hover .poke-ball::before {
    animation-name: rotate;
    animation-duration: 6s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-delay: 125ms;
}

.pokemon-card:hover {
    transform: scale(0.99);
}

/*===================Animation===================*/
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/*===================^^^^^^^^^^==================*/

.poke-id {
    display: flex;
    justify-content: flex-end;
}

.poke-id p {
    margin: 0;
    padding-right: 23px;
    padding-top: 10px;
    position: relative;
    font-size: .875rem;
}

.pokemon-card_secondary {
    display: flex;
    justify-content: space-evenly;
}

.pokemon-card_details {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    margin-top: -15px;
    margin-left: 10px;
    gap: 10px;
}

.poke-image {
    display: flex;
    width: 110px;
    height: 110px;
    position: relative;
}

.poke-type {
    display: flex;
    flex-direction: column;
    gap: 5px;
    letter-spacing: 1px;
    position: relative;
    margin-bottom: 15px;
}

/*===================Arrow===================*/
.arrow {
    height: 45px;
    width: 45px;
    object-fit: cover;
    border-radius: 50%;
    padding: 10px;
    background-color: white;
    box-shadow: 5px 5px 18px 1px rgba(0, 0, 0, 0.5);
}

.href {
    position: sticky;
    left: 85%;
    bottom: 60px;
    transition: all .5s;
    z-index: 4;
}

.hide {
    opacity: 0;
}

.show {
    opacity: 1;
}

/*===================Responsive Menu===================*/
#menu-container {
    display: none;
}

#menu-items {
    position: absolute;
    /* display: flex;
    flex-direction: column; */
    bottom: -12px;
    right: 3em;
    padding: 10px;
    z-index: 2;
    display: none;
}

#menu-items span {
    display: block;
    white-space: nowrap;
    text-align: center;
    margin-bottom: 10px;
    border: 1px solid rgb(255, 255, 255);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: lighter;
    letter-spacing: 1px;
    padding: 4px 6px;
    background-color: rgb(36, 36, 36);
    color: white;
    text-decoration: none;
}

.toggle-button {
    position: relative;
    left: -6%;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    z-index: 2;
    cursor: pointer;
    border: none;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/*===================Pokemon card===================*/
#background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    z-index: 4;
    backdrop-filter: blur(4px);
    /* pointer-events: none; */
}

#pokemon-details {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 650px;
    width: 450px;
    display: none;
    border-radius: 25px;
    border: solid 1px white;
    z-index: 4;
    flex-direction: column;
}

.pokemon-ball::before {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    background-image: url(../img/pokeball-bg.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    z-index: -1;
    animation-name: rotate;
    animation-duration: 6s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-delay: 125ms;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 30px;
}

.card-top__x-mark {
    width: 20px;
    height: 20px;
    z-index: 2;
    color: white;
    cursor: pointer;
}

.card-top__heart {
    height: 35px;
    width: 35px;
    cursor: pointer;
    z-index: 2;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 5px 30px;
}

.card-name {
    margin: 0;
}

.card-id {
    font-size: 1.5rem;
    margin: 0;
}

.pokemon-type {
    display: flex;
    justify-content: flex-start;
    gap: 5px;
    margin: 0 30px;
    letter-spacing: 1px;
}

.card-image {
    display: flex;
    margin: 0 auto;
    width: 200px;
    height: 200px;
    position: relative;
}

.evolution-image {
    display: flex;
    margin: 0 auto;
    width: 80px;
    height: 80px;
}

.card-image-container {
    position: relative;
    text-align: center;
    z-index: 4;
}

.card-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    width: 40px;
    cursor: pointer;
    margin: 0 12px;
}

#previous-arrow {
    left: 0;
}

#next-arrow {
    right: 0;
}

.info-container {
    background-color: rgb(28, 28, 28);
    border-radius: 25px;
    margin-top: -30px;
    padding: 0px 10px 10px 10px;
    border-right: solid 1px white;
    border-left: solid 1px white;
    border-bottom: solid 1px white;
    /* height: 100%; */
    /* overflow-y: scroll; */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.info-container::-webkit-scrollbar {
    width: 8px;
}

.info-container::-webkit-scrollbar-track {
    background: transparent;
}

.info-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.info-container::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.info-container__top {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    position: sticky;
    top: 0;
    background-color: rgb(28, 28, 28);
}

.moves-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.moves {
    width: calc(25% - 10px);
    margin: 4px;
    padding: 8px 1px;
    font-size: 13px;
    background-color: #2b2b2b;
    border-radius: 10px;
    text-align: center;
}

.info-container__section {
    position: relative;
    cursor: pointer;
    padding-bottom: 12px;
}

.info-container__section::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 4px;
    background-color: rgb(106, 61, 255);
    transition: width 0.3s ease;
}

.info-container__section.active::before {
    width: 100%;
}

.genera {
    display: flex;
    justify-content: space-between;
}

h4 {
    margin: 0;
    margin-right: 30px;
}

.d-none {
    display: none !important;
}

.stats {
    margin: 20px 15px;
}

.gray {
    color: rgb(97, 97, 97);
    width: 20%;
}

.add-info {
    display: flex;
    margin-bottom: 8px;
}

.abilities {
    display: flex;
}

.abilities-title {
    color: rgb(97, 97, 97);
    width: 20%;
}

.ability {
    margin-right: 5px;
}

.flavor p {
    margin: 30px auto;
}

.stat-bar {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.stat-name {
    color: rgb(97, 97, 97);
    width: 30%;
}

.stat-bar-inner {
    height: 20px;
}

.orange-margin {
    margin-left: 8px;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    z-index: 4;
}

.stat-bar-inner:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.stat-value {
    width: 10%;
    margin-left: 8px;
}

#evolution-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.evolution {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    font-size: 1.25rem;
}

.evolution-header {
    text-align: center;
}

.evolution-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.evolution-arrow {
    font-size: 1.5rem;
}

footer {
    display: flex;
    justify-content: center;
    background-color: rgb(28, 28, 28);
    color: white;
    padding: 10px;
    border-top: 1px solid white;
    opacity: 0.2;
    font-size: 0.75rem;
}

footer a {
    color: white;
    text-decoration: none;
    margin-right: 5px;
}

/*===================Media Queries===================*/
@media (max-width: 768px) {
    .logo {
        height: 75px;
    }

    .dropdown-section {
        top: 84px;
    }
}


@media (max-width: 500px) {
    .pokemon-card {
        width: calc((100% - 18px) / 2);
    }

    .logo {
        display: none;
    }

    #search-input {
        margin: 10px;
        width: 100%;
    }

    .reset-btn {
        right: 15px;
    }

    .input-section {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .dropdown-btn {
        display: none;
    }

    .select_type {
        width: 100%;
        align-items: center;
    }

    .dropdown-content {
        grid-template-columns: 1fr;
        width: 100vw;
        height: 80vh;
        overflow-y: scroll;
        overflow-x: hidden;
        gap: 5px;
    }

    .dropdown-section {
        margin-bottom: 0;
    }

    #menu-container {
        display: block;
        position: fixed;
        bottom: 120px;
        left: 85%;
        z-index: 1;
    }

    #pokemon-details {
        position: fixed;
        transform: translate(-50%, -50%);
        height: 100%;
        width: 100%;
        border-radius: 0;
        border: none;
        z-index: 4;
        flex-direction: column;
    }

    .pokemon-ball::before {
        width: 70%;
        height: 100%;
        top: -20%;
        left: 15%;
    }

    .info-container {
        height: 100%;
        width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border: none;
        overflow-y: scroll;
    }

    .card-image {
        width: 200px;
        height: 200px;
    }

    .stat-bar {
        margin-bottom: 15px;
    }
}


@media (max-width:450px) {
    .poke-name {
        font-size: 16px;
        margin-top: -15px;
    }

    .poke-image {
        width: 90px;
        height: 90px;
    }

    .pokemon-card_details {
        margin-top: 0;
    }

    .pokemon-card {
        height: 120px;
    }

    .poke-id p {
        font-size: 12px;
    }
}


@media (max-width:395px) {
    .poke-image {
        width: 80px;
        height: 80px;
    }
}


@media (max-width:350px) {
    .poke-image {
        width: 70px;
        height: 70px;
    }
}