/* css/docs.css — Estilos da Documentação Técnica do Portal Cognition RPA EMS */

.docs-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 0 60px 0;
  box-sizing: border-box;
  color: var(--ink);
  font-family: inherit;
}

/* Barra Superior de Ações da Documentação */
.docs-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  position: relative;
  width: 100%;
  box-sizing: border-box;
  z-index: 2;
}

.docs-action-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-action-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.docs-search-input {
  width: 280px;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}
.docs-search-input:focus {
  border-color: var(--accent);
}

.btn-docs-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.btn-docs-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Layout de Duas Colunas: Sumário + Conteúdo */
.docs-container {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

/* Sumário Lateral Fixo */
.docs-sidebar {
  position: sticky;
  top: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 5;
}

.docs-sidebar h4 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.docs-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-nav-link {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
  line-height: 1.35;
  transition: all 0.15s ease;
}
.docs-nav-link:hover {
  background: var(--soft);
  color: var(--ink);
}
.docs-nav-link.active {
  background: var(--soft);
  color: var(--accent);
  font-weight: 700;
  border-left: 3px solid var(--accent);
}

/* Área de Conteúdo Principal */
.docs-content {
  min-width: 0;
}

/* Capa e Cabeçalho do Manual */
.docs-header-hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px 36px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.docs-header-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981 0%, #06b6d4 50%, #3b82f6 100%);
}

.docs-badge-ver {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 12px;
}

.docs-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.docs-subtitle {
  margin: 0 0 16px;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.5;
}

.docs-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.docs-meta-item {
  font-size: 12px;
}
.docs-meta-item span {
  display: block;
  color: var(--muted);
  margin-bottom: 2px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
}
.docs-meta-item strong {
  color: var(--ink);
}

/* Seções da Documentação */
.docs-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 24px;
}

.docs-section h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.docs-section h3 {
  margin: 22px 0 10px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}

.docs-section h4 {
  margin: 16px 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.docs-section p {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 12px;
}

.docs-section ul, .docs-section ol {
  margin: 0 0 16px 20px;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}

.docs-section li {
  margin-bottom: 6px;
}

/* Callouts / Avisos Técnicos */
.docs-callout {
  padding: 14px 18px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.55;
  border-left: 4px solid;
}
.docs-callout-info {
  background: rgba(14, 165, 233, 0.08);
  border-color: #0284c7;
  color: var(--ink);
}
.docs-callout-security {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
  color: var(--ink);
}
.docs-callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
  color: var(--ink);
}

/* Tabelas Técnicas */
.docs-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 14px 0 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}
.docs-table th {
  background: var(--soft);
  color: var(--ink);
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.docs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: top;
}
.docs-table tr:last-child td {
  border-bottom: none;
}
.docs-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges de Métodos HTTP e Status */
.badge-http {
  display: inline-block;
  font-family: monospace;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}
.badge-post { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-get { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-put { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-delete { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Blocos de Código e SQL */
.docs-code-block {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 12px 0 18px;
  overflow-x: auto;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #38bdf8;
  position: relative;
}

.docs-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  font-family: inherit;
}

.docs-btn-copy {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.docs-btn-copy:hover {
  background: var(--soft);
  color: var(--ink);
}

/* Grid de Arquitetura Visual */
.docs-arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0 20px;
}
.docs-arch-card {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.docs-arch-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--accent);
}
.docs-arch-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

/* Responsividade */
@media (max-width: 900px) {
  .docs-container {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    display: none;
  }
  .docs-action-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  .docs-search-input {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   ESTILOS ESPECÍFICOS PARA EXPORTAÇÃO EM PDF / IMPRESSÃO (@media print)
   -------------------------------------------------------------------------- */
@media print {
  /* Reseta travas de overflow e 100vh da casca do portal */
  html,
  body,
  .wrap,
  .app-layout,
  .main-content,
  #pageContainer,
  #viewDocs {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 10pt !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Oculta todos os componentes de casca, navegação, modais e botões */
  header.top,
  .top-bar,
  aside#mainSidebar,
  #mainSidebar,
  #accessGate,
  #modalsRoot,
  .nina-fab,
  .nina-drawer,
  .docs-action-bar,
  .docs-sidebar,
  .docs-btn-copy,
  .btn-export,
  .no-print,
  #docsPrintIframe {
    display: none !important;
  }

  .docs-wrapper {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .docs-container {
    display: block !important;
    width: 100% !important;
  }

  .docs-content {
    width: 100% !important;
  }

  .docs-section,
  .docs-header-hero {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: none !important;
    margin-bottom: 24pt !important;
    padding: 18pt !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Quebra de página antes de seções principais */
  .docs-page-break {
    page-break-before: always !important;
    break-before: page !important;
  }

  .docs-title {
    color: #0f172a !important;
    font-size: 22pt !important;
  }
  .docs-subtitle {
    color: #4b5563 !important;
    font-size: 12pt !important;
  }
  .docs-section h2 {
    color: #0f172a !important;
    border-bottom: 2px solid #0f172a !important;
  }
  .docs-section h3, .docs-section h4 {
    color: #1e293b !important;
  }
  .docs-section p, .docs-section li {
    color: #374151 !important;
  }

  .docs-table {
    font-size: 9pt !important;
  }
  .docs-table th {
    background: #f3f4f6 !important;
    color: #111827 !important;
    border: 1px solid #d1d5db !important;
  }
  .docs-table td {
    border: 1px solid #e5e7eb !important;
    color: #1f2937 !important;
  }

  .docs-code-block {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    font-size: 8.5pt !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .docs-callout {
    background: #f8fafc !important;
    border-left-width: 4px !important;
    color: #1f2937 !important;
  }

  .badge-http {
    border: 1px solid #9ca3af !important;
    color: #111827 !important;
  }
}

