/* Modern Pagination */
.pagy {
  display: flex;
  align-items: center;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  margin: 2rem 0;
  gap: 0.5rem;
}

/* Base styles for all buttons and elements */
.pagy a:not(.gap),
.pagy span:not(.gap),
.pagy label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  text-decoration: none;
  border-radius: 9999px;
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(75, 85, 99, 0.5);
  padding: 0.5rem 0.75rem;
  color: #d1d5db;
  transition: all 0.2s ease;
}

/* Hover for interactive buttons */
.pagy a:not(.gap):hover:not([href]):not(.current) {
  background-color: rgba(31, 41, 55, 0.7);
  border-color: rgba(107, 114, 128, 0.7);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Disabled buttons */
.pagy a:not(.gap):not([href]) {
  cursor: not-allowed;
  opacity: 0.5;
  background-color: rgba(31, 41, 55, 0.4);
  color: #6b7280;
  border-color: rgba(75, 85, 99, 0.3);
}

/* Current page with gradient */
.pagy a:not(.gap).current {
  background: linear-gradient(135deg, #9F638D, #5D4A7E); /* Using similar colors to primary/secondary */
  color: white;
  border: none;
  font-weight: 600;
  box-shadow: 0 4px 6px -1px rgba(159, 99, 141, 0.3), 0 2px 4px -1px rgba(93, 74, 126, 0.15);
}

/* First/last page buttons */
.pagy a:not(.gap):first-child,
.pagy a:not(.gap):last-child {
  font-weight: 600;
  padding: 0.5rem 1rem;
}

/* Page jump input */
.pagy label {
  display: flex;
  align-items: center;
  background-color: rgba(31, 41, 55, 0.4);
  padding: 0.25rem 0.75rem;
  gap: 0.5rem;
  border-radius: 9999px;
}

.pagy label input {
  width: 3rem;
  line-height: 1.5rem;
  border-radius: 0.375rem;
  border: 1px solid rgba(107, 114, 128, 0.5);
  background-color: rgba(17, 24, 39, 0.7);
  color: white;
  text-align: center;
  padding: 0.25rem;
  transition: all 0.2s ease;
}

.pagy label input:focus {
  outline: none;
  border-color: #9F638D;
  box-shadow: 0 0 0 2px rgba(159, 99, 141, 0.25);
}

/* Separator "gap" */
.pagy .gap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  color: #6b7280;
}

/* Mobile version more compact */
@media (max-width: 640px) {
  .pagy {
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  .pagy a:not(.gap),
  .pagy span:not(.gap),
  .pagy label {
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
  }

  /* Hide some pages on mobile to keep compact */
  .pagy .page:not(.current):not(:first-of-type):not(:last-of-type):not(:nth-of-type(2)):not(:nth-last-of-type(2)) {
    display: none;
  }
}

/* Slight animation when clicking */
.pagy a:not(.gap):active {
  transform: translateY(0);
  box-shadow: none;
}
