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

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  font-family: "Chakra Petch", sans-serif;
  background-color: #e3dcf2;
}

main {
  flex: 1;
}

img {
  width: 400px;
  height: 350px;
}

h1 {
  font-size: 2.5rem;
  color: #95bfa4;
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.3rem;
  padding: 15px 10px;
}

.subtitulo {
  text-align: center;
  color: #333;
}

.div-titulos {
  align-items: center;
}

section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}

input {
  width: 30rem;
  border: 1px solid #ccc;
  padding: 1rem 1rem 1rem 2.5rem;
  border-radius: 1.5rem;
  margin: 1rem 0rem;
  color: #333;
  font-size: 1rem;
}

button {
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: 1.5rem;
  background-color: #95bfa4;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

.resultados-pesquisa {
  width: 60rem;
  max-height: 60vh;
  overflow-y: auto;
  margin: 0 auto;
  padding: 1rem;
  align-items: center;
  border-radius: 0.6rem;
}

.item-resultado {
  background-color: #f2f2f2;
  border-radius: 0.6rem;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
}

.imagem-container {
  margin-right: 20px;
}

.capa-livro {
  max-width: 128px;
  max-height: 200px;
}

.info-container {
  flex: 1;
}

.info-container h2 {
  margin: 0 0 10px;
  font-size: 1.5em;
}

.info-container .descricao-meta {
  margin: 5px 0;
}

.info-container a {
  display: inline-block;
  margin-top: 10px;
  font-weight: bold;
  color: #95bfa4;
  text-decoration: none;
}

.info-container a:hover {
  text-decoration: underline;
}

h2 {
  padding-left: 12px;
  padding-bottom: 10px;
  color: #333;
}

.autor {
  padding-left: 12px;
  padding-bottom: 10px;
  color: #555;
  font-weight: bold;
}

.descricao {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5rem;
  padding-left: 12px;
}

.classificacao {
  padding-left: 12px;
  font-size: 0.9rem;
  color: #555;
}

.star {
  font-size: 1.5rem;
  color: rgba(231, 231, 39, 0.884);
}

a {
  padding-left: 12px;
}

footer {
  background-color: #c1bad9;
  color: #333;
  text-align: center;
  padding: 18px 0;
  width: 100%;
  height: auto;
  font-size: 1rem;
}

#scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #95bfa4;
  color: #f2f2f2;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  opacity: 0; /* Inicialmente invisível */
  transition: opacity 0.3s ease;
}

#scroll-to-top:hover {
  background-color: #95bfa4;
}

#scroll-to-top.show {
  opacity: 1; /* Visível quando a classe "show" é adicionada */
}

/* Estilo da barra de rolagem para navegadores (Chrome, Safari) */
::-webkit-scrollbar {
  width: 12px; /* Largura da barra de rolagem */
}

::-webkit-scrollbar-track {
  background: #f2f2f2; /* Cor de fundo da trilha da barra de rolagem */
  border-radius: 10px; /* Arredondamento dos cantos da trilha */
}

::-webkit-scrollbar-thumb {
  background: #95bfa477; /* Cor da parte rolável (thumb) */
  border-radius: 10px; /* Arredondamento dos cantos do thumb */
}

::-webkit-scrollbar-thumb:hover {
  background: #95bfa477; /* Cor do thumb quando o mouse está sobre ele */
}

/* Estilo da barra de rolagem para navegadores Firefox */
.scrollbar {
  scrollbar-width: thin; /* Largura da barra de rolagem */
  scrollbar-color: #95bfa477 #f2f2f2; /* Cor do thumb e da trilha */
}

/* Exemplo de estilo para uma área com barra de rolagem personalizada */
.custom-scrollbar {
  height: 300px; /* Altura do contêiner com barra de rolagem */
  overflow-y: scroll; /* Ativa a rolagem vertical */
}

@media (max-width: 600px) {
  body {
    width: auto;
  }
  /* Estilizando a barra de pesquisa */
  input {
    width: 90%; /* A largura do input será 90% da tela no celular */
    font-size: 1rem;
    padding: 0.8rem;
    margin-bottom: 1rem;
  }

  button {
    width: 90%;
    font-size: 1rem;
    padding: 0.8rem;
  }

  /* Ajustando a seção de resultados */
  .resultados-pesquisa {
    width: 95%; /* Deixar mais estreito para telas menores */
    padding: 1rem;
  }

  .item-resultado {
    flex-direction: column; /* Empilha a imagem e o conteúdo */
    align-items: center;
  }

  .imagem-container {
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .capa-livro {
    max-width: 100px;
    max-height: 150px;
    padding-bottom: 10px;
  }
  .descricao {
    text-align: justify;
  }

  .info-container {
    text-align: center; /* Centraliza o texto */
  }

  .info-container h2 {
    font-size: 1.2rem;
  }

  .info-container p {
    font-size: 0.9rem;
  }

  h1 {
    font-size: 1.8rem;
    padding: 20px 0;
  }

  .subtitulo {
    font-size: 1rem;
  }

  footer {
    padding: 15px 0;
    font-size: 0.9rem;
  }
}
