@charset "utf-8";

body {
  background-color: #0f172a;
  color: #cccccc;
  margin: 0;
  padding: 0;
}

/*MAIN CONTAINER TRANSITION*/
#library-container {
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/*TAG FILTER STYLE*/
#filter-container {
  padding: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.tag-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.tag-btn:hover {
  background: #f0f0f0;
}

.tag-btn.active {
  background: #333;
  color: white;
  border-color: #333;
}

/*CAROUSEL*/
.carousel-wrapper {
  position: relative; /*Buttons: Stay there*/
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1200px; /*Testing*/
  margin: 0 auto;
}

.carousel {
  display: flex;
  overflow-x: auto; /*Have to test differences between scroll and auto*/
  scroll-behavior: smooth; 
  gap: 20px;
  padding: 40px;
	/* Experimental for Carousel */
  scroll-snap-type: x mandatory; 
  scrollbar-width: none; /* To hide the scrollbar in Firefox */
	/*I'm adding this to test the shrinking animation*/
  transform-origin: top center;
  transition: transform 0.6s ease, padding 0.6s ease, opacity 0.4s ease;
}

/* To hide the scrollbar in Chrome/Safari */
.carousel::-webkit-scrollbar {
  display: none;
}

/* To  shrink the carousel when a book is selected */
.detail-view .carousel {
  height: 150px;
  padding: 10px 0;
  transform: scale(0.7);
  overflow-y: hidden;
  opacity: 0.9;
}

.carousel-item {
  flex: 0 0 200px; /* Fixed width for covers */
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  scroll-snap-align: start; /* Each book "sticks" to the edge */
  transition: transform 0.3s ease;	
}

/* Here to make the book cover to fit the container height, even when shrinked */
.carousel-item img {
  height: 100%; 
}

.carousel-item:hover {
  transform: scale(1.05); /* Slight pop when hovering */
}

/* CAROUSEL BUTTONS STYLE */
.nav-btn {
  position: absolute;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 10px 15px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.3s;
}

.nav-btn:hover { background: rgba(0, 0, 0, 0.9); }

.left { left: -50px; }
.right { right: -50px; }

/* Hide buttons for (small) touch screens since swiping is natural there */
@media (max-width: 768px) {
  .nav-btn { display: none; }
  .left { left: 10px; } /* Or bring them inside if you still want them */
  .right { right: 10px; }
}

/* DETAILS */
  /*Animation*/
#book-details {
  opacity: 0;
  transform: translateY(30px); /* Start slightly lower */
  transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s; /* Delayed start */
  pointer-events: none; /* Can't click it while hidden */
}

  /*Styles*/
.detail-layout {
  display: flex;
  gap: 40px;
  opacity: 0; 
  transform: translateY(20px);
  transition: opacity 0.5s, transform 0.5s;
  margin: 0 auto;
  align-items: center; /*Vert*/
  justify-content: center;	/*Hor*/
}

.detail-left {
  flex: 1;
  text-align: center;
}

#detail-cover {
  max-width: 100%; 
  height: auto;
}

#detail-meta, #detail-title {
}

.detail-right {
  flex: 2;
}

  /* Make only the quotes list scroll inside this side */
#quotes-list {
  overflow-y: auto;
  max-height: 80vh;
  padding-right: 15px;
}

@keyframes revealQuote {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

   /*Individual quotes style*/
.quote-card {
  background-image: url('img/quote-texture.jpg');
  padding: 30px;
  margin-bottom: 30px;
  position: relative;
  clip-path: polygon(
    0% 2%, 5% 0%, 10% 3%, 15% 1%, 20% 4%, 25% 1%, 30% 5%, 35% 2%, 40% 6%, 45% 2%, 50% 5%, 
    55% 1%, 60% 4%, 65% 1%, 70% 3%, 75% 0%, 80% 4%, 85% 1%, 90% 5%, 95% 1%, 100% 3%, 
    100% 97%, 95% 100%, 90% 96%, 85% 99%, 80% 95%, 75% 98%, 70% 94%, 65% 98%, 60% 95%, 
    55% 99%, 50% 96%, 45% 100%, 40% 95%, 35% 98%, 30% 94%, 25% 99%, 20% 96%, 15% 100%, 
    10% 95%, 5% 98%, 0% 96%
  );
  filter: drop-shadow(2px 5px 5px rgba(0, 0, 0, 0.15));
  opacity: 0;
  animation: revealQuote 0.6s ease forwards;
}

.book-quote {
  font-family: 'Crimson Pro', serif;
  font-size: 1.25rem;
  line-height: 1.6;
  color: #111;
  font-style: italic;
  margin-bottom: 15px;
  border-left: none;
}

.personal-comment {
  font-family: 'Indie Flower', cursive;
  font-size: 1.4rem;
  color: #0c1e57;
  line-height: 1.4;
  margin-top: 10px;
  transform: rotate(-1deg);
}

.comment-date {
  font-family: 'Crimson Pro', serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  display: block;
  margin-top: 15px;
}

  /* Show the details when the state changes */
.detail-view .detail-layout {
  opacity: 1;
  transform: translateY(0);
}
.detail-view #book-details {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/*BACK TO LIBRARY BUTTON*/
.close-btn {
  background: #333;
  color: white;
  border: none;
  padding: 10px 20px;
  margin-bottom: 20px;
  cursor: pointer;
  border-radius: 5px;
  font-family: inherit;
  transition: background 0.3s;
}

.close-btn:hover {
  background: #555;
}

/* Hide the button when we are in the carousel view */
.carousel-view #close-details {
  display: none;
}