html {
  /* 1rem = 16px, so when define at 62.5% 1rem = 10 px */
  /* for responsive size, just change this font-size in media-query (for ex retina screen) */
  font-size: 62.5%;
  background-color: hsl(65, 97%, 35%);
  background-image: url("https://static.vecteezy.com/system/resources/previews/000/093/303/large_2x/floral-ornament-wall-tapestry-vector.jpg");
  background-position: unset;
}
* {
  margin: 0;
  padding: 0;
}
button {
  cursor: pointer;
  border: 0 solid transparent;
}
button,
input,
input::placeholder {
  font-size: inherit;
}
/* prevent the default focus outline on chrome */
:focus {
  outline: transparent none 0px;
}

body {
  font-family: "Amarante", sans-serif;
}

/* header */
#header,
#footer {
  color: #ebf1f1;
}
#header::after,
#footer::before {
  content: "";
  display: block;
  height: 1rem;
  background-color: rgb(128, 37, 21);
  border: solid black 0.1rem;
  border-width: 0.2rem 0;
}
#library-title {
  text-align: center;
  padding: 2rem 0;
  font-size: 3.5rem; /*35 px*/
}
#sort-div {
  display: flex;
  align-items: center;
  width: max-content;
  margin: auto;
  font-size: 1.6rem;
  margin-bottom: 1rem;
}
#sort-div #sort-select {
  padding: 0 2rem;
  text-align: center;
  font-size: inherit;
  font-family: inherit;
  background: rgb(202, 161, 127);
  border: solid 0.1rem black;
}
#sort-div #sort-text {
  padding-right: 1rem;
}

/* footer */
#footer {
  width: 100%;
  font-size: 1.6rem;
}
#footer p {
  text-align: center;
  color: whitesmoke;
  margin: 1.5rem auto;
}
#footer a {
  color: rgb(61, 156, 245);
  text-decoration: none;
}
#footer a:visited {
  color: rgb(105, 203, 228);
}
#footer a:hover {
  color: #D2E603;
}

/* Responsive Books list */
#library-list {
  background-color: #FF9D76;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}
#library-list:before,
#library-list:after {
  content: "";
  height: 100%;
  background-image: url("https://static.vecteezy.com/system/resources/previews/000/099/912/large_2x/geometric-purple-background-vector.jpg");
 
}
#library-list:before {
  background-position: right;
}
#library-list:after {
  background-position: left;
}
#books-list {
  width: min-content;
  display: grid;
  /* grid-gap: 0.2rem; */
  padding: 0.5rem;
  grid-template-columns: repeat(5, 1fr);
  list-style: none;
  margin: auto;
  background-image: url("https://wallpapercave.com/wp/wp7485731.jpg");
  border: solid black 0.1rem;
  border-width: 0 0.2rem;
  

}
@media screen and (max-width: 1300px) {
  #books-list {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media screen and (max-width: 1045px) {
  #books-list {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media screen and (max-width: 790px) {
  #books-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Book Items */
#books-list li {
  margin: 0.5rem;
  border: solid 2px black;
}
#add-book-zone {
  min-height: 42rem;
  min-width: 24rem;
  position: relative;
  transform: scale(1, 1); /* for :after visibility */
}
#add-book-zone:after {
  content: "";
  background-image: url("https://images.unsplash.com/photo-1541918947631-dcdf39da04fa?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=388&q=80");
  position: absolute;
  opacity: 0.5;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: -1;
}
.book-div,
#add-book-form {
  width: 20rem;
  height: 38rem;
  padding: 2rem;
}
.book-div {
  background-image: url("https://images.unsplash.com/photo-1541963463532-d68292c34b19?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=388&q=80");
  background-size: 22rem;
  display: grid;
  grid-template-rows: 1fr 1fr repeat(3, auto);
  justify-items: center;
}
#add-book-zone {
  display: flex;
}

.book-title {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 85%;
}
.book-author {
  font-size: 1.4rem;
  margin: 0.5rem;
  text-align: center;
  line-height: 85%;
}
.book-cover {
  height: 25rem;
  object-fit: scale-down;
  max-width: 20rem;
  margin: 0.5rem 0;
  border: whitesmoke 0.1rem solid;
}
.book-nb-pages {
  font-size: 1.3rem;
}
.book-btns {
  width: 18rem;
  display: flex;
  justify-content: space-between;
  margin: 1rem 0 0 0;
}
.book-btns button,
.book-btns input[type="radio"] {
  cursor: pointer;
  font-size: 1.9rem;
  background: transparent;
  border: 0 transparent solid;
  color: rgb(44, 44, 44);
  transition: all 0.4s;
}
.book-btns button:hover,
.book-btns input[type="radio"]:hover {
  color: rgb(87, 86, 86);
  transform: scale(1.3, 1.3);
}

.book-btns input[type="radio"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  margin: 0 0.4rem;
}
.book-btns .like-radio:checked {
  color: rgb(51, 138, 11);
}
.book-btns .unlike-radio:checked {
  color: rgb(168, 20, 20);
}
.book-btns .like-radio:checked:hover {
  color: rgb(79, 163, 40);
}
.book-btns .unlike-radio:checked:hover {
  color: rgb(199, 60, 60);
}

/* Add Book Form */
@keyframes add-book-form-display {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#new-book-btn {
  font-size: 8rem;
  font-weight: bold;
  line-height: 0px;
  margin: auto;
  width: 5rem;
  height: 5rem;
  font-family: Arial, Helvetica, sans-serif;
  border-radius: 50%;
  color: whitesmoke;
  background: transparent;
  animation: add-book-form-display 1s;
  transition: all 0.4s;
  position: relative;
}
#new-book-btn:before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  content: "";
  display: block;
  border-radius: inherit;
  width: 0rem;
  height: 0rem;
  transition: all 0.4s;
  background-color: rgb(12, 157, 167);
}
#new-book-btn:hover:before,
#new-book-btn:active:before {
  width: 6rem;
  height: 6rem;
}
#new-book-btn:hover,
#new-book-btn:active {
  transform: scale(1.3, 1.3);
}
#add-book-form {
  display: flex;
  flex-direction: column;
  background-image: url("book-bg.png");
  color: inherit;
  align-items: center;
  font-size: 1.4rem;
  animation: add-book-form-display 1s;
}

#add-book-form-title {
  margin-bottom: 2rem;
  margin-top: 1rem;
  font-size: 1.7rem;
  width: 15rem;
  text-align: center;
}
#add-book-form > div,
#add-book-form > input {
  margin-bottom: 1rem;
}
#add-book-form input[type="text"],
#add-book-form input[type="number"],
#add-book-form button {
  width: 17rem;
  padding: 0.5rem 1rem;
  /* line-height: 50%; */
  font-size: inherit;
}
#add-book-form input::placeholder {
  font-size: inherit;
}
#nb-pages-div,
#read-div,
#like-div {
  display: flex;
  align-items: center;
}
#add-book-form #nb-pages-input {
  margin-left: 0.5rem;
  width: 6rem;
  padding-right: 0;
}
#add-book-form #read-input,
#add-book-form #like-div input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  margin-left: 0.5rem;
  border: solid 0.2rem rgb(44, 44, 44);
  width: 1.8rem;
  height: 1.8rem;
  box-sizing: border-box;
  cursor: pointer;
  background: transparent;
  /* transition: background-color 0.3s; */
  position: relative;
  transform: scale(
    1,
    1
  ); /* for :before visibility because of its z-index property */
  overflow: hidden;
}
#add-book-form #read-input:before,
#add-book-form #like-div input:before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  content: "";
  display: block;
  border-radius: inherit;
  width: 0rem;
  height: 0rem;
  transition: width 0.4s, height 0.4s;
  background-color: rgb(44, 44, 44);
}
#add-book-form #read-input:hover:before,
#add-book-form #like-div input:hover:before,
#add-book-form #read-input:active:before,
#add-book-form #like-div input:active:before {
  width: 1rem;
  height: 1rem;
}
#add-book-form #read-input:checked:before,
#add-book-form #like-div input:checked:before {
  width: 2rem;
  height: 2rem;
  background-color: whitesmoke;
}
#add-book-form #like-div input {
  border-radius: 50%;
}
#add-book-form #like-div input {
  margin-right: 0.5rem;
}
#add-book-form #like-div #unlike-input {
  margin-left: 1rem;
}
#form-btns {
  display: flex;
  justify-content: space-between;
  width: 19rem;
  margin-top: 2rem;
}
#add-book-form input[type="submit"],
#add-book-form #cancel-form-btn {
  border-radius: 1rem;
  width: auto;
  height: 3rem;
  color: whitesmoke;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
  padding: 0.5rem 1rem;
}
#add-book-form input[type="submit"] {
  background-color: rgb(12, 157, 167);
  border: 0 solid transparent;
}
#add-book-form #cancel-form-btn {
  background-color: rgb(185, 14, 14);
}
#add-book-form input[type="submit"]:hover {
  background-color: rgb(32, 186, 197);
}
#add-book-form #cancel-form-btn:hover {
  background-color: rgb(223, 56, 56);
}

/* mobile */
@media screen and (max-width: 540px) {
  html {
    font-size: 1.85vw;
    background-size: 50vw;
  }
}
