/* Digimax — utilitários UX globais (clean, sem dependências).
 * Injetar via _csrf_inline.html (carrega em todas as páginas autenticadas).
 *
 * 1. .ux-scrollable: wrapper para containers com overflow-x.
 *    Mostra sombra + chevron à direita quando ainda há conteúdo para rolar,
 *    e à esquerda quando rolou. Some quando atingiu a borda.
 *
 * 2. .ux-clear-filters: estilo do botão "Limpar filtros" reutilizado em
 *    /financeiro, /leads e /operacao.
 */

/* ─── 1) Scroll-x hint ───────────────────────────────────────── */
.ux-scrollable {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Sombra à direita — visível enquanto há conteúdo para rolar */
.ux-scrollable::after,
.ux-scrollable::before {
  content: "";
  position: sticky;
  top: 0;
  width: 32px;
  height: 100%;
  pointer-events: none;
  display: block;
  flex-shrink: 0;
  z-index: 2;
  transition: opacity 0.2s;
}
.ux-scrollable::after {
  right: 0;
  margin-left: -32px;
  background: linear-gradient(to right,
              rgba(255,255,255,0) 0%,
              rgba(0,30,80,0.08) 100%);
}
.ux-scrollable::before {
  left: 0;
  margin-right: -32px;
  background: linear-gradient(to left,
              rgba(255,255,255,0) 0%,
              rgba(0,30,80,0.08) 100%);
}

/* Estados ativos — controlados via JS (ux-utils.js) */
.ux-scrollable:not(.ux-overflow-end)::after  { opacity: 0; }
.ux-scrollable:not(.ux-overflow-start)::before { opacity: 0; }

/* Chevron flutuante — só desktop, à direita do container */
.ux-scrollable-chevron {
  position: absolute;
  top: 50%; right: 6px;
  transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,30,80,0.85); color: white;
  display: none;
  align-items: center; justify-content: center;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,30,80,0.25);
  z-index: 3;
  animation: uxChevPulse 1.6s ease-in-out infinite;
}
.ux-scrollable.ux-overflow-end > .ux-scrollable-chevron { display: flex; }
.ux-scrollable-chevron svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2.4; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
@keyframes uxChevPulse {
  0%,100% { transform: translateY(-50%) translateX(0); }
  50%     { transform: translateY(-50%) translateX(3px); }
}

/* ─── 2) Botão "Limpar filtros" ───────────────────────────────── */
.ux-clear-filters {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.10);
  color: #555; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  transition: all 0.15s ease;
}
.ux-clear-filters:hover {
  background: #f0f7ff;
  border-color: rgba(0,120,255,0.3);
  color: #0066cc;
}
.ux-clear-filters:active { transform: scale(0.97); }
.ux-clear-filters svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.ux-clear-filters[hidden] { display: none; }
