/* ============================================================
   Documentação Técnica SGA — Estilos
   Para adicionar conteúdo edite apenas js/docs/docs-config.js
   ============================================================ */

/* Layout base — aplicado ao wrapper do componente SPA e ao body das páginas standalone */
body.docs-body,
.docs-component {
  background-color: #f1f4f5;
  font-family: 'Roboto', sans-serif;
  color: #444;
}

/* Navbar — usada apenas nas páginas standalone (documentacao-tecnica/) */
.docs-navbar {
  background-color: #008542;
  border-bottom: 2px solid #FDC82F;
  padding: 0.6rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.docs-navbar .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.docs-navbar .navbar-brand img {
  height: 32px;
}

.docs-navbar .brand-title {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.docs-navbar .brand-badge {
  background-color: #FDC82F;
  color: #004165;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 50px); /* 50px = barra-topo do SGA */
  overflow-y: auto;
  background-color: #ffffff;
  border-right: 1px solid #dce3e6;
  padding: 1.25rem 0;
  box-shadow: 1px 0 4px 0 rgba(0,0,0,0.08);
}

/* Nas páginas standalone a viewport inteira é usada */
body.docs-body .docs-sidebar {
  top: 60px;
  height: calc(100vh - 60px);
}

.docs-sidebar::-webkit-scrollbar {
  width: 4px;
}

.docs-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background-color: #ced4da;
  border-radius: 2px;
}

.docs-nav-section-title {
  padding: 0.4rem 1.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #777;
  margin-top: 0.75rem;
}

.docs-nav-section-title:first-child {
  margin-top: 0;
}

.docs-nav-link {
  display: block;
  padding: 0.35rem 1.25rem 0.35rem 1.75rem;
  font-size: 0.85rem;
  color: #444;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background-color 0.15s ease;
}

.docs-nav-link:hover {
  color: #444;
  background-color: #eaeaea;
  text-decoration: none;
  border-left-color: transparent;
}

.docs-nav-link.active {
  color: #444;
  font-weight: 600;
  border-left-color: #FDC82F;
  background-color: #eaeaea;
}

/* Área de conteúdo */
.docs-content {
  padding: 2rem 2.5rem 4rem;
  max-width: 860px;
}

.docs-section {
  margin-bottom: 3rem;
}

.docs-section-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #444;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #FDC82F;
  margin-bottom: 1.75rem;
  text-transform: uppercase;
}

.docs-subsection {
  margin-bottom: 2.5rem;
}

.docs-subsection-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: #444;
  margin-bottom: 1rem;
}

.docs-subtitulo {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #868e96;
  margin: 1.25rem 0 0.5rem;
}

.docs-texto p {
  margin-bottom: 0.75rem;
  line-height: 1.7;
  color: #444;
}

.docs-texto p:last-child {
  margin-bottom: 0;
}

/* Endpoint header */
.endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-left: 4px solid #dee2e6;
  border-radius: 4px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.endpoint-header.method-post  { border-left-color: #0d6efd; }
.endpoint-header.method-get   { border-left-color: #198754; }
.endpoint-header.method-put   { border-left-color: #fd7e14; }
.endpoint-header.method-delete{ border-left-color: #dc3545; }

.method-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 3px;
  color: #ffffff;
  text-transform: uppercase;
  flex-shrink: 0;
}

.method-badge.method-post   { background-color: #0d6efd; }
.method-badge.method-get    { background-color: #198754; }
.method-badge.method-put    { background-color: #fd7e14; }
.method-badge.method-delete { background-color: #dc3545; }

.endpoint-path {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2c3e50;
  flex-grow: 1;
}

.endpoint-desc {
  font-size: 0.82rem;
  color: #6c757d;
  margin: 0;
  width: 100%;
}

/* Bloco de código */
.code-block {
  position: relative;
  margin: 0.5rem 0 1rem;
}

.code-block pre {
  margin: 0;
  border-radius: 6px;
  padding: 1rem 1rem 1rem 1.25rem;
  background-color: #1e2130 !important;
  border: 1px solid #2d3250;
  overflow-x: auto;
}

.code-block code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  /* Cor base clara: garante legibilidade sobre o fundo escuro (#1e2130)
     mesmo quando o tema do highlight.js (CDN) não carrega. Os tokens do
     hljs sobrescrevem esta cor quando o CSS externo está disponível. */
  color: #e6e6e6;
}

.btn-copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: #2d3250;
  border: none;
  border-radius: 4px;
  color: #adb5bd;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  transition: all 0.15s;
  z-index: 1;
}

.btn-copy:hover {
  background-color: #3d4470;
  color: #ffffff;
}

/* Tabelas */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.docs-table thead th {
  background-color: #006298;
  color: #ffffff;
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.docs-table tbody td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e9ecef;
  vertical-align: top;
  color: #444;
}

.docs-table tbody tr:last-child td {
  border-bottom: none;
}

.docs-table tbody tr:hover td {
  background-color: #f8f9fa;
}

.docs-table code {
  background-color: #eef0f4;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.8rem;
  color: #e83e8c;
}

.badge-obrig {
  background-color: #dc3545;
  color: #fff;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 700;
}

.badge-opc {
  background-color: #6c757d;
  color: #fff;
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 700;
}

/* Alertas */
.docs-alerta {
  padding: 0.85rem 1rem;
  border-radius: 5px;
  margin: 1rem 0;
  font-size: 0.87rem;
  line-height: 1.6;
}

.docs-alerta.info {
  background-color: #e8f4fd;
  border-left: 4px solid #0d6efd;
  color: #084298;
}

.docs-alerta.aviso {
  background-color: #fff8e1;
  border-left: 4px solid #ffc107;
  color: #664d03;
}

.docs-alerta.perigo {
  background-color: #fde8e8;
  border-left: 4px solid #dc3545;
  color: #842029;
}

/* Diagrama de ciclo de vida */
.docs-diagrama {
  background-color: #f1f4f5;
  border: 1px solid #dce3e6;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  font-size: 0.83rem;
  line-height: 1.8;
  color: #444;
  font-family: 'SFMono-Regular', Consolas, monospace;
  overflow-x: auto;
}

/* Passos de integração */
.docs-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step-counter;
}

.docs-steps li {
  counter-increment: step-counter;
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  align-items: flex-start;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #444;
}

.docs-steps li::before {
  content: counter(step-counter);
  background-color: #006298;
  color: #FDC82F;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.docs-steps li code {
  background-color: #eef0f4;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.82rem;
  color: #e83e8c;
}

/* Separador */
.docs-hr {
  border: none;
  border-top: 1px solid #e9ecef;
  margin: 1.5rem 0;
}

/* Estado badge */
.state-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.state-pendente  { background-color: #fff3cd; color: #856404; }
.state-baixado   { background-color: #cfe2ff; color: #084298; }
.state-concluida { background-color: #d1e7dd; color: #0a3622; }
.state-cancelada { background-color: #f8d7da; color: #842029; }

/* ── Back button (SPA reader) ── */
.docs-reader-topbar {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #dce3e6;
  background-color: #ffffff;
}

.docs-back-btn-inner {
  background: none;
  border: 1px solid #dce3e6;
  border-radius: 4px;
  color: #444;
  font-size: 0.82rem;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background-color 0.15s;
}

.docs-back-btn-inner:hover {
  background-color: #eaeaea;
}

/* ── Back link (navbar das páginas standalone) ── */
.docs-back-link {
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
  text-decoration: none;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.15s;
}

.docs-back-link:hover {
  color: #ffffff;
  text-decoration: none;
}

/* ── Landing page ── */
.docs-landing {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.docs-landing-header {
  margin-bottom: 2.5rem;
}

.docs-landing-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 0.5rem;
}

.docs-landing-header p {
  font-size: 1rem;
  color: #6c757d;
  margin: 0;
}

.docs-landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.docs-api-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background-color: #ffffff;
  border: 1px solid #dce3e6;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.docs-api-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: #FDC82F;
  text-decoration: none;
  color: inherit;
}

.docs-api-card-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background-color: #008542;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FDC82F;
  font-size: 1.25rem;
}

.docs-api-card-body h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #444;
  margin: 0 0 0.4rem;
}

.docs-api-card-body p {
  font-size: 0.85rem;
  color: #6c757d;
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.docs-api-card-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: #008542;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.docs-landing-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.78rem;
  color: #adb5bd;
  border-top: 1px solid #e9ecef;
}

/* Responsividade */
@media (max-width: 768px) {
  .docs-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #e2e6ea;
  }

  .docs-content {
    padding: 1.25rem 1rem 3rem;
  }

  .endpoint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}
