body {
  font-family: sans-serif;
  min-width: 350px;
}

body, h1, h2, h3, h4, p {
  margin: 0;
  padding: 0;
}

button {
  all: unset;
}

* {
  box-sizing: border-box;
}


/* MAIN */ 

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

main {
  max-width: 1000px;
  font-size: 20px;
  padding: 30px;
}

.page-title {
  margin: 0 0 20px;
  font-size: 1.75em;
}

.page-title img {
  width: 250px;
  vertical-align: bottom;
}

/* SEARCH POCKEMON INPUT */

.search-pokemon-container {
  border-radius: 5px;
  display: flex;
  justify-content: space-between;
  color: white;
  background-color: #313131;
  padding: 30px 60px;
  align-items: start;
  gap: 50px;
}

.search-pokemon > label {
  font-size: 1.5em;
  display: inline-block;
  margin: 0 0 10px;
}

.search-pokemon {
  flex: 1;
}

.search-hint{
  flex: 1;
}

.search-input {
  display: flex;
  gap: 20px;
}

.search-input > input {
  font-size: 1.25em;
  padding: 7.5px 7.5px 9px 7.5px;
  border-radius: 5px;
  border: 3px solid #616161;
  width: 100%;
}

.search-input > button {
  background-color: #ee6b2f;
  border: none;
  color: white;
  padding: 8px 20px;
  border-radius: 5px;
  transition: background-color 0.15s;
}

.search-icon {
  display: block;
  font-size: 1.5em;
  font-variation-settings: 'FILL' 0, 'wght' 550, 'GRAD' 0, 'opsz' 24;
}

.search-pokemon > p {
  margin: 10px 0 0;
}

.search-hint {
  background-color: #4dad5b;
  padding: 15px 20px;
  border-radius: 5px;
}


/* POKEMON CONTAINER */

.sprite-name {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 35px 0 0;
}

.pokemon-sprite {
  width: 75px;
}


/* POKEMON INFO AND IMAGE */

.pokemon-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
  padding: 12px;
}

.image-stats > img {
  width: 100%;
  background-color: #efefef;
  display: block;
  border-radius: 5px;
  margin: 0 0 17px;
}

/* STATS */

.pokemon-stats {
  background-color: #a4a4a4;
  border-radius: 10px;
  padding: 20px;
  color: white;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
}

.pokemon-stats > div {
  margin-bottom: 12px;
}

.pokemon-stats > div > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 5px;
}

.pokemon-stats img {
  width: 35px;
}

.pokemon-stats > div > div:last-child {
  display: flex;
}

.bar-container > div:last-child {
  flex: 1;
  background-color: rgb(117, 117, 117);
}

.bar-container > div:first-child {
  height: 15px;
  border: 2px solid black;
}

/* STATS COLORS */

.hp-bar {
  background-color: #FF5959;
}

.attack-bar {
  background-color: #F5AC78;
}

.defense-bar {
  background-color: #FAE078;
}

.sp-atk-bar {
  background-color: #9DB7F5;
}

.sp-def-bar {
  background-color: #A7DB8D;
}

.speed-bar {
  background-color: #FA92B2;
}


/* MORE INFO */

.summary-1, .summary-2 {
  margin: 10px 0 20px;
}

.summary-versions {
  display: flex;
  align-items: center;
  margin: 0 0 35px;
}

.summary-versions button {
  display: flex;
}

.summary-versions p {
  margin: 0 5px 0 0;
}

.summary-versions img {
  width: 35px;
}

.summary-versions button {
  margin: 0 5px;
}

/* POKEBALLS */

.summary-option-1-btn {
  position: relative;
}

.pokeball {
  position: absolute;
  left: 0;
  opacity: 0;
}

.summary-option-2-btn {
  position: relative;
}

.superball {
  position: absolute;
  left: 0;
  opacity: 0;
}

.active-pokeball {
  opacity: 1;
}

.hidden-pokeball-bw {
  opacity: 0;
}

/* POKEMON DETAILS */

.pokemon-details-container {
  position: relative;
}

.pokemon-ability-info {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background-color: #313131;
  color: white;
  display: none;
}

.pokemon-ability-info > p:first-child {
  margin: 15px 15px 0 25px;
  color: #616161;
} 

.ability-close-icon-btn {
  font-size: 1.25em;
  position: absolute;
  top: 5px;
  right: 5px;
}

.ability-close-icon {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 1.25em;
}

.ability-name {
  margin: 15px 15px 0 25px;
}

.ability-summary {
  margin: 15px 15px 0 25px;
  color: #F2F2F2;
}

.pokemon-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 20px 20px 5px 20px;
  background-color: #30a7d7;
  border-radius: 10px;
  gap: 25px;
}

.pokemon-details h3 {
  color: #fff;
  font-weight: normal;
  font-size: 1em;
}

.first-info-section > p, .second-info-section > p, .gender-types {
  margin: 10px 0 15px;
}

.gender-types span {
  font-size: 1.5em;
}

.more-info > h3 {
  font-size: 1em;
  margin: 35px 0 20px;
}

.abilities-container {
  margin: 10px 0 15px;
}

.abilities-container > div {
  display: flex;
  align-items: center;
  margin: 10px 0;
  gap: 5px;
  white-space: nowrap;
}

.ability-info-icon, .hidden-ability-info-icon {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  color: #fff;
}

.types-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 7px;
}

.types-container img {
  width: 35px;
}

.types-container > div {
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: center;
  padding: 5px 12px 5px 5px;
  border-radius: 30px;
  width: 100%;
}

/* TYPES */
/* STELLAR AND ??? ARE MISSING*/

.normal-type {
  background-color: #9099a1;
}

.fire-type {
  background-color: #ff9c54;
}

.fighting-type {
  background-color: #ce4069;
  color: #fff;
}

.water-type {
  background-color: #4d90d5;
  color: #fff;
}

.flying-type {
  background-color: #8fa8dd;
}

.grass-type {
  background-color: #63bb5b;
}

.poison-type {
  background-color: #ab6ac8;
}

.electric-type {
  background-color: #f3d23b;
}

.ground-type {
  background-color: #d97746;
}

.psychic-type {
  background-color: #f97176;
  color: #fff;
}

.rock-type {
  background-color: #c7b78b;
}

.ice-type {
  background-color: #74cec0;
}

.bug-type {
  background-color: #90c12c;
}

.dragon-type {
  background-color: #0a6dc4;
  color: #fff;
}

.ghost-type {
  background-color: #5269ac;
  color: #fff;
}

.dark-type {
  background-color: #5a5366;
  color: #fff;
}

.steel-type {
  background-color: #5a8ea1;
}

.fairy-type {
  background-color: #ec8fe6;
}


/* LOADING */

.loading-container, .details-loading-container {
  display: none;
  align-items: center;
}

.loading-container img, .details-loading-container img {
  width: 30px;
  margin: 0 0 3px;
}


/* HOVER CAPABLE DEVICES */

@media screen and (hover: hover) {
/* SEARCH POCKEMON INPUT */
  .search-input > button:hover {
    cursor: pointer;
    background-color: #da471b;
  }

/* POKEBALLS */
  .pokeball:hover, .superball:hover {
    opacity: 1;
    cursor: pointer;
  }
  
  .pokeball-bw:has(~ .pokeball:hover) {
    opacity: 0;
  }

  .superball-bw:has(~ .superball:hover) {
    opacity: 0;
  } 

/* POKEMON DETAILS */
  .ability-close-icon:hover {
    font-variation-settings:'FILL' 1;
    cursor: pointer;
  }

  .ability-info-icon:hover, .hidden-ability-info-icon:hover {
    font-variation-settings:'FILL' 1;
    cursor: pointer;
  }
}

/* MEDIA QUERIES */

@media screen and (max-width: 875px) {
  .page-title {
    text-align: center;
  }

  .pokemon-info {
    grid-template-columns: 1fr;
    max-width: 650px;
    margin: 0 auto;
  }

  .search-pokemon-container {
    border-radius: 5px;
    display: flex;
    flex-flow: column;
    gap: 45px;
    align-items: stretch;
    max-width: 650px;
  }

  .pokemon-stats {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media screen and (max-width: 500px) {
  .search-pokemon-container {
    border-radius: 5px;
    display: flex;
    justify-content: center;
    color: white;
    background-color: #313131;
    padding: 30px 40px;
    gap: 50px;
  }

  .search-input {
    flex-flow: column;
    gap: 20px;
  }

  .search-icon {
    text-align: center;
  }

  .pokemon-stats {
    grid-template-columns: 1fr 1fr;
  }

  main {
    padding: 20px;
  }
}

@media screen and (max-width: 400px) {
  main {
    font-size: 18px;
  }

  .page-title img {
    width: 220px;
    vertical-align: bottom;
  }
}

@media screen and (max-width: 360px) {
  .sprite-name h2 {
    font-size: 1.3em;
  }

  .pokemon-sprite {
    width: 65px;
  }
}

@media screen and (max-width: 320px) {
  .page-title img {
    width: 190px;
  }

  .search-pokemon-container {
    padding: 30px;
  }
}