/* ============================================
   WIKI — complemento sobre styles.css
   Usa as mesmas variáveis de cor do site novo
   ============================================ */

.wiki-board {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- Toolbar (busca + filtros) ---------- */
.wiki-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wiki-search-box {
  position: relative;
  width: 100%;
  max-width: 640px;
}
.wiki-search-box > .fa-search {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted, #8a93a6);
  font-size: 14px;
  pointer-events: none;
}
.wiki-search-box input {
  width: 100%;
  padding: 12px 44px 12px 40px;
  background: rgba(3, 7, 13, 0.6);
  border: 1px solid var(--line, #2a3448);
  border-radius: 10px;
  color: var(--text, #e6e9ef);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.wiki-search-box input:focus {
  border-color: var(--gold, #b5963e);
  box-shadow: 0 0 0 3px rgba(181, 150, 62, 0.15);
}
.wiki-search-box input::placeholder { color: var(--muted, #8a93a6); }

.wiki-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--muted, #8a93a6);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: color .2s, background .2s;
}
.wiki-search-clear:hover {
  color: var(--danger, #ef4444);
  background: rgba(239, 68, 68, 0.1);
}

/* Resultados da busca (dropdown) */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #0a0e17;
  border: 1px solid var(--line, #2a3448);
  border-radius: 10px;
  max-height: 420px;
  overflow-y: auto;
  display: none;
  z-index: 60;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.search-results.active { display: block; }
.sr-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line, #2a3448);
  cursor: pointer;
  transition: background .15s;
}
.sr-item:last-child { border-bottom: 0; }
.sr-item:hover { background: rgba(181, 150, 62, 0.08); }
.sr-cat {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gold, #b5963e);
  font-weight: 700;
  margin-bottom: 4px;
}
.sr-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.sr-snippet { font-size: 12px; color: var(--muted, #8a93a6); line-height: 1.4; }
.sr-snippet b, .sr-name b { color: var(--gold-lt, #d4b55a); }
.sr-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted, #8a93a6);
  font-size: 13px;
}
.sr-empty i { font-size: 22px; margin-bottom: 8px; color: var(--gold, #b5963e); }

/* ---------- Filtros rápidos ---------- */
.wiki-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--line, #2a3448);
  color: var(--muted, #8a93a6);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover {
  border-color: var(--gold, #b5963e);
  color: var(--gold-lt, #d4b55a);
}
.filter-btn.active {
  background: var(--gold, #b5963e);
  border-color: var(--gold, #b5963e);
  color: #03070d;
}

/* ---------- Corpo ---------- */
.wiki-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  align-items: start;
}

/* ---------- Sidebar ---------- */
.wiki-sidebar {
  background: rgba(3, 7, 13, 0.5);
  border: 1px solid var(--line, #2a3448);
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: 90px;
}
.wiki-sidebar h3 {
  margin: 0 0 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gold, #b5963e);
  display: flex;
  align-items: center;
  gap: 8px;
}
#categories-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
#categories-list li { margin-bottom: 3px; }
#categories-list li.loading {
  color: var(--muted, #8a93a6);
  font-size: 13px;
  padding: 8px 4px;
}
#categories-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--text, #e6e9ef);
  text-decoration: none;
  font-size: 13px;
  transition: background .15s, color .15s;
}
#categories-list a i { color: var(--gold, #b5963e); width: 14px; text-align: center; }
#categories-list a:hover { background: rgba(181, 150, 62, 0.08); color: var(--gold-lt, #d4b55a); }
#categories-list a.active {
  background: rgba(181, 150, 62, 0.14);
  color: var(--gold-lt, #d4b55a);
  border-left: 3px solid var(--gold, #b5963e);
  padding-left: 8px;
}
.cat-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted, #8a93a6);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 7px;
  border-radius: 999px;
}

/* ---------- Conteúdo ---------- */
.wiki-content {
  background: rgba(3, 7, 13, 0.5);
  border: 1px solid var(--line, #2a3448);
  border-radius: 12px;
  padding: 24px;
  min-height: 380px;
}

.wiki-welcome { text-align: center; padding: 32px 16px; }
.wiki-welcome i { color: var(--gold, #b5963e); margin-bottom: 14px; display: block; }
.wiki-welcome h2 { margin: 0 0 10px; font-size: 22px; color: var(--gold-lt, #d4b55a); }
.wiki-welcome p { color: var(--muted, #8a93a6); margin-bottom: 22px; font-size: 14px; }
.wiki-stats { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.wiki-stats .stat {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line, #2a3448);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted, #8a93a6);
}
.wiki-stats .stat i { color: var(--gold, #b5963e); margin-right: 6px; }
.wiki-stats .stat span { color: var(--gold-lt, #d4b55a); font-weight: 700; }

.wiki-loading { text-align: center; padding: 50px 20px; color: var(--muted, #8a93a6); }
.wiki-loading i { font-size: 24px; color: var(--gold, #b5963e); margin-bottom: 10px; }

.topic-header {
  border-bottom: 1px solid var(--line, #2a3448);
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.topic-header h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--gold-lt, #d4b55a);
  display: flex;
  align-items: center;
  gap: 10px;
}
.topic-cat {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gold, #b5963e);
  font-weight: 700;
}

/* Lista de tópicos */
.topics-list { display: grid; gap: 8px; }
.topics-list .sr-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line, #2a3448);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color .15s, transform .15s;
}
.topics-list .sr-item:hover {
  border-color: var(--gold, #b5963e);
  transform: translateX(3px);
}
.topics-list .sr-name i { color: var(--gold, #b5963e); margin-right: 8px; }

/* Corpo do tópico */
.topic-body {
  line-height: 1.7;
  font-size: 14px;
  color: var(--text, #e6e9ef);
}
.topic-body img.topic-cover {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 18px;
  border: 1px solid var(--line, #2a3448);
}
.topic-body p { margin: 0 0 12px; }
.topic-body h1, .topic-body h2, .topic-body h3 {
  color: var(--gold-lt, #d4b55a);
  margin: 20px 0 10px;
}
.topic-body a { color: var(--gold, #b5963e); }
.topic-body code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.topic-body ul, .topic-body ol { margin: 0 0 12px; padding-left: 22px; }

/* Footer do tópico */
.topic-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--line, #2a3448);
  padding-top: 14px;
  margin-top: 22px;
}
.topic-meta { color: var(--muted, #8a93a6); font-size: 12px; }
.topic-meta i { margin: 0 4px 0 8px; color: var(--gold, #b5963e); }
.topic-votes { display: flex; gap: 8px; }
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line, #2a3448);
  border-radius: 8px;
  color: var(--muted, #8a93a6);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}
.vote-btn:hover:not(:disabled) { border-color: var(--gold, #b5963e); color: var(--gold-lt, #d4b55a); }
.vote-btn:disabled { cursor: not-allowed; opacity: .75; }
.vote-like.active-like { background: rgba(74, 222, 128, 0.12); border-color: #4ade80; color: #4ade80; }
.vote-dislike.active-dislike { background: rgba(239, 68, 68, 0.12); border-color: #ef4444; color: #ef4444; }

.topic-back { margin-top: 14px; text-align: center; }
.topic-back a {
  color: var(--muted, #8a93a6);
  font-size: 13px;
  text-decoration: none;
  transition: color .2s;
}
.topic-back a:hover { color: var(--gold-lt, #d4b55a); }
.topic-back i { margin-right: 6px; }

.topic-empty, .wiki-empty {
  text-align: center;
  color: var(--muted, #8a93a6);
  padding: 32px 16px;
  font-size: 14px;
}

.hl { color: var(--gold-lt, #d4b55a); background: rgba(181, 150, 62, 0.15); padding: 0 2px; border-radius: 2px; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .wiki-body { grid-template-columns: 1fr; }
  .wiki-sidebar { position: static; }
  .wiki-content { padding: 18px; }
  .wiki-quick-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-btn { flex-shrink: 0; }
}
@media (max-width: 520px) {
  .topic-header h2 { font-size: 18px; }
  .topic-footer { flex-direction: column; align-items: flex-start; }
}