/**
 * Pagination Styles
 * @countermeasure/web-components
 *
 * Page navigation with numbered buttons and info text.
 */

/* ============================================================================
   PAGINATION CONTAINER
   ============================================================================ */
.cmm-pagination {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}

/* ============================================================================
   PAGINATION BUTTON
   ============================================================================ */
.cmm-pagination__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  cursor: pointer;
  user-select: none;
  transition: background-color var(--transition-fast, 150ms),
              border-color var(--transition-fast, 150ms),
              color var(--transition-fast, 150ms);
}

.cmm-pagination__button:hover {
  background-color: hsl(var(--accent));
  border-color: hsl(var(--accent));
}

.cmm-pagination__button:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: 1px;
}

/* Active / current page */
.cmm-pagination__button--active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.cmm-pagination__button--active:hover {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
  opacity: 0.9;
}

/* Disabled state */
.cmm-pagination__button--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Navigation arrows (prev/next) */
.cmm-pagination__button--prev,
.cmm-pagination__button--next {
  font-size: 0.75rem;
}

.cmm-pagination__button--prev svg,
.cmm-pagination__button--next svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* ============================================================================
   PAGINATION ELLIPSIS
   ============================================================================ */
.cmm-pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  user-select: none;
}

/* ============================================================================
   PAGINATION INFO
   ============================================================================ */
.cmm-pagination__info {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
  margin-left: 0.5rem;
}

/* ============================================================================
   PAGINATION SIZE SELECTOR
   ============================================================================ */
.cmm-pagination__size {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-left: auto;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.cmm-pagination__size-select {
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: border-color var(--transition-fast, 150ms);
}

.cmm-pagination__size-select:focus {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: 1px;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 480px) {
  .cmm-pagination {
    justify-content: center;
  }

  .cmm-pagination__info {
    width: 100%;
    text-align: center;
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .cmm-pagination__size {
    width: 100%;
    justify-content: center;
    margin-left: 0;
    margin-top: 0.25rem;
  }
}
