/* ==========================================================================
   Documentación de Text2 Barcode — mismo sistema de diseño que el sitio
   principal (/assets/style.css). Sin Bootstrap, sin jQuery.
   ========================================================================== */

/* ── Topbar / breadcrumb ── */
.docs-topbar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.docs-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: var(--text-light);
}
.docs-breadcrumb a { color: var(--text-light); }
.docs-breadcrumb a:hover { color: var(--accent); }
.docs-breadcrumb .sep { color: var(--border); }
.docs-breadcrumb .current { color: var(--ink); font-weight: 600; }

.docs-ports { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.docs-port-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600;
  background: #6c757d; color: #fff;
}

/* ── Layout shell ── */
.docs-body { padding: 44px 0 96px; }
.docs-shell {
  display: flex;
  align-items: flex-start;
  gap: 44px;
}
.docs-sidebar {
  flex: 0 0 236px;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 108px);
  overflow-y: auto;
}
.docs-content { flex: 1 1 auto; min-width: 0; }

@media (max-width: 900px) {
  .docs-shell { flex-direction: column; gap: 8px; }
  .docs-sidebar {
    position: static;
    width: 100%;
    max-height: none;
    overflow: visible;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 8px;
  }
}

/* ── Sidebar nav ── */
.docs-nav-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 4px 10px;
  margin-top: 18px;
}
.docs-nav-group-label:first-child { margin-top: 0; }
.docs-nav { display: grid; gap: 1px; }
.docs-nav a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.35;
}
.docs-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.docs-nav-pages a.active { background: var(--accent-btn); color: #fff; font-weight: 600; }
.docs-nav-toc a.active { color: var(--accent); font-weight: 600; }
.docs-nav-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0 4px; }
.docs-demo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff !important;
  font-size: 0.86rem;
  font-weight: 600;
}
.docs-demo-link:hover { background: #000; }

/* ── Content typography ── */
.docs-content section[id] { scroll-margin-top: 96px; }
.docs-content h3 {
  font-size: 1.35rem;
  padding-top: 2em;
  margin-top: 0;
  border-top: 1px solid var(--border);
}
.docs-content > section:first-of-type h3,
.docs-content h3:first-of-type { padding-top: 0; border-top: none; }
.docs-content h4 {
  color: var(--accent);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1.6em;
}
.docs-content p, .docs-content li { color: var(--text); }
.docs-content code {
  background: var(--bg-soft);
  color: var(--accent-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.docs-content pre, .docs-content pre.prettyprint {
  background: var(--ink) !important;
  color: #e8e8e8 !important;
  border: none !important;
  border-radius: 12px;
  padding: 18px !important;
  margin: 0;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.65;
}
.docs-content pre code, .docs-content pre.prettyprint code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 1em;
}

/* ── Videos (responsive embed) ── */
.docs-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin: 18px 0 8px;
}
.docs-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── Simple 2-3 column reference tables ── */
.docs-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 14px 0 6px; }
.docs-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); margin: 14px 0 6px; }
.docs-table-wrap .docs-table { margin: 0; border-radius: 0; }
.docs-table th, .docs-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.docs-table thead th { background: var(--ink); color: #fff; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: none; }
.docs-table tbody tr:nth-child(even) { background: var(--bg-soft); }

/* ── API parameter / property tables ── */
.params-table, .props-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.87rem; margin: 12px 0 4px;
}
.params-table thead th, .props-table thead th {
  background: var(--bg-soft); color: var(--text-light); font-weight: 700;
  padding: 6px 10px; border: 1px solid var(--border);
  font-size: 0.74em; text-transform: uppercase; letter-spacing: 0.06px;
}
.params-table td, .props-table td {
  padding: 8px 10px; border: 1px solid var(--border);
  vertical-align: top; line-height: 1.55;
}
.params-table tbody tr:hover td, .props-table tbody tr:hover td { background: var(--bg-soft); }
.pname, .prop-name { font-family: 'Courier New', monospace; color: var(--accent-dark); font-weight: 600; white-space: nowrap; }
.ptype, .prop-type { font-style: italic; color: #0d6efd; font-size: 0.9em; white-space: nowrap; }
.prop-def { font-family: 'Courier New', monospace; color: var(--green); font-size: 0.9em; }
.preq { text-align: center; font-size: 0.9em; }
.preq-yes { color: var(--accent); font-weight: 700; }
.preq-no { color: #adb5bd; }

/* ── Images inside docs ── */
.docs-img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  background: #fff;
  margin: 10px 0;
}

/* ── Callouts ── */
.docs-note {
  background: #eef7ea;
  border-left: 4px solid var(--accent);
  padding: 14px 18px;
  margin: 16px 0;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--ink);
}
.docs-note.secondary { background: var(--bg-soft); border-left-color: var(--border); }
.note {
  background: #eef7ea !important; border-left: 4px solid var(--accent) !important;
  padding: 12px 16px !important; margin: 14px 0 !important; border-radius: 8px !important; font-size: 0.9em !important;
}

/* ── Code block labels (Uso / Respuesta) ── */
.code-label {
  font-size: 0.72em; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1px;
  margin: 20px 0 0; display: flex; align-items: center; gap: 6px;
}
.code-label::before { content: ''; display: inline-block; width: 3px; height: 10px; border-radius: 2px; background: var(--border); }
.code-label.usage::before { background: var(--ink); }
.code-label.response::before { background: var(--green); }
.code-label + pre { margin-top: 4px !important; }

/* ── Method signature card ── */
.method-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 12px 18px;
  margin: 10px 0 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.86em;
  line-height: 1.7;
}
.method-card .sig-name { color: var(--accent); font-weight: 700; }
.method-card .sig-ret { color: var(--green); font-size: 0.88em; margin-left: 4px; }
.method-card .sig-desc {
  font-family: var(--font);
  font-size: 0.87em;
  color: var(--text-light);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

/* ── Badges ── */
.badge-api {
  display: inline-block;
  font-size: 0.68rem; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
  margin-left: 8px; vertical-align: middle;
  background: var(--bg-soft); color: var(--text-light);
  border: 1px solid var(--border);
}
.badge-test {
  background: rgba(255,255,255,0.16); color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  font-size: 0.7rem; font-weight: 600;
  padding: 2px 10px; border-radius: 999px;
}

.muted { color: var(--text-light); font-size: 0.88em; }

/* ── Interactive API test panel ── */
.api-test-panel { margin-top: 16px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.api-test-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--accent-btn); padding: 10px 16px; cursor: pointer; user-select: none;
}
.api-test-header:hover { background: var(--accent-btn-dark); }
.api-test-header .test-label { font-size: 0.84em; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 6px; }
.api-test-header .test-label::before { content: '▶'; font-size: 0.7em; transition: transform 0.2s; }
.api-test-header.open .test-label::before { transform: rotate(90deg); }
.api-test-body { display: none; padding: 16px; background: var(--bg-soft); }
.api-test-body.show { display: block; }
.test-result {
  margin-top: 12px; background: var(--ink); color: #e8e8e8;
  border-radius: 8px; padding: 12px 16px; font-family: monospace; font-size: 0.8em;
  min-height: 46px; white-space: pre-wrap; word-break: break-all; display: none;
}
.test-result.show { display: block; }
.test-result.success { border-left: 3px solid var(--green); }
.test-result.error { border-left: 3px solid #dc3545; }
.test-result.info { border-left: 3px solid var(--text-light); }

/* ── Form fields (replace Bootstrap form-control/form-select) ── */
.field-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.field-group { flex: 1 1 190px; }
.field-group.grow-2 { flex-grow: 2; }
.field-group label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-light); margin-bottom: 4px;
}
.field {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.88rem; font-family: inherit; background: #fff; color: var(--text);
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,122,51,0.12); }
textarea.field { font-family: 'Courier New', monospace; font-size: 0.82rem; }
.field-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 4px; }
.inline-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.spinner-sm {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: docs-spin 0.6s linear infinite;
  display: none; vertical-align: middle; margin-right: 4px;
}
@keyframes docs-spin { to { transform: rotate(360deg); } }

/* ── Small screens ── */
@media (max-width: 600px) {
  .docs-body { padding: 28px 0 56px; }
  .field-group { flex: 1 1 100%; }
}
