.custom-pagination {
  margin: 1rem 0;
  max-width: 100%;
  overflow: hidden;
  width: 100%;
}

.custom-pagination .pagination {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin: 0;
  max-width: 100%;
  min-width: 0;
  padding-left: 0;
}

.custom-pagination .page-item {
  margin: 0;
  min-width: 0;
}

.custom-pagination .page-link {
  align-items: center;
  background: var(--content-background-color, var(--color-back, #fff));
  border: 1px solid rgba(16, 78, 130, 0.28);
  border-radius: 0.375rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  color: var(--base-dark, var(--text-color, #104e82));
  display: inline-flex;
  flex-shrink: 1;
  gap: 0.25rem;
  justify-content: center;
  line-height: 1;
  max-width: 100%;
  min-height: 2.5rem;
  min-width: 2.5rem;
  overflow: hidden;
  padding: 0.65rem 0.85rem;
  position: relative;
  text-decoration: none;
  transition: color 0.35s, border-color 0.35s, background-color 0.35s;
  white-space: nowrap;
  z-index: 1;
}

.custom-pagination .page-link::before {
  background-color: var(--base-dark, var(--text-color, #104e82));
  content: "";
  inset: 0;
  position: absolute;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.35s;
  z-index: -1;
}

.custom-pagination .page-link:hover,
.custom-pagination .page-link:focus {
  background: var(--content-background-color, var(--color-back, #fff));
  border-color: var(--base-dark, var(--text-color, #104e82));
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  color: var(--text-light, var(--color-back, #fff));
}

.custom-pagination .page-link:hover::before,
.custom-pagination .page-link:focus::before {
  transform: scaleY(1);
}

.custom-pagination .page-link .academy-icon {
  color: currentColor;
  margin: 0;
}

.custom-pagination .page-item.active .page-link,
.custom-pagination .page-item.active.disabled .page-link {
  background-color: var(--base-dark, var(--text-color, #104e82));
  border-color: var(--base-dark, var(--text-color, #104e82));
  color: var(--text-light, var(--color-back, #fff));
}

.custom-pagination .page-item.disabled .page-link {
  background-color: rgba(16, 78, 130, 0.08);
  border-color: rgba(16, 78, 130, 0.12);
  color: rgba(28, 28, 28, 0.45);
  pointer-events: none;
}

@media screen and (max-width: 576px) {
  .custom-pagination .pagination {
    gap: 0.25rem;
  }

  .custom-pagination .page-link {
    min-height: 2.25rem;
    min-width: 2.25rem;
    padding: 0.55rem 0.65rem;
  }
}

@media screen and (max-width: 376px) {
  .custom-pagination .page-link {
    font-size: 0.9rem;
    min-height: 2.1rem;
    min-width: 2.1rem;
    padding: 0.5rem 0.55rem;
  }
}
