/* manual.css — estilos do modulo de Ajuda contextual
   PRD-TECNICA-0003 / TASK-0005 + TASK-0012
   Tokens herdaveis do app; fallback dark-mode. */

.help-modal,
.help-modal-backdrop,
.help-trigger,
.help-index {
  --manual-bg: var(--bg, #0f1115);
  --manual-bg-elev: var(--bg-elev, #1a1d24);
  --manual-text: var(--text, #e6e6e6);
  --manual-text-muted: var(--text-muted, #9ba3b4);
  --manual-accent: var(--accent, #64b5f6);
  --manual-border: var(--border, #2c313b);
  --manual-warn: #f0b94e;
  --manual-stale: #e57373;
  --manual-radius: 8px;
  --manual-shadow: 0 18px 60px rgba(0,0,0,0.55);
}

/* Trigger (?) — colado no nome (sem espaço extra), nunca quebra linha */
.help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin: 0 0 0 2px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--manual-accent);
  cursor: pointer;
  vertical-align: middle;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 120ms ease, border-color 120ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.help-trigger:hover,
.help-trigger:focus-visible {
  background: rgba(100, 181, 246, 0.12);
  border-color: var(--manual-accent);
  outline: none;
}
.help-trigger .help-icon { width: 14px; height: 14px; display: block; }

/* Backdrop + modal */
.help-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 9998;
}
.help-modal-backdrop[data-open] { opacity: 1; }

.help-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, calc(-50% + 8px));
  width: 92vw; max-width: 720px;
  max-height: 85vh;
  background: var(--manual-bg-elev);
  color: var(--manual-text);
  border-radius: var(--manual-radius);
  border: 1px solid var(--manual-border);
  box-shadow: var(--manual-shadow);
  display: flex; flex-direction: column;
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 9999;
  overflow: hidden;
}
.help-modal[data-open] {
  opacity: 1;
  transform: translate(-50%, -50%);
}
.help-modal:focus { outline: none; }

.help-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--manual-border);
  background: var(--manual-bg);
}
.help-modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.help-modal-close {
  background: transparent;
  border: 1px solid transparent;
  color: var(--manual-text-muted);
  font-size: 22px;
  line-height: 1;
  width: 32px; height: 32px;
  border-radius: 6px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.help-modal-close:hover,
.help-modal-close:focus-visible {
  background: rgba(255,255,255,0.06);
  color: var(--manual-text);
  border-color: var(--manual-border);
  outline: none;
}

.help-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.55;
}
.help-modal-body p { margin: 0 0 10px; }
.help-modal-body p:last-child { margin-bottom: 0; }
.help-modal-body code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
}
.help-modal-body a { color: var(--manual-accent); }
.help-modal-body ul { padding-left: 18px; margin: 0 0 10px; }

.help-modal-figure {
  margin: 12px 0;
  border: 1px solid var(--manual-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--manual-bg);
}
.help-modal-screenshot { width: 100%; height: auto; display: block; }
.help-modal-aging {
  font-size: 12px;
  color: var(--manual-text-muted);
  padding: 6px 10px;
  border-top: 1px solid var(--manual-border);
}
.help-modal-figure.aging-warn .help-modal-aging { color: var(--manual-warn); }
.help-modal-figure.aging-stale .help-modal-aging { color: var(--manual-stale); }

.help-modal-passos {
  padding-left: 22px;
  margin: 12px 0;
}
.help-modal-passos li { margin-bottom: 6px; }

.help-modal-relacionadas {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--manual-border);
  font-size: 13px;
  color: var(--manual-text-muted);
}
.help-modal-relacionadas a { color: var(--manual-accent); margin: 0 4px; }

.help-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 18px;
  border-top: 1px solid var(--manual-border);
  background: var(--manual-bg);
}
.help-modal-link-indice {
  font-size: 13px;
  color: var(--manual-accent);
  text-decoration: none;
}
.help-modal-link-indice:hover { text-decoration: underline; }

body.manual-open { overflow: hidden; }

/* Indice */
.help-index {
  padding: 24px;
  color: var(--manual-text);
  font-size: 14px;
}
.help-index-header { margin-bottom: 16px; }
.help-index-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 12px;
}
.help-search-input {
  width: 100%;
  max-width: 480px;
  padding: 8px 12px;
  background: var(--manual-bg);
  color: var(--manual-text);
  border: 1px solid var(--manual-border);
  border-radius: 6px;
  font: inherit;
}
.help-search-input:focus {
  outline: 2px solid var(--manual-accent);
  outline-offset: 1px;
  border-color: var(--manual-accent);
}
.help-search-empty { padding: 16px 0; color: var(--manual-text-muted); }

.help-index-sections section {
  margin-top: 18px;
}
.help-index-sections h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--manual-text-muted);
  border-bottom: 1px solid var(--manual-border);
  padding-bottom: 6px;
  margin: 0 0 8px;
}
.help-index-sections ul { list-style: none; padding: 0; margin: 0; }
.help-index-sections li { margin: 4px 0; }
.help-index-sections li.hidden,
.help-index-sections section.hidden { display: none; }
.help-index-sections a {
  color: var(--manual-text);
  text-decoration: none;
  display: inline-block;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.help-index-sections a:hover { color: var(--manual-accent); border-bottom-color: var(--manual-accent); }
.help-index-vazio { color: var(--manual-text-muted); }

/* Mobile drawer */
@media (max-width: 767px) {
  .help-modal {
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; max-width: 100vw;
    max-height: 100vh; height: 100vh;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 280ms ease;
  }
  .help-modal[data-open] { transform: translateX(0); }
  .help-modal-backdrop { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .help-modal,
  .help-modal-backdrop {
    transition: none !important;
  }
}

/* ============================================================================
   UI#29 (10/05/2026) — Help tooltip (hover sintético)
   Tooltip flutuante que aparece no hover/focus de elementos [data-help].
   Coexiste com o botão (?) do UI#6-M — hover mostra resumo curto, click abre
   o manual completo.
   Glassmorphism alinhado DOC#9 (brand #337ab7).
   ========================================================================== */
.help-tooltip {
  position: fixed;
  /* Fundo escuro com backdrop-filter (Glass Banking DOC#9) */
  background: rgba(20, 30, 50, 0.92);
  color: #e8ecf3;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(51, 122, 183, 0.35);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 13px;
  line-height: 1.45;
  max-width: 280px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 10000;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: none;
  /* Default position antes do JS posicionar — fica fora da tela */
  top: -9999px;
  left: -9999px;
}
.help-tooltip[data-open] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: none; /* nao captura clicks; mantem semantica de tooltip */
}
.help-tooltip-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: #64b5f6; /* var(--accent) */
  font-size: 13px;
}
.help-tooltip-body {
  font-size: 13px;
  color: #e8ecf3;
}
.help-tooltip-cta {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 6px;
  font-style: italic;
}

/* No reduced-motion sem transition */
@media (prefers-reduced-motion: reduce) {
  .help-tooltip {
    transition: opacity 0s !important;
    transform: none !important;
  }
}

/* ============================================================================
   UI#29 — Editor de hints (Gestão Dev → aba Hints)
   Tabela com lista de hints + textarea inline pra editar texto.
   ========================================================================== */
.hints-editor-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev, #1a1d24);
  border: 1px solid var(--border, #2c313b);
  border-radius: 8px;
  overflow: hidden;
}
.hints-editor-table th,
.hints-editor-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border, #2c313b);
  font-size: 13px;
  vertical-align: top;
}
.hints-editor-table thead th {
  background: rgba(51, 122, 183, 0.08);
  font-weight: 600;
  color: var(--accent, #64b5f6);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.hints-editor-table tbody tr:hover {
  background: rgba(100, 181, 246, 0.04);
}
.hints-editor-table .hint-key {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text-muted, #9ba3b4);
}
.hints-editor-table .hint-title {
  font-weight: 600;
  color: var(--text, #e6e6e6);
}
.hints-editor-table .hint-preview {
  color: var(--text-muted, #9ba3b4);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hints-editor-row-edit {
  background: rgba(51, 122, 183, 0.06);
}
.hints-editor-row-edit textarea {
  width: 100%;
  min-height: 70px;
  padding: 8px 10px;
  background: var(--bg, #0f1115);
  color: var(--text, #e6e6e6);
  border: 1px solid var(--accent, #64b5f6);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  line-height: 1.45;
  resize: vertical;
}
.hints-editor-row-edit .hints-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}
.hints-editor-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.hints-editor-toolbar .text-muted {
  font-size: 12px;
}

