/* Library Book Slider Styles */

.library-section {
  position: relative;
  padding: 20px 0 40px;
}

.library-scroller-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin: 20px 0 15px;
}

.library-scroller {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  padding: 10px 4px;
  width: 100%;
}

.library-scroller::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

/* Default Desktop: 7 books visible at once */
.library-book-item {
  flex: 0 0 calc((100% - (6 * 16px)) / 7);
  max-width: calc((100% - (6 * 16px)) / 7);
  scroll-snap-align: start;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-color: #f8f9fa;
  cursor: pointer;
}

.library-book-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.library-book-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

/* Semi-transparent hover overlay with book description */
.library-book-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(2px);
  color: #ffffff;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 2;
}

.library-book-item:hover .library-book-overlay,
.library-book-item:focus .library-book-overlay,
.library-book-item.active-touch .library-book-overlay {
  opacity: 1;
  visibility: visible;
}

.library-book-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 6px 0;
  color: #ffffff;
}

.library-book-author {
  font-size: 12px;
  font-weight: 600;
  color: #fbbf24;
  margin: 0 0 8px 0;
}

.library-book-desc {
  font-size: 11px;
  line-height: 1.35;
  color: #e2e8f0;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Arrow controls */
.library-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  color: #333333;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.library-arrow:hover {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
  transform: translateY(-50%) scale(1.08);
}

.library-arrow.prev {
  left: -18px;
}

.library-arrow.next {
  right: -18px;
}

/* Pagination Dots */
.library-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.library-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.library-dot.active {
  background: #475569;
  transform: scale(1.2);
}

/* Responsive Breakpoints */
@media (max-width: 1199px) {
  .library-book-item {
    flex: 0 0 calc((100% - (4 * 14px)) / 5);
    max-width: calc((100% - (4 * 14px)) / 5);
  }
}

@media (max-width: 991px) {
  .library-book-item {
    flex: 0 0 calc((100% - (3 * 12px)) / 4);
    max-width: calc((100% - (3 * 12px)) / 4);
  }
  .library-arrow.prev {
    left: -10px;
  }
  .library-arrow.next {
    right: -10px;
  }
}

@media (max-width: 767px) {
  .library-book-item {
    flex: 0 0 calc((100% - (1 * 10px)) / 2.3);
    max-width: calc((100% - (1 * 10px)) / 2.3);
  }
  .library-book-title {
    font-size: 13px;
  }
  .library-book-author {
    font-size: 11px;
  }
  .library-book-desc {
    font-size: 10px;
  }
  .library-arrow {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .library-arrow.prev {
    left: -6px;
  }
  .library-arrow.next {
    right: -6px;
  }
}
