/* ==========================================================================
   Base de Conhecimento — Portal Hub Fábrica Manual (conhecimento.css)
   ========================================================================== */

:root {
  --primary: #06b6d4;
  --primary-glow: rgba(6, 182, 212, 0.35);
  --accent: #22d3ee;
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.3);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --purple: #818cf8;
  --bg-dark: #08111e;
  --card-bg: rgba(15, 23, 42, 0.85);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-border-glow: rgba(56, 189, 248, 0.3);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.08) 0px, transparent 50%);
  color: var(--text-main);
  line-height: 1.7;
}

/* Navbar Global Superior */
nav.global-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 17, 30, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  padding: 12px 24px;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.brand span {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-nav-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 7px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-nav-home:hover {
  background: var(--primary);
  color: #08111e;
  border-color: var(--primary);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-nav-hub {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--gold) 0%, #d97706 100%);
  color: #08111e;
  padding: 7px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 4px 15px var(--gold-glow);
}

/* Layout Principal: Sidebar + Conteúdo */
.docs-wrapper {
  max-width: 1400px;
  margin: 30px auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 36px;
  align-items: start;
}

/* Sidebar Lateral de Navegação */
.sidebar-nav {
  position: sticky;
  top: 80px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.sidebar-menu li a:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--card-border);
}

.sidebar-menu li a.active {
  color: #fff;
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  font-weight: 700;
}

.sidebar-menu li a.active i {
  color: var(--accent);
}

.sidebar-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.sidebar-menu li a.active .sidebar-num {
  background: var(--primary);
  color: #08111e;
}

/* Área de Conteúdo Principal */
.docs-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

/* Header do Artigo */
.module-header {
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.module-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 4px 14px;
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.module-title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.5px;
  color: #fff;
  margin-bottom: 12px;
}

.module-description {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Componentes de Leitura "Direto ao Ponto" */
.section-block {
  margin-bottom: 40px;
}

.section-block h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-block h2 i {
  color: var(--accent);
}

.section-block p {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-bottom: 16px;
}

/* Cards de Tópicos e Regras */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.topic-card {
  background: rgba(8, 17, 30, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.25s ease;
}

.topic-card:hover {
  border-color: var(--card-border-glow);
  transform: translateY(-3px);
}

.topic-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topic-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Alert Boxes & Callouts */
.callout {
  border-radius: 14px;
  padding: 20px 24px;
  margin: 24px 0;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  font-size: 0.92rem;
  line-height: 1.6;
}

.callout-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.callout.info {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #e0f2fe;
}
.callout.info .callout-icon { color: var(--accent); }

.callout.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fef3c7;
}
.callout.warning .callout-icon { color: var(--gold); }

.callout.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #d1fae5;
}
.callout.success .callout-icon { color: var(--emerald); }

/* Checklists Práticos */
.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(8, 17, 30, 0.5);
  border: 1px solid var(--card-border);
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.92rem;
  color: var(--text-main);
}

.checklist li i {
  color: var(--emerald);
  font-size: 1.1rem;
  margin-top: 3px;
  flex-shrink: 0;
}

/* Navegação de Rodapé (Módulo Anterior / Próximo Módulo) */
.module-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
  flex-wrap: wrap;
}

.btn-nav-prev, .btn-nav-next {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-nav-prev {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--text-main);
}

.btn-nav-prev:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-nav-next {
  background: linear-gradient(135deg, var(--primary) 0%, #0284c7 100%);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-nav-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

/* Responsividade Mobile & Tablet */
@media (max-width: 900px) {
  .docs-wrapper {
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 20px auto 40px;
    padding: 0 16px;
  }

  .sidebar-nav {
    position: relative;
    top: 0;
    max-height: none;
  }

  .docs-content {
    padding: 24px 18px;
  }

  .module-nav-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-nav-prev, .btn-nav-next {
    justify-content: center;
  }
}
