/* ============================================================
   EFTELCLOUD · DOCUMENTACIÓN (estilo AWS / OVH Help Center)
   Sistema visual de guías: sidebar fija, contenidos con anclas,
   callouts, bloques de código, tablas, pasos y paginación.
   Se carga en las páginas docs.php y docs-*.php.
   ============================================================ */

/* ── Layout ──────────────────────────────────────────────── */
.docs-shell {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.docs-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 880px;
  margin: 0 auto;
}
.docs-main + .docs-sidebar { display: none; }

/* ── Sidebar ─────────────────────────────────────────────── */
.docs-sidebar {
  flex: 0 0 264px;
  min-width: 264px;
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 12px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  box-shadow: var(--ui-shadow-sm);
}
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: rgba(92,107,138,.25); border-radius: 999px; }
.docs-sidebar-home {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--ui-ink);
  transition: var(--ui-t);
}
.docs-sidebar-home i { color: var(--ui-primary); }
.docs-sidebar-home:hover { background: var(--ui-bg2); }
.docs-sidebar-home.active { background: var(--ui-primary-soft); color: var(--ui-primary); }
.docs-sidebar-title {
  margin: 14px 12px 5px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ui-faint);
}
.docs-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--ui-muted);
  transition: var(--ui-t);
}
.docs-sidebar-link i:first-child { width: 17px; text-align: center; font-size: .85rem; color: var(--ui-primary); opacity: .8; }
.docs-sidebar-link:hover { background: var(--ui-bg2); color: var(--ui-ink); }
.docs-sidebar-link.active { background: var(--ui-primary-soft); color: var(--ui-primary); font-weight: 600; }
.docs-sidebar-link--ext i:last-child { margin-left: auto; font-size: .68rem; opacity: .55; color: var(--ui-faint); }
.docs-sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--ui-border);
}

/* ── Cabecera / migas ────────────────────────────────────── */
.docs-crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .8rem;
  color: var(--ui-faint);
  margin-bottom: 18px;
}
.docs-crumb a { color: var(--ui-primary); font-weight: 500; }
.docs-crumb i { font-size: .6rem; opacity: .6; }
.docs-main h1 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.docs-lead {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ui-muted);
  max-width: 740px;
  margin-bottom: 30px;
}

/* ── Índice de contenidos (TOC) ──────────────────────────── */
.docs-toc {
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  background: var(--ui-surface);
  padding: 16px 22px 18px;
  margin-bottom: 34px;
  box-shadow: var(--ui-shadow-sm);
}
.docs-toc__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ui-ink);
  margin-bottom: 10px;
}
.docs-toc__title i { color: var(--ui-primary); }
.docs-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 28px;
}
.docs-toc li { break-inside: avoid; }
.docs-toc a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: .85rem;
  color: var(--ui-muted);
  transition: var(--ui-t);
}
.docs-toc a::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ui-border-strong);
  transition: var(--ui-t);
}
.docs-toc a:hover { color: var(--ui-primary); }
.docs-toc a:hover::before { background: var(--ui-primary); }

/* ── Contenido ───────────────────────────────────────────── */
.docs-main h2 {
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 42px 0 14px;
  padding-top: 10px;
  border-top: 1px solid var(--ui-border);
  scroll-margin-top: 110px;
}
.docs-main h3 {
  font-size: 1.03rem;
  font-weight: 700;
  margin: 26px 0 10px;
}
.docs-main p {
  font-size: .92rem;
  line-height: 1.75;
  color: var(--ui-muted);
  margin-bottom: 14px;
}
.docs-main p strong { color: var(--ui-ink); font-weight: 600; }
.docs-main a { color: var(--ui-primary); font-weight: 500; }
.docs-main ul,
.docs-main ol {
  font-size: .92rem;
  color: var(--ui-muted);
  line-height: 1.75;
  padding-left: 22px;
  margin-bottom: 16px;
}
.docs-main ul li { margin-bottom: 7px; }
.docs-main ul li::marker { color: var(--ui-primary); }
.docs-main ol li { margin-bottom: 7px; }
.docs-main ol li::marker { color: var(--ui-primary); font-weight: 700; }

/* ── Pasos numerados (estilo AWS) ────────────────────────── */
.docs-steps {
  list-style: none;
  counter-reset: docsstep;
  padding: 0;
  margin: 20px 0 24px;
}
.docs-steps li {
  counter-increment: docsstep;
  position: relative;
  padding: 0 0 22px 56px;
  margin: 0;
}
.docs-steps li::before {
  content: counter(docsstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 36px; height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  background: var(--ui-gradient);
  box-shadow: var(--ui-glow-sm);
}
.docs-steps li::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 44px;
  bottom: 4px;
  width: 2px;
  background: var(--ui-border);
}
.docs-steps li:last-child::after { display: none; }
.docs-steps li strong { color: var(--ui-ink); }

/* ── Callouts (notas) ────────────────────────────────────── */
.docs-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: 14px;
  padding: 14px 18px;
  margin: 20px 0;
  border: 1px solid transparent;
  font-size: .87rem;
  line-height: 1.65;
}
.docs-callout > i { font-size: 1.05rem; margin-top: 2px; }
.docs-callout strong { font-weight: 700; }
.docs-callout--info { background: var(--ui-info-soft); border-color: rgba(2,132,199,.2); color: #0369a1; }
.docs-callout--info > i { color: var(--ui-info); }
.docs-callout--success { background: var(--ui-success-soft); border-color: rgba(16,185,129,.22); color: #0c7a54; }
.docs-callout--success > i { color: var(--ui-success); }
.docs-callout--warning { background: var(--ui-warning-soft); border-color: rgba(180,83,9,.2); color: #92620a; }
.docs-callout--warning > i { color: var(--ui-warning); }
.docs-callout--danger { background: var(--ui-danger-soft); border-color: rgba(220,38,38,.2); color: #a81313; }
.docs-callout--danger > i { color: var(--ui-danger); }

/* ── Bloques de código ───────────────────────────────────── */
.docs-code {
  margin: 20px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--ui-shadow);
}
.docs-code__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #111a38;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8ea3d6;
}
.docs-code__bar .docs-code__dots { display: flex; gap: 5px; margin-right: 6px; }
.docs-code__bar .docs-code__dots i { width: 9px; height: 9px; border-radius: 50%; font-style: normal; }
.docs-code__bar .docs-code__dots i:nth-child(1) { background: #ff5f57; }
.docs-code__bar .docs-code__dots i:nth-child(2) { background: #febc2e; }
.docs-code__bar .docs-code__dots i:nth-child(3) { background: #28c840; }
.docs-code pre {
  margin: 0;
  padding: 16px 18px;
  background: #0d1226;
  color: #dbe4ff;
  font-size: .82rem;
  line-height: 1.65;
  overflow-x: auto;
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
}
.docs-code pre .c { color: #5d7099; }
.docs-code pre .k { color: #7dd3fc; }
.docs-code pre .s { color: #a7f3d0; }
.docs-code pre .n { color: #fde68a; }
.docs-code pre .p { color: #c4b5fd; }
.docs-code pre .m { color: #f0abfc; }

/* ── Tablas ──────────────────────────────────────────────── */
.docs-table {
  width: 100%;
  margin: 20px 0 26px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  overflow: hidden;
  font-size: .86rem;
}
.docs-table th {
  background: var(--ui-bg2);
  color: var(--ui-ink);
  font-weight: 700;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ui-border);
}
.docs-table td {
  padding: 11px 16px;
  color: var(--ui-muted);
  border-bottom: 1px solid var(--ui-border);
  vertical-align: top;
}
.docs-table tr:last-child td { border-bottom: none; }
.docs-table tbody tr { transition: background var(--ui-t); }
.docs-table tbody tr:hover { background: var(--ui-bg); }
.docs-table td code {
  font-size: .78rem;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
}
.docs-table th code { font-size: .72rem; }

/* ── Texto en línea ──────────────────────────────────────── */
.docs-main p code,
.docs-main li code {
  font-size: .8rem;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  padding: 2px 7px;
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
}
.docs-kbd {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--ui-border-strong);
  border-bottom-width: 2px;
  background: var(--ui-surface);
  font-size: .74rem;
  font-family: Consolas, "Courier New", monospace;
  color: var(--ui-text);
}

/* ── Paginación prev/next ────────────────────────────────── */
.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 52px;
  padding-top: 26px;
  border-top: 1px solid var(--ui-border);
}
.docs-pager__item {
  flex: 1;
  max-width: 45%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  color: var(--ui-ink);
  transition: var(--ui-t);
}
.docs-pager__item:hover {
  border-color: rgba(0,80,255,.3);
  box-shadow: var(--ui-shadow);
  transform: translateY(-2px);
  color: var(--ui-ink);
}
.docs-pager__item--next { text-align: right; margin-left: auto; }
.docs-pager__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ui-primary);
}
.docs-pager__item--next .docs-pager__label { justify-content: flex-end; }
.docs-pager__title { font-size: .9rem; font-weight: 600; }
.docs-pager__item--ghost { visibility: hidden; }

/* ── Hub (docs.php) ──────────────────────────────────────── */
.docs-hero {
  background:
    radial-gradient(560px 300px at 85% 10%, rgba(0,182,255,.14), transparent 62%),
    radial-gradient(460px 280px at 8% 90%, rgba(0,80,255,.2), transparent 60%),
    linear-gradient(135deg, #050a1c 0%, #081229 46%, #0d1c3f 100%);
}
.docs-hero .container { position: relative; z-index: 1; }
.docs-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 14px 18px;
  color: rgba(255,255,255,.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.docs-search:focus-within {
  border-color: rgba(0,182,255,.55);
  box-shadow: 0 0 0 4px rgba(0,182,255,.12);
}
.docs-search i { font-size: 1rem; }
.docs-search span { font-size: .92rem; }
.docs-search__input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: #fff;
  font-size: .92rem;
}
.docs-search__input::placeholder { color: rgba(255,255,255,.5); }
.docs-search__input::-webkit-search-cancel-button { display: none; }
.docs-search__results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  max-height: 380px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid rgba(2,6,23,.1);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(2,6,23,.22);
  z-index: 60;
  padding: 6px;
}
.docs-search__result {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 9px;
  text-decoration: none !important;
}
.docs-search__result:hover,
.docs-search__result.active { background: var(--ui-primary-soft); }
.docs-search__result b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--ui-ink);
}
.docs-search__result b i { color: var(--ui-primary); font-size: .82rem; }
.docs-search__result > span { font-size: .76rem; color: var(--ui-muted); line-height: 1.5; }
.docs-search__tag {
  margin-left: auto;
  flex: none;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ui-primary);
  background: var(--ui-primary-soft);
  padding: 2px 8px;
  border-radius: 99px;
}
.docs-search__empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  font-size: .85rem;
  color: var(--ui-muted);
}
.docs-search__empty i {
  font-size: .95rem;
  color: #e07a3f;
}
.docs-kbd {
  margin-left: auto;
  font-size: .72rem;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.8);
  letter-spacing: .06em;
}
.docs-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ui-ink);
  margin: 0 0 6px;
}
.docs-group-desc { font-size: .87rem; color: var(--ui-muted); margin-bottom: 18px; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.docs-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  text-decoration: none !important;
  transition: var(--ui-t);
}
.docs-card:hover { transform: translateY(-3px); box-shadow: var(--ui-shadow-lg); border-color: rgba(0,80,255,.28); }
.docs-card__icon {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
  transition: var(--ui-t);
}
.docs-card:hover .docs-card__icon { transform: scale(1.08); }
.docs-card__title { font-weight: 700; font-size: .92rem; color: var(--ui-ink); display: block; }
.docs-card__desc { display: block; margin-top: 4px; font-size: .8rem; line-height: 1.55; color: var(--ui-muted); }
.docs-card__more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ui-primary);
}
.docs-card__more i { transition: transform var(--ui-t); }
.docs-card:hover .docs-card__more i { transform: translateX(4px); }

/* ── Dark mode ───────────────────────────────────────────── */
html.dark-mode .docs-sidebar,
html.dark-mode .docs-toc,
html.dark-mode .docs-pager__item {
  background: var(--ds-card-bg) !important;
  border-color: var(--ds-border) !important;
}
html.dark-mode .docs-sidebar-home,
html.dark-mode .docs-sidebar-title,
html.dark-mode .docs-toc__title,
html.dark-mode .docs-group-title,
html.dark-mode .docs-card__title { color: var(--ds-text) !important; }
html.dark-mode .docs-sidebar-link:hover,
html.dark-mode .docs-sidebar-home:hover { background: var(--ds-input-bg); }
html.dark-mode .docs-sidebar-link.active,
html.dark-mode .docs-sidebar-home.active { background: rgba(0,80,255,.16); color: #8ab4ff; }
html.dark-mode .docs-main h2 { border-top-color: var(--ds-border); }
html.dark-mode .docs-table { border-color: var(--ds-border); }
html.dark-mode .docs-table th { background: var(--ds-input-bg); color: var(--ds-text); border-bottom-color: var(--ds-border); }
html.dark-mode .docs-table td { color: var(--ds-text-muted); border-bottom-color: var(--ds-border); }
html.dark-mode .docs-table tbody tr:hover { background: rgba(255,255,255,.03); }
html.dark-mode .docs-table td code,
html.dark-mode .docs-main p code,
html.dark-mode .docs-main li code { background: rgba(0,80,255,.2); color: #8ab4ff; }
html.dark-mode .docs-main p strong,
html.dark-mode .docs-steps li strong { color: var(--ds-text); }
html.dark-mode .docs-hero { background: linear-gradient(135deg, #050a1c, #0a0e1d 46%, #10162e); }
html.dark-mode .docs-code { border-color: var(--ds-border); }
html.dark-mode .docs-callout--info { background: rgba(2,132,199,.14); border-color: rgba(2,132,199,.25); color: #7cc4f0; }
html.dark-mode .docs-callout--success { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.25); color: #7ee2bb; }
html.dark-mode .docs-callout--warning { background: rgba(180,83,9,.14); border-color: rgba(180,83,9,.28); color: #f5c97d; }
html.dark-mode .docs-callout--danger { background: rgba(220,38,38,.14); border-color: rgba(220,38,38,.28); color: #f2959c; }
html.dark-mode .docs-search__results { background: #0d1428; border-color: var(--ds-border); box-shadow: 0 18px 44px rgba(0,0,0,.5); }
html.dark-mode .docs-search__result b { color: var(--ds-text); }
html.dark-mode .docs-search__result > span { color: var(--ds-text-muted); }
html.dark-mode .docs-search__result:hover,
html.dark-mode .docs-search__result.active { background: rgba(0,80,255,.16); }
html.dark-mode .docs-search__empty { color: var(--ds-text-muted); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .docs-shell { flex-direction: column; gap: 24px; }
  .docs-sidebar {
    position: static;
    flex: none;
    width: 100%;
    min-width: 0;
    max-height: none;
    overflow: visible;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .docs-sidebar-home { width: 100%; }
  .docs-sidebar-title { width: 100%; }
  .docs-sidebar-foot { width: 100%; }
  .docs-toc ul { columns: 1; }
}
@media (max-width: 575.98px) {
  .docs-pager { flex-direction: column; }
  .docs-pager__item { max-width: none; }
  .docs-pager__item--next { text-align: left; margin-left: 0; }
  .docs-pager__item--next .docs-pager__label { justify-content: flex-start; }
  .docs-hero .docs-kbd { display: none; }
}