/* ==========================================================
   HostingPro - Knowledge Base (UX style)
   File: hp-knowledgebase.css
   Escopo: #hpKnowledgebase
   ========================================================== */

#hpKnowledgebase,
#hpKnowledgebase * { box-sizing: border-box; }

#hpKnowledgebase {
  padding: 24px;
}

#hpKnowledgebase a { text-decoration: none; }
#hpKnowledgebase input,
#hpKnowledgebase button { font-family: inherit; }

/* ===== helpers ===== */
#hpKnowledgebase .hp-kb-muted { color: #6b7280; font-weight: 700; }
#hpKnowledgebase .hp-kb-h2 { font-size: 20px; font-weight: 700; color: #111827; }

/* ===== card ===== */
#hpKnowledgebase .hp-kb-card {
  background: #fff;
  border: 1px solid #eef2f7;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  overflow: hidden;
}

#hpKnowledgebase .hp-kb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: #f9fafb;
  border-bottom: 1px solid #eef2f7;
}

#hpKnowledgebase .hp-kb-card-title {
  font-weight: 700;
  color: #111827;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#hpKnowledgebase .hp-kb-card-body { padding: 16px; }

#hpKnowledgebase .hp-kb-sectionhead {
  margin: 18px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ===== search ===== */
#hpKnowledgebase .hp-kb-search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

#hpKnowledgebase .hp-kb-search-inputwrap {
  position: relative;
}

#hpKnowledgebase .hp-kb-search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

#hpKnowledgebase .hp-kb-input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border-radius: 16px;
  border: 2px solid #e5e7eb;
  outline: none;
  font-weight: 700;
  color: #111827;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}

#hpKnowledgebase .hp-kb-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102,126,234,.15);
}

#hpKnowledgebase .hp-kb-btn {
  border: 0;
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 12px 28px rgba(0,0,0,.10);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform .2s, box-shadow .2s, filter .2s;
  white-space: nowrap;
}

#hpKnowledgebase .hp-kb-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(0,0,0,.14);
  filter: brightness(.99);
}

/* ===== categories grid ===== */
#hpKnowledgebase .hp-kb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

#hpKnowledgebase .hp-kb-cat {
  position: relative;
  border: 1px solid #eef2f7;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.04);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

#hpKnowledgebase .hp-kb-cat:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(0,0,0,.10);
  border-color: #e5e7eb;
}

#hpKnowledgebase .hp-kb-cat-link {
  display: block;
  padding: 16px;
  color: inherit;
}

#hpKnowledgebase .hp-kb-cat-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

#hpKnowledgebase .hp-kb-cat-ico {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg,#4facfe 0%,#00f2fe 100%);
  box-shadow: 0 12px 28px rgba(0,0,0,.10);
}

#hpKnowledgebase .hp-kb-cat-title {
  font-weight: 700;
  color: #111827;
  line-height: 1.15;
}

#hpKnowledgebase .hp-kb-cat-count {
  margin-top: 4px;
  color: #6b7280;
  font-weight: 700;
  font-size: 12px;
}

#hpKnowledgebase .hp-kb-cat-arrow { color: #9ca3af; }

#hpKnowledgebase .hp-kb-cat-desc {
  margin-top: 12px;
  color: #374151;
  font-weight: 500;
  line-height: 1.35;
}

/* ===== articles list ===== */
#hpKnowledgebase .hp-kb-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

#hpKnowledgebase .hp-kb-article {
  position: relative;
  border: 1px solid #eef2f7;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.04);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

#hpKnowledgebase .hp-kb-article:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 44px rgba(0,0,0,.10);
  border-color: #e5e7eb;
}

#hpKnowledgebase .hp-kb-article-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  color: inherit;
}

#hpKnowledgebase .hp-kb-article-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  background: #f3f4f6;
}

#hpKnowledgebase .hp-kb-article-title {
  font-weight: 700;
  color: #111827;
}

#hpKnowledgebase .hp-kb-article-excerpt {
  margin-top: 4px;
  color: #6b7280;
  font-weight: 700;
  line-height: 1.35;
}

#hpKnowledgebase .hp-kb-article-arrow { color: #9ca3af; }

/* ===== admin edit ===== */
#hpKnowledgebase .hp-kb-admin-edit {
  position: absolute;
  top: 10px;
  right: 10px;
  font-weight: 700;
  font-size: 12px;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#hpKnowledgebase .hp-kb-admin-edit:hover { background: #e5e7eb; }

/* ===== alert wrapper ===== */
#hpKnowledgebase .hp-kb-alert { margin-top: 12px; }

/* ===== responsive ===== */
@media (max-width: 1100px) {
  #hpKnowledgebase .hp-kb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  #hpKnowledgebase .hp-kb-grid { grid-template-columns: 1fr; }
  #hpKnowledgebase .hp-kb-search-row { grid-template-columns: 1fr; }
  #hpKnowledgebase .hp-kb-btn { width: 100%; justify-content: center; }
}

@media (max-width: 640px) {
  #hpKnowledgebase { padding: 16px; }
}

/* ==========================================================
   ADDONS - Knowledgebase Article Page (needed by knowledgebasearticle.tpl)
   ========================================================== */

/* header actions (print/edit) */
#hpKnowledgebase .hp-kb-card-actions{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
}

#hpKnowledgebase .hp-kb-iconbtn{
  width:40px;
  height:40px;
  border-radius:14px;
  border:1px solid #e5e7eb;
  background:#fff;
  color:#374151;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition: transform .2s, background .2s, box-shadow .2s;
}

#hpKnowledgebase .hp-kb-iconbtn:hover{
  background:#f3f4f6;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0,0,0,.08);
}

/* article content typography */
#hpKnowledgebase .hp-kb-article-content{
  color:#111827;
  font-weight:700;
  line-height:1.65;
  overflow-wrap:anywhere;
}

#hpKnowledgebase .hp-kb-article-content h1,
#hpKnowledgebase .hp-kb-article-content h2,
#hpKnowledgebase .hp-kb-article-content h3{
  margin: 16px 0 10px;
  font-weight: 700;
  line-height: 1.2;
}

#hpKnowledgebase .hp-kb-article-content p{ margin: 10px 0; }
#hpKnowledgebase .hp-kb-article-content ul,
#hpKnowledgebase .hp-kb-article-content ol{ margin: 10px 0 10px 18px; }
#hpKnowledgebase .hp-kb-article-content li{ margin: 6px 0; }

#hpKnowledgebase .hp-kb-article-content a{
  color:#667eea;
  font-weight:900;
}
#hpKnowledgebase .hp-kb-article-content a:hover{ text-decoration: underline; }

#hpKnowledgebase .hp-kb-article-content img{
  max-width:100%;
  height:auto;
  border-radius:16px;
  border:1px solid #eef2f7;
}

#hpKnowledgebase .hp-kb-article-content pre{
  background:#0b1220;
  color:#e5e7eb;
  border-radius:16px;
  padding:14px 14px;
  overflow:auto;
  font-weight:700;
}

#hpKnowledgebase .hp-kb-article-content code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}

/* meta pills (tags / rating) */
#hpKnowledgebase .hp-kb-article-meta{
  margin-top: 14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

#hpKnowledgebase .hp-kb-meta-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  background:#f3f4f6;
  border:1px solid #e5e7eb;
  color:#374151;
  font-weight:900;
  font-size:12px;
}

/* rate card */
#hpKnowledgebase .hp-kb-rate{
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}

#hpKnowledgebase .hp-kb-rate-title{
  font-weight:900;
  color:#111827;
}

#hpKnowledgebase .hp-kb-rate-sub{
  margin-top:4px;
  color:#6b7280;
  font-weight:700;
  line-height:1.35;
}

#hpKnowledgebase .hp-kb-rate-right{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

#hpKnowledgebase .hp-kb-votebtn{
  border:1px solid #e5e7eb;
  background:#fff;
  color:#374151;
  border-radius:16px;
  padding:12px 14px;
  font-weight:900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:10px;
  transition: transform .2s, background .2s, box-shadow .2s, border-color .2s;
}

#hpKnowledgebase .hp-kb-votebtn:hover{
  transform: translateY(-1px);
  background:#f9fafb;
  box-shadow: 0 12px 26px rgba(0,0,0,.08);
  border-color:#cbd5e1;
}

#hpKnowledgebase .hp-kb-votebtn.is-yes{
  border-color:#bbf7d0;
  background:#ecfdf5;
  color:#065f46;
}

#hpKnowledgebase .hp-kb-votebtn.is-no{
  border-color:#fecaca;
  background:#fff1f2;
  color:#9f1239;
}

/* print tweaks */
@media print {
  #hpKnowledgebase { padding: 0; }
  #hpKnowledgebase .hp-kb-card { box-shadow:none; border:0; }
  #hpKnowledgebase .hp-kb-card-head { background:#fff; }
  #hpKnowledgebase .hp-kb-card-actions { display:none !important; }
}

/* Espaço ENTRE o card do artigo e o card "Esta resposta foi útil?" */
#hpKnowledgebase .hp-kb-ratecard{
  margin-top: 24px;
}

/* ==========================================================
   FIX – Peso correto de leitura para artigos da KB
   ========================================================== */

#hpKnowledgebase .hp-kb-article-content {
  font-weight: 400;
  line-height: 1.7;
  color: #1f2937;
}

/* parágrafos */
#hpKnowledgebase .hp-kb-article-content p {
  font-weight: 400;
  margin-bottom: 14px;
}

/* listas */
#hpKnowledgebase .hp-kb-article-content ul,
#hpKnowledgebase .hp-kb-article-content ol {
  font-weight: 400;
  margin: 12px 0 16px 20px;
}

#hpKnowledgebase .hp-kb-article-content li {
  margin-bottom: 8px;
}

/* títulos dentro do artigo */
#hpKnowledgebase .hp-kb-article-content h2,
#hpKnowledgebase .hp-kb-article-content h3,
#hpKnowledgebase .hp-kb-article-content h4 {
  font-weight: 700;
  margin-top: 22px;
  margin-bottom: 10px;
}

/* negrito pontual */
#hpKnowledgebase .hp-kb-article-content strong,
#hpKnowledgebase .hp-kb-article-content b {
  font-weight: 600;
}