
body {
  padding: 0;
  margin: 0;
  box-sizing: none;
  font-family: Arial, sans-serif;
  margin: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #a7cef7be;
}

.interface {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr; 
  grid-template-rows: auto auto auto; 
  gap: 20px;
  font-family: Arial, sans-serif;
  grid-template-areas: 
    "adicionar atualizar"
    "deletar buscar"
    "livros livros";
}

h1, h2 {
  margin: 5px 0;
  color: #333;
  text-align: center;
}

section {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f5f6f7;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  box-shadow: 2px 10px 20px rgba(0, 0, 0, 0.29);
}

#adicionar {
  grid-area: adicionar;
}

#atualizar {
  grid-area: atualizar;
}

#deletar {
  grid-area: deletar;
}

#buscar {
  grid-area: buscar;
}

#livros {
  grid-area: livros; 
}

input {
  margin: 5px 0;
  padding: 5px;
  width: 200px;
  display: block;
}

button {
  width: 120px;
  margin-top: 5px;
  padding: 5px 10px;
  cursor: pointer;
  background: #007BFF;
  color: #fff;
  border: none;
  border-radius: 4px;
  transition: all 0.1s ease-in-out;
  box-shadow: 0 2px #0056b3;
  position: relative;
  top: 0;
}

button:hover {
  background: #0056b3;
}

button:active {
  border: -5px solid #000408;
  top: 2px;
  box-shadow: 0 2px #004080;
  transform: scale(0.98);
}
ul {
  list-style: none;
  padding: 0;
}

li {
  margin: 5px 0;
  background: #eee;
  padding: 5px;
  border-radius: 4px;
}

.livros-container {
  margin-top: 10px;
  margin: 10px;
  padding:  10px;
  width: 98%;
  height: 200px;
  overflow-y: auto;
  border: 1px solid #ddd; 
}

#loading {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden; 
}

  
.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
  
@media screen and (max-width: 560px) {
  .interface {
    grid-template-columns: 1fr; 
    grid-template-rows: auto auto auto auto auto; 
    grid-template-areas: 
      "adicionar"
      "atualizar"
      "deletar"
      "buscar"
      "livros";
  }
  
  input {
    width: 96%; 
  }
  
  .livros-container {
    width: 95%;
  }
  
}