/* Pagy Pagination Styles - Tailwind CSS Compatible */
/* Designed to match the admin interface design system */

.pagy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}

/* Base styling for all pagination elements */
.pagy a,
.pagy span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  font-weight: 500;
}

/* Default link styling - Light mode */
.pagy a {
  background-color: white;
  color: #6b7280;
  border-color: #d1d5db;
}

.pagy a:hover {
  background-color: #f3f4f6;
  color: #1f2937;
  border-color: #6b7280;
  transform: translateY(-1px);
}

.pagy a:focus {
  outline: none;
  border-color: #3b82f6;
  color: #3b82f6;
}

/* Current page styling - Light mode - Clean highlight without shadows */
.pagy span.current,
.pagy a.current {
  background-color: #1d4ed8;
  color: white;
  border-color: #1e40af;
  cursor: default;
  font-weight: 700;
  transform: scale(1.08);
  position: relative;
}

/* Add a subtle inner glow effect for current page without shadows */
.pagy span.current::before,
.pagy a.current::before {
  content: '';
  position: absolute;
  inset: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
  border-radius: 0.375rem;
  pointer-events: none;
}

/* Gap indicator styling - Light mode */
.pagy span.gap {
  background-color: transparent;
  border-color: transparent;
  color: #9ca3af;
  cursor: default;
  font-weight: 400;
}

/* Disabled state for prev/next buttons - Light mode */
.pagy a:not([href]),
.pagy span:not(.current):not(.gap) {
  background-color: #f9fafb;
  color: #d1d5db;
  border-color: #e5e7eb;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.6;
}

/* Special styling for prev/next arrows */
.pagy a[href*="page="]:first-child,
.pagy a[href*="page="]:last-child {
  font-weight: 600;
  min-width: 2.5rem;
}

/* Dark mode support using class-based strategy */
.dark .pagy a {
  background-color: #1f2937;
  color: #d1d5db;
  border-color: #374151;
}

.dark .pagy a:hover {
  background-color: #374151;
  color: #f9fafb;
  border-color: #6b7280;
}

.dark .pagy a:focus {
  border-color: #60a5fa;
  color: #60a5fa;
}

.dark .pagy span.current,
.dark .pagy a.current {
  background-color: #1e40af;
  color: white;
  border-color: #1d4ed8;
}

/* Dark mode inner glow effect */
.dark .pagy span.current::before,
.dark .pagy a.current::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.03));
}

.dark .pagy span.gap {
  color: #6b7280;
}

.dark .pagy a:not([href]),
.dark .pagy span:not(.current):not(.gap) {
  background-color: #111827;
  color: #4b5563;
  border-color: #374151;
  opacity: 0.6;
}

/* Responsive design for mobile devices */
@media (max-width: 640px) {
  .pagy {
    gap: 0.125rem;
    font-size: 0.75rem;
  }

  .pagy a,
  .pagy span {
    min-width: 2rem;
    height: 2rem;
    padding: 0.25rem 0.5rem;
  }

  /* Current page less prominent scale on mobile */
  .pagy span.current,
  .pagy a.current {
    transform: scale(1.05);
  }

  /* Hide some page numbers on very small screens */
  .pagy a:not(:first-child):not(:last-child):not(.current):nth-child(n+4):nth-last-child(n+4) {
    display: none;
  }
}

/* Input field styling for combo navigation - Light mode */
.pagy label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: white;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.pagy label input {
  min-width: 3rem;
  max-width: 4rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: #f9fafb;
  font-size: 0.875rem;
  text-align: center;
  transition: all 0.2s ease-in-out;
}

.pagy label input:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: white;
  color: #1f2937;
}

/* Dark mode for input fields using class-based strategy */
.dark .pagy label {
  background-color: #1f2937;
  border-color: #374151;
  color: #f3f4f6;
}

.dark .pagy label input {
  background-color: #111827;
  border-color: #374151;
  color: #f3f4f6;
}

.dark .pagy label input:focus {
  border-color: #60a5fa;
  background-color: #1f2937;
  color: #f9fafb;
}

/* Animation for smooth transitions */
.pagy a {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}