:root {
  font-family: "Playfair Display", serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}

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

body {
  background-color: blanchedalmond;
}

header {
  background-image: url(images/inaki-del-olmo-NIJuEQw0RKg-unsplash.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 30vh;

  display: flex;
  justify-content: center;
  align-items: center;
}

h1 {
  color: blanchedalmond;
  font-size: 50px;
}

main {
  display: grid;
  grid-template-columns: 1fr 4fr;
  gap: 5vw;
  padding: 10px;
}

#formulario {
  display: flex;
  flex-direction: column;
  width: 30vw;
}

#books-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1vw;
}

.book {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; 
  position: relative;
  padding: 2vw;
  background-color: rgb(222, 218, 173);
  flex: 1;
  border-radius: 7px;
}

.logo {
  width: 1.3rem;
  height: auto;
}

.deleteButton {
  background: none repeat scroll 0 0 transparent;
  border: medium none;
  border-spacing: 0;
  text-decoration: none;
  position: absolute;
  bottom: 10px;
  right: 10px;
}

.deleteButton:hover {
  transform: scale(1.1);
  transition: 0.2s;
  cursor: pointer;
}

dialog {
  width: clamp(300px, 90%, 500px);
  padding: 2rem;
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

dialog[open] {
  opacity: 1;
  --scale: 1;
}

dialog:not([open]) {
  --scale: 0.95;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px); 
}

#addBookButton {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #888;
  padding: 5px;
  line-height: 1; /* Para alinear mejor el icono */
  transition: color 0.2s ease;
}

#addBookButton:hover {
  color: #000;
}

#formulario {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

#formulario label {
  font-weight: 600;
  color: #333;
}

#formulario input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
}

#formulario input:focus {
  outline: 2px solid #a38d77;
  border-color: transparent;
}

#formulario button[type="submit"] {
  padding: 14px;
  border: none;
  border-radius: 6px;
  background-color: #5a4b3c; 
  color: white;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1rem; 
  transition: background-color 0.2s ease;
}

#formulario button[type="submit"]:hover {
  background-color: #3e342a;
}

.open-dialog-btn {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background-color: #5a4b3c;
  border: none;

  display: flex;
  justify-content: center;
  align-items: center;

  color: blanchedalmond;
  font-size: 2.3rem;

  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.open-dialog-btn:hover {
  background-color: #3e342a;
  transform: scale(1.1);
}

.sidebar {
  display: flex;
  justify-content: center;
  align-items: center;
}

.readButton {
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease, background-color 0.2s ease;
  margin-top: auto; 
  align-self: flex-start;
}

.readButton:not(.read) {
  background-color: #a38d77; 
  color: blanchedalmond;
}

.readButton.read {
  background-color: #5a4b3c; 
  color: blanchedalmond;
}

.readButton:hover {
  transform: scale(1.05);
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  background-color: blanchedalmond;
  padding: 10px 0;
  color: #333;
  font-family: inherit;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

footer a {
  display: inline-block;
  margin-top: 0.5rem;
  color: #333;
  font-size: 1.5rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

footer a:hover {
  color: #5a4b3c; 
  transform: scale(1.1);
}
