@import url('https://fonts.googleapis.com/css2?family=Poppins&display=swap');

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

body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f8f8;
  color: #333;
}

header {
  background-color: #ffcb05;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header img {
  height: 50px;
}

header h1 {
  margin: 0;
  font-size: 24px;
  color: #2a75bb;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 40px;
}

nav ul li {
  display: inline;
}

nav ul li a {
  text-decoration: none;
  color: #2a75bb;
  font-weight: bold;
}

nav ul li a:hover {
  text-decoration: underline;
}

main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: 
  "buttons pokemons";
  padding: 20px;
}

section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 10px;
  background-color: #fff;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  height: 200px;
  width: 300px;
}

.section_wrapper {
  display: flex;
  flex-direction: column;
  grid-area: buttons;
  gap: 20px;
  margin: 10px;
  padding: 10px;
  margin-left: 80px;
}

.display_cards {
  display: grid; 
  grid-area: pokemons;
  grid-template-columns: repeat(3, 200px);
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "card1 card2 card3"
    "card4 card5 card6";
  gap: 20px;
  justify-content: center;
  margin: 10px;
  padding: 10px;
  margin-right: 80px;
}

.display_cards > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 10px;
  text-align: center;
  width: 200px;
}

.display_cards h3 {
  margin-top: 0;
  color: #2a75bb;
}

.display_cards img {
  width: 150px;
  height: 150px;
}

.display_cards ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
}

.display_cards ul li {
  background-color: #000000;
  padding: 5px 10px;
  border-radius: 4px;
  color: #ffffff;
  font-weight: bold;
}

h2 {
  margin-top: 0;
  color: #2a75bb;
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  font-weight: bold;
}

input[type="text"] {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

button {
  padding: 10px;
  background-color: #ffcb05;
  border: none;
  border-radius: 4px;
  color: #2a75bb;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background-color: #e5b604;
}

#suggestions {
  border: 1px solid #ccc;
  max-height: 150px;
  overflow-y: auto;
  width: 100%;
  margin-top: 5px;
  border-radius: 4px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: none;
}

.suggestion-item {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  display: blox;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background-color: #f0f0f0;
}

footer {
  background-color: #ffcb05;
  text-align: center;
  padding: 10px 0;
  color: #2a75bb;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
  position: static;
  width: 100%;
  bottom: 0;
  margin-top: 30px;
}

.card_1 {
  grid-area: card1;
}

.card_2 {
  grid-area: card2;
}

.card_3 {
  grid-area: card3;
}

.card_4 {
  grid-area: card4;
}

.card_5 {
  grid-area: card5;
}

.card_6 {
  grid-area: card6;
}

.section_1{
  grid-area: section1;
}

.section_2{
  grid-area: section2;
}

.section_3{
  grid-area: section2;
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s infinite ease-in-out;
}

#normal {
  background-color: #9fa19f;
}

#fire {
  background-color: #e62829;
}

#fighting {
  background-color: #ff8000;
}

#water {
  background-color: #287fef;
}

#flying {
  background-color: #81b9ef;
}

#grass {
  background-color: #3fa129;
}

#poison {
  background-color: #9141cb;
}

#electric {
  background-color: #fac000;
}

#ground {
  background-color: #915121;
}

#psychic {
  background-color: #ef4179;
}

#rock {
  background-color: #afa981;
}

#ice {
  background-color: #3dcef3;
}

#bug {
  background-color: #91a119;
}

#dragon {
  background-color: #5060e1;
}

#ghost {
  background-color: #704170;
}

#dark {
  background-color: #624d4e;
}

#steel {
  background-color: #60a1b8;
}

#fairy {
  background-color: #ef70ef;
}

@media screen and (max-width: 1200px) {
  .display_cards {
    grid-template-columns: repeat(2, 200px);
    grid-template-rows: auto;
    grid-template-areas:
      "card1 card2"
      "card3 card4"
      "card5 card6";
  }
}

@media screen and (max-width: 960px) {
  .display_cards {
    grid-template-columns: repeat(1, 200px); 
    grid-template-rows: auto;
    grid-template-areas:
      "card1"
      "card2"
      "card3"
      "card4"
      "card5"
      "card6";
  }
}

@media screen and (max-width: 760px) {
  main {
    grid-template-columns: 1fr; 
    grid-template-areas:
      "buttons"
      "pokemons";
  }

  .section_wrapper {
    margin-left: 0; 
  }

  .display_cards {
      grid-template-columns: repeat(2, 200px);
      grid-template-rows: auto;
      grid-template-areas:
        "card1 card2"
        "card3 card4"
        "card5 card6";
  }
  
  nav ul {
    gap: 20px;
  }
}

@media screen and (max-width: 550px) {
  ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
  }
}

@media screen and (max-width: 442px){
  header > h1{
    margin-left: 30px;
  }
} 

@media screen and (max-width: 540px) {
  header {
    flex-direction: row;
    align-items: flex-start;
    padding: 10px;
  }

  header img {
    height: 40px;
    margin-bottom: 10px;
  }

  header h1 {
    font-size: 20px;
    margin-left: 0;
    text-align: center;
  }

  nav ul {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 10px;
  }

  nav ul li {
    width: 100%;
    text-align: center;
  }

  .section_wrapper {
    margin-left: 0;
    align-items: center;
  }

  .display_cards {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "card1"
      "card2"
      "card3"
      "card4"
      "card5"
      "card6";
    justify-content: center;
  }

  footer {
    padding: 10px 0;
    text-align: center;
  }
}