/* ══════════════════════════════════════════════════════════════════════════
   WIKI-STYLE.CSS — lp-forge-sdd
   Design System herdado de index.html com foco em leitura e responsividade.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0a0f;
  --bg2: #0f0f1a;
  --bg3: #141425;
  --border: #1e1e35;
  --border2: #2a2a45;
  --accent: #6c63ff;
  --accent2: #a78bfa;
  --accent3: #38bdf8;
  --green: #34d399;
  --orange: #fb923c;
  --pink: #f472b6;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --radius: 12px;
  --radius2: 8px;
  --sidebar-width: 280px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  overflow-x: hidden;
}

/* ─── GRID LAYOUT ─── */
.wiki-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ─── SIDEBAR (BARRA LATERAL) ─── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.back-home {
  font-size: 13px;
  color: var(--text3);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.back-home:hover {
  color: var(--accent2);
}

/* ─── LANGUAGE SWITCH ─── */
.lang-switch {
  display: flex;
  align-self: flex-start;
  border: 1px solid var(--border2);
  border-radius: var(--radius2);
  overflow: hidden;
}

.lang-btn {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  background: transparent;
  color: var(--text2);
  border: none;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.lang-btn:hover {
  background: var(--bg3);
  color: var(--text);
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ─── LOGO (novo — com SVG) ─── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  flex-shrink: 0;
  box-shadow:
    0 2px 8px rgba(79, 70, 229, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-logo:hover .logo-icon {
  transform: scale(1.08) rotate(-4deg);
  box-shadow:
    0 4px 16px rgba(79, 70, 229, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.nav-logo .logo-icon img {
  width: 100%;
  height: 100%;
  display: block;
  filter: brightness(0) invert(1);
}

/* ─── LOGO TEXT ─── */
.logo-text {
  font-weight: 700;
  font-size: 16px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}

.logo-text small {
  font-size: 10px;
  color: var(--accent3);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  font-family: 'Inter', sans-serif;
  margin-top: -2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}

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

.menu-section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text3);
  letter-spacing: 1.5px;
  padding: 16px 16px 6px 12px;
  font-family: 'JetBrains Mono', monospace;
}

.nav-link {
  display: block;
  padding: 10px 16px;
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius2);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg3);
}

.nav-link.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.25);
  font-weight: 600;
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text3);
}

.sidebar-footer a {
  color: var(--text3);
  text-decoration: none;
  transition: color 0.2s;
}

.sidebar-footer a:hover {
  color: var(--text);
}

/* ─── ÁREA DE CONTEÚDO PRINCIPAL ─── */
.content-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  padding: 60px 80px 80px;
  display: flex;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.markdown-body {
  width: 100%;
  max-width: 760px;
}

.markdown-body.fade-in {
  animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ─── TYPOGRAPHY DO MARKDOWN (LEITURA) ─── */
.markdown-body h1 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.5px;
}

.markdown-body h2 {
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 700;
  color: var(--text);
  margin-top: 36px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.markdown-body h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 12px;
}

.markdown-body p {
  font-size: 15px;
  color: var(--text2);
  margin-bottom: 20px;
}

.markdown-body p strong {
  color: #fff;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* Listas */
.markdown-body ul, .markdown-body ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.markdown-body li {
  font-size: 15px;
  color: var(--text2);
  margin-bottom: 6px;
}

.markdown-body li::marker {
  color: var(--accent2);
}

/* Links */
.markdown-body a {
  color: var(--accent2);
  text-decoration: none;
  border-bottom: 1px dashed rgba(167, 139, 250, 0.4);
  transition: all 0.2s;
}

.markdown-body a:hover {
  color: var(--accent3);
  border-bottom-style: solid;
  border-bottom-color: var(--accent3);
}

/* Código em linha */
.markdown-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--green);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Blocos de Código */
.markdown-body pre {
  margin: 24px 0;
  padding: 16px 20px;
  background: #050508 !important;
  border: 1px solid var(--border2);
  border-radius: var(--radius2);
  overflow-x: auto;
}

.markdown-body pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0;
  border-radius: 0;
  line-height: 1.6;
}

/* Custom scrollbar para blocos de código */
.markdown-body pre::-webkit-scrollbar { height: 6px; }
.markdown-body pre::-webkit-scrollbar-track { background: transparent; }
.markdown-body pre::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.markdown-body pre::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* ─── ALERTS / BLOCKQUOTES (Estilo GitHub) ─── */
.alert-box {
  border-left: 4px solid;
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 var(--radius2) var(--radius2) 0;
}

.alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.alert-content {
  font-size: 14.5px;
  color: var(--text2);
}

.alert-content p {
  margin-bottom: 0;
}

.alert-note { border-left-color: var(--accent3); background: rgba(56, 189, 248, 0.08); }
.alert-note .alert-title { color: var(--accent3); }
.alert-note .alert-icon::before { content: 'ℹ️'; }

.alert-tip { border-left-color: var(--green); background: rgba(52, 211, 153, 0.08); }
.alert-tip .alert-title { color: var(--green); }
.alert-tip .alert-icon::before { content: '💡'; }

.alert-important { border-left-color: var(--accent2); background: rgba(167, 139, 250, 0.08); }
.alert-important .alert-title { color: var(--accent2); }
.alert-important .alert-icon::before { content: '📢'; }

.alert-warning { border-left-color: var(--orange); background: rgba(251, 146, 60, 0.08); }
.alert-warning .alert-title { color: var(--orange); }
.alert-warning .alert-icon::before { content: '⚠️'; }

.alert-caution { border-left-color: var(--pink); background: rgba(244, 114, 182, 0.08); }
.alert-caution .alert-title { color: var(--pink); }
.alert-caution .alert-icon::before { content: '🚨'; }

/* ─── ERROR CONTAINER (404 / Carregamento) ─── */
.error-container {
  text-align: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  margin-top: 40px;
}

.error-container h2 {
  font-size: 22px;
  color: #fff;
  margin-bottom: 12px;
}

.error-container p {
  color: var(--text2);
  margin-bottom: 24px;
}

.error-container code {
  color: var(--orange);
}

.btn-retry {
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius2);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, transform 0.1s;
}

.btn-retry:hover { background: #7c74ff; }
.btn-retry:active { transform: scale(0.98); }

/* ─── SKELETONS (LOADING) ─── */
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

.menu-skeleton, .content-skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sk-item {
  height: 36px;
  background: var(--border2);
  border-radius: var(--radius2);
  animation: pulse 1.5s infinite;
}

.sk-title {
  height: 48px;
  width: 60%;
  background: var(--border2);
  border-radius: var(--radius2);
  margin-bottom: 24px;
  animation: pulse 1.5s infinite;
}

.sk-line {
  height: 18px;
  background: var(--border2);
  border-radius: 4px;
  animation: pulse 1.5s infinite;
}

.sk-line:nth-child(2) { width: 100%; }
.sk-line:nth-child(3) { width: 90%; }
.sk-line:nth-child(4) { width: 75%; }

/* ─── RESPONSIVIDADE E MENU MOBILE ─── */
.mobile-toggle {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  z-index: 100;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.mobile-toggle:hover { background: var(--bg3); }

.mobile-toggle .bar {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-toggle.active .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mobile-toggle.active .bar:nth-child(2) { opacity: 0; }
.mobile-toggle.active .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .content-area { padding: 60px 40px 60px; }
}

@media (max-width: 768px) {
  .mobile-toggle { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 20px 0 40px rgba(0,0,0,0.5);
  }

  .sidebar.active { transform: translateX(0); }

  .content-area {
    margin-left: 0;
    padding: 80px 24px 60px;
  }
}