/* ═══════════════════════════════════════════════════════
   FrameForge — Docs Stylesheet
   Comparte las mismas variables CSS que styles.css
   ═══════════════════════════════════════════════════════ */

/* ── Variables (duplicadas para que docs funcione standalone) ── */
:root {
  --accent:       #a259ff;
  --accent-dark:  #7c3fd6;
  --accent-glow:  rgba(162, 89, 255, .2);
  --red:          #ff4f4f;
  --green:        #4cca7d;
  --orange:       #f0a060;
  --bg:           #0a0a0f;
  --bg-1:         #111118;
  --bg-2:         #18181f;
  --bg-3:         #1f1f28;
  --bg-4:         #27272f;
  --border:       #2a2a38;
  --border-light: #33334a;
  --text:         #eeeef5;
  --text-muted:   #9090a8;
  --text-dim:     #55556a;
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;
  --shadow:       0 4px 24px rgba(0,0,0,.5);
  --sidebar-w:    260px;
  --topbar-h:     52px;
}

[data-theme="light"] {
  --accent:       #7c3fd6;
  --accent-dark:  #5f27b0;
  --accent-glow:  rgba(124, 63, 214, .15);
  --red:          #d93636;
  --green:        #2a9c5e;
  --orange:       #c47020;
  --bg:           #f4f4f8;
  --bg-1:         #ffffff;
  --bg-2:         #ededf2;
  --bg-3:         #e2e2ea;
  --bg-4:         #d4d4e0;
  --border:       #c4c4d4;
  --border-light: #b0b0c8;
  --text:         #13131e;
  --text-muted:   #4a4a6a;
  --text-dim:     #8888aa;
  --shadow:       0 4px 24px rgba(0,0,0,.1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    --accent:       #7c3fd6;
    --accent-dark:  #5f27b0;
    --accent-glow:  rgba(124, 63, 214, .15);
    --red:          #d93636;
    --green:        #2a9c5e;
    --orange:       #c47020;
    --bg:           #f4f4f8;
    --bg-1:         #ffffff;
    --bg-2:         #ededf2;
    --bg-3:         #e2e2ea;
    --bg-4:         #d4d4e0;
    --border:       #c4c4d4;
    --border-light: #b0b0c8;
    --text:         #13131e;
    --text-muted:   #4a4a6a;
    --text-dim:     #8888aa;
    --shadow:       0 4px 24px rgba(0,0,0,.1);
  }
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

/* ═══════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════ */
.docs-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.docs-topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.docs-topbar-brand .hl { color: var(--accent); }
.docs-topbar-brand .sep { color: var(--text-dim); font-weight: 400; margin: 0 2px; }

.docs-topbar-badge {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px 8px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.docs-topbar-spacer { flex: 1; }

.docs-topbar-actions { display: flex; align-items: center; gap: 6px; }

.docs-topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .2s, color .2s, background .15s;
  white-space: nowrap;
  min-height: 44px;
  touch-action: manipulation;
}

.docs-topbar-btn:hover { border-color: var(--accent); color: var(--text); background: var(--bg-4); }
.docs-topbar-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.docs-topbar-btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* Hamburger (mobile) */
.docs-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 13px;
  font-size: 1rem;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  transition: border-color .2s, color .2s;
}

.docs-menu-toggle:hover { border-color: var(--accent); color: var(--text); }

@media (max-width: 768px) {
  .docs-menu-toggle { display: flex; align-items: center; }
  
  /* Hide text labels on narrow screens, keep icons */
  .docs-topbar-btn:not(.primary) span { display: none; }
  .docs-topbar-btn:not(.primary) { padding: 10px; min-width: 44px; justify-content: center; }
  
  /* Keep primary button visible but more compact */
  .docs-topbar-btn.primary { padding: 10px 14px; font-size: .78rem; }
  .docs-topbar-btn.primary i[data-lucide] svg { width: 14px; height: 14px; }
  
  /* Theme button larger touch target */
  #btn-theme { padding: 10px; min-width: 44px; font-size: 1.1rem; }
}

@media (max-width: 480px) {
  /* On very small screens: only hamburger, brand, and theme */
  .docs-topbar-btn.primary { display: none; }
  .docs-topbar { padding: 0 12px; gap: 8px; }
  .docs-topbar-brand { font-size: .88rem; }
}

/* ═══════════════════════════════════════════════════════
   LAYOUT: SIDEBAR + MAIN
   ═══════════════════════════════════════════════════════ */
.docs-layout {
  display: flex;
  margin-top: var(--topbar-h);
  flex: 1;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Sidebar ── */
.docs-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  transition: transform .25s ease;
}

.docs-sidebar-inner { padding: 16px 0 24px; }

.docs-nav-section { margin-bottom: 4px; }

.docs-nav-label {
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  padding: 14px 18px 4px;
  display: block;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .83rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
  cursor: pointer;
  min-height: 48px;
}

.docs-nav-link:hover {
  background: var(--bg-2);
  color: var(--text);
}

.docs-nav-link.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.docs-nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Mobile sidebar overlay */
@media (max-width: 768px) {
  .docs-sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    height: calc(100vh - var(--topbar-h));
    z-index: 150;
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }

  .docs-sidebar.open { transform: translateX(0); }

  .docs-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0,0,0,.6);
    z-index: 140;
    backdrop-filter: blur(2px);
  }

  .docs-sidebar-backdrop.open { display: block; }
}

/* ── Main content ── */
.docs-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.docs-content {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

@media (max-width: 900px) {
  .docs-content { padding: 28px 20px 60px; }
}

@media (max-width: 480px) {
  .docs-content { padding: 20px 14px 48px; }
}

/* ── Loading ── */
.docs-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--text-dim);
}

.docs-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bg-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   MARKDOWN CONTENT STYLES
   ═══════════════════════════════════════════════════════ */
.docs-md h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 10px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}

.docs-md h1 .hl { color: var(--accent); }

.docs-md h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  margin: 2.4rem 0 .8rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.docs-md h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 1.8rem 0 .6rem;
}

.docs-md h4 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 1.4rem 0 .5rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.docs-md p {
  color: var(--text-muted);
  margin: .8rem 0;
  font-size: .92rem;
  line-height: 1.75;
}

.docs-md strong { color: var(--text); font-weight: 700; }

.docs-md em { color: var(--text-muted); font-style: italic; }

.docs-md ul, .docs-md ol {
  margin: .8rem 0 .8rem 1.4rem;
  color: var(--text-muted);
  font-size: .92rem;
}

.docs-md li { margin: .35rem 0; line-height: 1.7; }

.docs-md li strong { color: var(--text); }

.docs-md code {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-family: 'Consolas', 'Cascadia Code', monospace;
  font-size: .85em;
}

.docs-md pre {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 1.2rem 0;
  -webkit-overflow-scrolling: touch;
}

.docs-md pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.7;
}

.docs-md blockquote {
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  padding: 10px 16px;
  margin: 1.2rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.docs-md blockquote p { margin: .3rem 0; font-size: .88rem; }

.docs-md hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.8rem 0;
}

.docs-md a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color .15s;
}

.docs-md a:hover { border-bottom-color: var(--accent); }

.docs-md img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1rem 0;
}

.docs-md table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: .88rem;
  overflow-x: auto;
  display: block;
  -webkit-overflow-scrolling: touch;
}

.docs-md th, .docs-md td {
  padding: 9px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .docs-md th, .docs-md td { padding: 7px 10px; font-size: .82rem; }
}

.docs-md th {
  background: var(--bg-2);
  color: var(--accent);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.docs-md tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }

/* ═══════════════════════════════════════════════════════
   MOCKUP COMPONENTS (para las páginas de docs)
   ═══════════════════════════════════════════════════════ */
.mock-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
}

.mock-panel-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: .78rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.mock-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.mock-label { font-size: .75rem; color: var(--text-muted); }

.mock-hint { font-size: .7rem; color: var(--text-dim); margin-bottom: 8px; }

.mock-buttons { display: flex; gap: 7px; flex-wrap: wrap; }
.mock-buttons button { pointer-events: none; opacity: .85; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
}

.btn-p { background: var(--accent); color: #fff; }
.btn-s { background: var(--bg-4); color: var(--text-muted); border: 1px solid var(--border); }
.btn-g { background: var(--green); color: #fff; }

/* Anim list mockup */
.mock-anim-layout { display: flex; gap: 14px; flex-wrap: wrap; margin: 16px 0; }
.mock-anim-sidebar { flex: 0 0 180px; min-width: 0; }
.mock-anim-main { flex: 1; min-width: 200px; }

.ai {
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid transparent;
  min-height: 42px;
  margin-bottom: 4px;
}
.ai.sel { border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, transparent); }
.ai-name { font-size: .8rem; font-weight: 700; flex: 1; }
.ai-info { font-size: .66rem; color: var(--text-dim); }

.mock-preview {
  background: repeating-conic-gradient(var(--bg-3) 0% 25%, var(--bg-2) 0% 50%) 0 0 / 14px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: .85rem;
  margin-bottom: 10px;
}

.folder-drop {
  background: var(--bg-2);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px 16px;
  text-align: center;
  margin: 16px 0;
}

.folder-ico { font-size: 2rem; margin-bottom: 6px; }
.folder-lbl { font-size: .83rem; color: var(--text-muted); line-height: 1.6; }
.folder-lbl b { color: var(--text); }
.folder-lbl span { font-size: .73rem; color: var(--text-dim); }

/* Radio group mockup */
.mock-radio-group { display: flex; flex-direction: column; gap: 7px; padding: 4px 0; }
.mock-radio-group label {
  display: flex; align-items: center; gap: 8px;
  font-size: .83rem; color: var(--text-muted); cursor: pointer;
}
.mock-radio-group input[type="radio"] { accent-color: var(--accent); }

/* Mock select */
.mock-select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 5px 8px;
  font-size: .82rem;
  min-height: 34px;
}

/* BTA blur panel */
.mock-blur-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mock-blur-row input[type="range"] { flex: 1; min-width: 80px; accent-color: var(--orange); }
.mock-blur-val { font-size: .82rem; color: var(--orange); min-width: 28px; text-align: right; }

/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */
.docs-footer {
  border-top: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-dim);
  font-size: .75rem;
}

.docs-footer a { color: var(--accent); text-decoration: none; }
.docs-footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .docs-footer { padding: 14px 14px; flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ═══════════════════════════════════════════════════════
   LUCIDE ICONS — docs
   ═══════════════════════════════════════════════════════ */
i[data-lucide] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1;
}

i[data-lucide] svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Nav icons */
.docs-nav-icon i[data-lucide] svg { width: 16px; height: 16px; }

/* Topbar buttons */
.docs-topbar-btn i[data-lucide] svg { width: 15px; height: 15px; }
.docs-menu-toggle i[data-lucide] svg { width: 18px; height: 18px; }
