@import url('./brand-layout-fixes.css');

/* =========================================================
   Historial: paginación real y estados de búsqueda
   ========================================================= */

.history-search-help {
  margin: 8px 0 0 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  transition: color .2s ease, opacity .2s ease;
}

.history-search-help.is-error {
  color: #d93f68;
}

.history-search.is-invalid .history-search__border {
  background: linear-gradient(115deg,
    rgba(217,63,104,.92),
    rgba(255,159,185,.62) 45%,
    rgba(217,63,104,.72));
}

.history-search.is-invalid .history-search__glow {
  background: conic-gradient(from 40deg,
    transparent 0 22%,
    rgba(217,63,104,.85) 30%,
    transparent 44% 63%,
    rgba(255,159,185,.8) 71%,
    transparent 84% 100%);
  opacity: .34;
}

.history-pagination {
  margin-top: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--ui-border, var(--border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 96%, var(--brand-50));
  box-shadow: 0 10px 28px rgba(30,22,110,.06);
}

.history-pagination[hidden] {
  display: none !important;
}

.history-pagination__meta {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.history-pagination__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-page-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid color-mix(in srgb, var(--brand-500) 20%, var(--border));
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface-soft) 90%, var(--brand-50));
  color: var(--brand-700);
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(73,58,255,.06);
  transition:
    transform .18s cubic-bezier(.2,.8,.2,1),
    box-shadow .18s ease,
    border-color .18s ease,
    opacity .18s ease;
}

.history-page-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand-500) 48%, var(--border));
  box-shadow: 0 10px 22px rgba(73,58,255,.11);
}

.history-page-button:disabled {
  opacity: .42;
  cursor: not-allowed;
  box-shadow: none;
}

.history-page-indicator {
  min-width: 108px;
  text-align: center;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

html[data-theme="dark"] .history-pagination {
  border-color: rgba(211,207,255,.14);
  background: linear-gradient(180deg,
    rgba(255,255,255,.055),
    rgba(255,255,255,.025));
  box-shadow:
    0 14px 32px rgba(3,2,35,.18),
    inset 0 1px 0 rgba(255,255,255,.04);
}

html[data-theme="dark"] .history-pagination__meta {
  color: rgba(244,243,255,.70);
}

html[data-theme="dark"] .history-page-indicator {
  color: rgba(255,255,255,.94);
}

html[data-theme="dark"] .history-page-button {
  background: linear-gradient(180deg,
    rgba(255,255,255,.12),
    rgba(255,255,255,.06));
  color: #ffffff;
  border-color: rgba(224,221,255,.20);
  box-shadow:
    0 8px 18px rgba(3,2,35,.16),
    inset 0 1px 0 rgba(255,255,255,.06);
}

html[data-theme="dark"] .history-page-button:hover:not(:disabled) {
  border-color: rgba(224,221,255,.38);
  background: linear-gradient(180deg,
    rgba(255,255,255,.17),
    rgba(255,255,255,.08));
}

html[data-theme="dark"] .history-search-help {
  color: rgba(244,243,255,.62);
}

html[data-theme="dark"] .history-search-help.is-error {
  color: #ffadc3;
}

@media (max-width: 760px) {
  .history-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .history-pagination__meta {
    text-align: center;
  }

  .history-pagination__controls {
    width: 100%;
    justify-content: space-between;
  }

  .history-page-button {
    flex: 1 1 0;
  }
}
