/* ============================================
   СЕКЦИЯ КНИГ
   ============================================ */
.books-section {
  padding: 12px 24px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-lg);
}

.books-section .section-title {
  font-size: 1.8rem;
  margin-bottom: 16px;
  color: var(--text-dark);
}

/* Сетка книг */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

/* Обычная карточка книги */
.book-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(248, 249, 250, 0.9);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  text-decoration: none;
  color: var(--text-dark);
  border: 1px solid rgba(59, 130, 246, 0.15);
  height: 100%;
}

.book-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
  border-color: rgba(59, 130, 246, 0.25);
}

/* Выделенные карточки (первые 8 книг) */
.book-card.highlighted {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 107, 0.1) 0%,
    rgba(255, 214, 102, 0.1) 25%,
    rgba(78, 205, 196, 0.1) 50%,
    rgba(69, 183, 209, 0.1) 75%,
    rgba(150, 111, 214, 0.1) 100%
  );
  border: 2px solid rgba(255, 107, 107, 0.3);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
  position: relative;
  overflow: hidden;
}

.book-card.highlighted::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, #ff6b6b, #ffd166, #4ecdc4);
  opacity: 0.7;
}

.book-card.highlighted:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.25);
  border-color: rgba(255, 107, 107, 0.5);
}

/* Иконка книги */
.book-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #45b7d1, #4ecdc4);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(69, 183, 209, 0.15);
}

.book-icon i {
  color: white;
  font-size: 1rem;
}

.book-info {
  flex: 1;
}

.book-title {
  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-dark);
  line-height: 1.2;
}

.book-author {
  font-size: 0.75rem;
  color: rgba(44, 62, 80, 0.65);
  font-style: italic;
}

/* Бейдж PDF */
.pdf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  color: white;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  margin-top: 4px;
  box-shadow: 0 2px 4px rgba(255, 107, 107, 0.15);
}

/* Выделенные книги (первые 8) - особый стиль */
.featured-books {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.featured-book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 107, 107, 0.1) 0%,
    rgba(255, 214, 102, 0.1) 25%,
    rgba(78, 205, 196, 0.1) 50%,
    rgba(69, 183, 209, 0.1) 75%,
    rgba(150, 111, 214, 0.1) 100%
  );
  border: 2px solid rgba(255, 107, 107, 0.3);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  text-decoration: none;
  color: var(--text-dark);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.15);
  position: relative;
  overflow: hidden;
  height: 100%;
}

.featured-book-card:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.25);
  border-color: rgba(255, 107, 107, 0.5);
}

.featured-book-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, #ff6b6b, #ffd166, #4ecdc4);
  opacity: 0.7;
}

.featured-book-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 3px 8px rgba(255, 107, 107, 0.25);
}

.featured-book-icon i {
  color: white;
  font-size: 1.5rem;
}

.featured-book-info {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.featured-book-title {
  font-family: "Montserrat", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-dark);
  line-height: 1.2;
}

.featured-book-author {
  font-size: 0.7rem;
  color: rgba(44, 62, 80, 0.8);
  font-weight: 500;
  margin-bottom: 8px;
}

.featured-pdf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  color: white;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(255, 107, 107, 0.25);
}

/* Блок книг с ограниченным доступом */
.restricted-books {
  position: relative;
}

.restricted-books::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(3px);
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: var(--z-default);
}

.access-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: calc(var(--z-default) + 1);
  background: white;
  padding: 20px 30px;
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  border: 2px solid #ff6b6b;
  min-width: 250px;
}

.access-overlay i {
  font-size: 2rem;
  color: #ff6b6b;
  margin-bottom: 10px;
}

.access-overlay h4 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.restricted-badge {
  background: linear-gradient(135deg, #ff6b6b, #dc3545) !important;
}

.restricted-book {
  cursor: pointer;
  transition: all var(--transition-base);
}

.restricted-book:hover {
  transform: translateY(-5px);
  filter: brightness(0.95);
}

/* Адаптив для книг */
@media (max-width: 1200px) {
  .featured-books {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .books-grid {
    grid-template-columns: 1fr;
  }

  .featured-books {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Скрываем все книги начиная с 3-й в блоке с ограниченным доступом */
  .restricted-books .featured-books .featured-book-card:nth-child(n + 3) {
    display: none;
  }
}

@media (max-width: 480px) {
  .featured-books {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
