body {
  font-family: 'Verdana', sans-serif;
  margin: 0;
  padding: 0;
  background: #b00020;
  color: #fff;
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: #7a000f;
  padding: 15px;
  border-bottom: 5px solid #440009;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.header-titles {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  position: relative;
}

header h1 {
  margin: 0;
  font-size: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header-titles p {
  margin: 0;
  font-size: 1rem;
}

.pokedex-buttons {
  display: flex;
  gap: 10px;
}

.pokedex-buttons span {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid #222;
}

.btn-blue {
  background: #3b82f6;
}

.btn-green {
  background: #22c55e;
}

.btn-yellow {
  background: #eab308;
}

.pokedex {
  background: #1c1c1c;
  border: 8px solid #222;
  border-radius: 20px;
  margin: 20px auto 0;
  padding: 20px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  max-height: 55vh;
  overflow-y: auto;
  width: 90%;
  flex-grow: 1;
}

@media screen and (min-width: 1000px) {
  .pokedex {
    min-height: 50vh;
  }
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 1.5rem;
  color: #ff0000;
  cursor: pointer;
}

#loadingMessage {
  text-align: center;
  color: #ffcc00;
  font-size: 1.5rem;
  margin-top: 50px;
}

.message-container {
  text-align: center;
  margin-top: 20px;
}

#noResultsMessage {
  display: none;
  text-align: center;
  color: #fff;
  font-size: 1.2rem;
  margin-top: 50px;
}

#suggestionsList {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.suggestion-item {
  color: #ffcc00;
  cursor: pointer;
  font-weight: bold;
}

.pokemon-card {
  background: #f4f4f4;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  padding: 15px;
  transition: transform 0.2s ease;
  color: #333;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

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

.pokemon-card img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.pokemon-card h2 {
  margin: 10px 0 5px;
  font-size: 1.2rem;
  text-transform: capitalize;
}

footer {
  background: #7a000f;
  padding: 10px;
  border-top: 5px solid #440009;
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

footer a {
  color: #ffcc00;
  text-decoration: none;
}

.search-container {
  display: flex;
  align-items: center;
}

#searchInput {
  padding: 10px 35px 10px 15px;
  border-radius: 25px;
  border: 2px solid #222;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 180px;
}

#searchInput:focus {
  border-color: #ffcc00;
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.7);
}

/* Responsividade para telas menores */
@media screen and (max-width: 600px) {
  .header-top {
    margin-bottom: 15px;
  }

  .header-titles {
    gap: 5px;
  }

  header h1 {
    font-size: 1.8rem;
  }

  .pokedex {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    padding: 10px;
    max-height: 65vh;
  }

  .pokemon-card {
    min-height: 160px;
    padding: 10px;
  }

  .pokemon-card img {
    width: 100px;
    height: 100px;
  }

  .pokemon-card h2 {
    font-size: 1rem;
  }

  #searchInput {
    width: 140px;
    padding: 8px 30px 8px 12px;
    font-size: 0.9rem;
  }
}

@media screen and (max-width: 380px) {
  header {
    padding: 10px;
  }

  .header-titles {
    gap: 10px;
    flex-direction: column;
  }

  .header-top {
    margin-bottom: 10px;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .header-titles p {
    font-size: 0.9rem;
  }

  .pokedex {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 5px;
    max-height: 68vh;
  }

  .pokemon-card {
    min-height: 140px;
    padding: 8px;
  }

  .pokemon-card img {
    width: 80px;
    height: 80px;
  }

  .pokedex-buttons span {
    width: 20px;
    height: 20px;
  }

  #searchInput {
    width: 120px;
    padding: 6px 25px 6px 10px;
    font-size: 0.8rem;
  }
}

/* Garantir que o layout principal ocupe a altura total da tela */
main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Melhorias de acessibilidade para modo escuro/claro do sistema */
@media (prefers-color-scheme: light) {
  .pokemon-card {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
}

/* Melhorias para toques em dispositivos móveis */
@media (hover: none) {
  .pokemon-card:hover {
    transform: none;
  }

  .pokemon-card:active {
    transform: scale(0.95);
  }
}

/* Ajuste para evitar zoom em inputs em iOS */
@supports (-webkit-touch-callout: none) {

  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}