:root {
  --bg-color: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent: #ec4899;
  --code-bg: #0b1120;
  --border-color: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  position: relative;
  height: 90px;
  overflow: hidden;
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 2rem;
}

.background-shapes .shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  z-index: 0;
  opacity: 0.4;
}

.shape-1 {
  width: 140px;
  height: 140px;
  background: var(--primary);
  top: -20px;
  left: 10%;
}

.shape-2 {
  width: 180px;
  height: 180px;
  background: var(--accent);
  bottom: -40px;
  right: 15%;
}

.topbar-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #818cf8, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge {
  font-size: 0.75rem;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Layout */
.layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 90px);
}

/* Sidebar */
.sidebar {
  width: 320px;
  background: #111827;
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.search-box label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
}

.menu-section h3 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.doc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.doc-list li {
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.doc-list li:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

.empty-msg {
  background: transparent !important;
  color: var(--text-muted);
  font-size: 0.8rem !important;
  cursor: default !important;
}

/* Contenido Principal y Tarjetas */
.content-area {
  flex: 1;
  padding: 2.5rem;
  max-width: 1100px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--surface);
  padding: 1.3rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.card h4 {
  margin-bottom: 0.5rem;
  color: #fff;
}

.card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Visor de Markdown (Estilo Documentación Oficial) */
.btn-back {
  background: var(--surface);
  color: #cbd5e1;
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 1.5rem;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-back:hover {
  background: var(--surface-hover);
  color: #fff;
}

.markdown-body {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  line-height: 1.7;
  color: #e2e8f0;
}

.markdown-body h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  color: #fff;
}

.markdown-body h2 {
  font-size: 1.4rem;
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
  color: #f1f5f9;
}

.markdown-body h3 {
  font-size: 1.1rem;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}

.markdown-body p {
  margin-bottom: 1rem;
}

.markdown-body ul, .markdown-body ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.markdown-body li {
  margin-bottom: 0.3rem;
}

/* Código en línea y bloques de código */
.markdown-body code {
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88rem;
  color: #38bdf8;
}

.markdown-body pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.2rem;
  border: 1px solid var(--border-color);
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  color: #e2e8f0;
}

.markdown-body blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.markdown-body img {
  max-width: 65%;
  height: auto;
  border-radius: 8px;
  margin: 1.2rem auto;
  display: block;
  border: 1px solid var(--border-color);
  background: #0b1120;
}