/* Style definition for the component that shows the full book information, including animations */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

confirm-reservation {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  align-items: center;
  display: flex;
  flex-flow: column;
  background-color: var(--crust);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 3px 6px 6px rgba(0, 0, 0, 0.2);
  animation: book-info__main__appear 0.3s ease-in-out;
}

/* When the outside is clicked, the user leaves the pop-up. 
  On a small screen, more width is helpful to display the text,
  So, in that case the height should be smaller so there is an area to click on to leave. */
book-info {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-height: 70%;
  overflow-y: auto;
  display: flex;
  flex-flow: column;
  background-color: var(--crust);
  padding: 8px;
  border-radius: 8px;
  box-shadow: 3px 6px 6px rgba(0, 0, 0, 0.2);
  animation: book-info__appear 0.6s ease-in-out;

  @media only screen and (min-width: 650px) {
    max-height: 90%;
    width: 70%;
    padding: 15px;
  }
}

book-info > * {
  margin: 15px;
  padding: 20px;
  background-color: var(--surface0);
  border-radius: 8px;
  box-shadow: 3px 6px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-flow: row;
  justify-content: space-between;
}

@keyframes book-info__appear {
  0% {
    left: 20%;
    width: 0%;
    max-height: 20%;
  }
  40% {
    left: 50%;
    width: 60%;
    max-height: 20%;
  }

  100% {
    max-height: 90%;
  }
}

.book-info__header {
  animation: fade-in 0.5s ease-in;
  display: flex;
  flex-flow: row wrap;
}

.book-info__description {
  flex-flow: column;
  animation: fade-in 0.7s ease-in;
  overflow-wrap: anywhere;
}

.book-info__rating {
  overflow: hidden;
  white-space: nowrap;
  animation: book-info__rating__appear 4s ease-in;
}

.book-info__rating > * {
  color: var(--peach);
}

@keyframes book-info__rating__appear {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.book-info__author {
  animation: fade-in 0.9s ease-in;
  flex-flow: row wrap;
  @media only screen and (min-width: 1200px) {
    flex-wrap: nowrap;
  }
}

.book-info__author__profile {
  animation: fade-in 1.5s ease-in;
}

.book-info__author__description {
  flex-flow: column;
}

@keyframes book-info__main__appear {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.book-info__img {
  padding: 10px;
  width: 200px;
  height: 300px;
  object-fit: cover;
  animation: book-info__img__appear 0.3s ease-out;
}

@keyframes book-info__img__appear {
  0% {
    opacity: 0;
    transform: translateX(-100%) scale(0);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.book-info__title {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  align-items: center;
  animation: book-info__title__appear 1s ease-in-out;
}

@keyframes book-info__title__appear {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.book-info__description {
  margin-top: 20px;
}
