/* ===== Base ===== */
body {
  background-color: #f5f6fa;
  min-height: 100vh;
}

/* ===== Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-card {
  height: 160px;
  border-radius: 12px;
}

/* ===== Library Card ===== */
.lib-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  transition: transform .2s, box-shadow .2s;
  cursor: default;
  height: 100%;
}

.lib-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
}

.lib-card .card-title {
  font-size: 1rem;
  font-weight: 600;
  word-wrap: break-word;
}

.lib-card .card-desc {
  font-size: .85rem;
  color: #6c757d;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.lib-card .card-desc[data-desc] {
  cursor: pointer;
}

.lib-card .badge-category {
  font-size: .72rem;
  font-weight: 500;
}

/* Tag color */
.badge-category { background-color: #E6F1FB; color: #185FA5; }

.lib-card .meta {
  font-size: .85rem;
  color: #888;
}

.lib-card .meta-item {
  font-size: .85rem;
}

/* Link pill buttons */
.btn-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  color: #495057;
  font-size: .75rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}

.btn-link-pill:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #212529;
  text-decoration: none;
}

/* ===== Pagination ===== */
#paginationWrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

#pagination {
  flex-wrap: nowrap !important;
  white-space: nowrap;
  width: max-content;
  margin: 0 auto;
}

#pagination .page-item {
  flex: 0 0 auto;
}

.pagination .page-link {
  border-radius: 8px !important;
  margin: 0 1px;
  min-width: 36px;
  padding: .4rem .65rem;
  text-align: center;
  font-size: .85rem;
}

.pagination .page-item.active .page-link {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* ===== Filters ===== */
.category-filter {
  position: relative;
}

.category-trigger {
  cursor: pointer;
  text-align: left;
}

.category-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: .375rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  z-index: 1000;
}

.category-menu-item {
  width: 100%;
  text-align: left;
  padding: .5rem .75rem;
  border: 0;
  background: #fff;
  color: #000;
}

.category-menu-item:hover {
  background: #f8f9fa;
  color: #000;
}

.category-menu-item.active {
  background: #0d6efd;
  color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 576px) {
  .lib-card .card-title {
    font-size: .92rem;
  }

  .pagination .page-link {
    min-width: 32px;
    padding: .35rem .5rem;
    font-size: .8rem;
  }
}