/* ============================================================
   YOKAI DOC – STYLES SPÉCIFIQUES À LA DOCUMENTATION
   Hérite de ../css/style.css (chargé en premier)
   ============================================================ */

/* ── Layout doc : sidebar + contenu ── */
.doc-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  padding-top: 65px; /* hauteur navbar */
}

/* ── Sidebar ── */
.doc-sidebar {
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
  background: rgba(11, 23, 38, 0.6);
  border-right: 1px solid var(--border-subtle);
  padding: 2rem 0;
  backdrop-filter: blur(8px);
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}

.doc-sidebar::-webkit-scrollbar { width: 4px; }
.doc-sidebar::-webkit-scrollbar-track { background: transparent; }
.doc-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 2px;
}

.doc-sidebar__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.doc-sidebar__label:first-child { margin-top: 0; }

.doc-sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.45rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  text-decoration: none;
}

.doc-sidebar__link:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.03);
}

.doc-sidebar__link.active {
  color: var(--sky-400);
  border-left-color: var(--sky-400);
  background: rgba(14,165,233,0.06);
}

.doc-sidebar__link svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.doc-sidebar__link.active svg { opacity: 1; }

/* Sous-lien (fonctionnalité dans une catégorie) */
.doc-sidebar__sublink {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1.5rem 0.35rem 2.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}

/* Trait animé au survol */
.doc-sidebar__sublink::before {
  content: "";
  position: absolute;
  left: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: width 0.22s var(--transition-smooth);
}

.doc-sidebar__sublink:hover::before { width: 0.7rem; }

.doc-sidebar__sublink:hover {
  color: var(--text-secondary);
  padding-left: 3.45rem;
  transition: color 0.15s, padding-left 0.22s var(--transition-smooth);
}

.doc-sidebar__sublink.active {
  color: var(--sky-400);
  border-left-color: rgba(14,165,233,0.4);
}

.doc-sidebar__sublink.active::before { width: 0; }

/* ── Contenu doc ── */
.doc-content {
  min-width: 0;
  padding: 3rem 4rem 6rem;
}

/* ── Section catégorie ── */
.doc-category {
  margin-bottom: 5rem;
  scroll-margin-top: 90px;
}

.doc-category__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.doc-category__icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-category__title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.doc-category__desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 2.5rem;
}

/* ── Sous-section fonctionnalité ── */
.doc-feature {
  margin-bottom: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  scroll-margin-top: 90px;
}

.doc-feature:first-of-type { border-top: none; padding-top: 0; }

.doc-feature__header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.doc-feature__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-feature__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.doc-feature__desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* ── Commandes ── */
.cmd-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-bottom: 1.25rem;
}

.cmd-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.875rem;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.2s;
}

.cmd-card:hover { border-color: var(--border-mid); }

.cmd-card--full { grid-column: 1 / -1; }

.cmd-card__name {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--sky-400);
  margin-bottom: 0.5rem;
  display: block;
}

.cmd-card__desc {
  font-size: 0.8375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.cmd-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cmd-card__usage,
.cmd-card__example {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.cmd-card__usage code,
.cmd-card__example code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: rgba(255,255,255,0.05);
  padding: 0.1em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.85em;
  color: var(--text-secondary);
}

.cmd-card__perm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  background: rgba(255,255,255,0.04);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.cmd-card__perm--admin { color: #fcd34d; border-color: rgba(252,211,77,0.15); background: rgba(252,211,77,0.05); }
.cmd-card__perm--mod   { color: #86efac; border-color: rgba(134,239,172,0.15); background: rgba(134,239,172,0.05); }
.cmd-card__perm--all   { color: var(--sky-400); border-color: rgba(14,165,233,0.15); background: rgba(14,165,233,0.05); }
.cmd-card__perm--owner { color: #f0abfc; border-color: rgba(240,171,252,0.15); background: rgba(240,171,252,0.05); }

/* ── Blocs info / config ── */
.doc-info {
  border-radius: 0.875rem;
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}

.doc-info--config {
  background: rgba(14,165,233,0.06);
  border: 1px solid rgba(14,165,233,0.15);
}

.doc-info--tip {
  background: rgba(109,40,217,0.06);
  border: 1px solid rgba(109,40,217,0.18);
}

.doc-info--how {
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.15);
}

.doc-info__icon { flex-shrink: 0; margin-top: 0.1rem; }

.doc-info__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.doc-info__body {
  font-size: 0.8375rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.doc-info__body code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: rgba(255,255,255,0.07);
  padding: 0.1em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
  color: var(--sky-400);
}

.doc-info__body ul {
  list-style: none;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.doc-info__body li::before { content: "·  "; color: var(--text-muted); }

/* ── Bloc "modules" (config page) ── */
.config-modules {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: 1fr 1fr;
  margin-top: 1.5rem;
}

.config-module {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 0.875rem;
  padding: 1.25rem 1.5rem;
}

.config-module__head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

.config-module__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.config-module__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.config-module__list li {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.config-module__list li::before { content: "→  "; color: var(--border-mid); }

/* ── Bouton flottant retiré : on utilise le burger de la navbar ── */
.doc-mobile-toggle {
  display: none !important;
}

/* Overlay sombre derrière la sidebar ouverte (mobile) */
.doc-sidebar__overlay {
  display: none;
  position: fixed;
  inset: 65px 0 0 0;
  background: rgba(4, 13, 26, 0.6);
  backdrop-filter: blur(2px);
  z-index: 140;
}

.doc-sidebar__overlay.show { display: block; }

@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; }

  .doc-sidebar {
    position: fixed;
    top: 65px;
    left: -280px;
    width: 260px;
    height: calc(100vh - 65px);
    z-index: 150;
    transition: left 0.3s var(--transition-smooth);
    border-right: 1px solid var(--border-mid);
  }

  .doc-sidebar.open { left: 0; }

  .doc-content { padding: 2rem 1.5rem 5rem; }

  .cmd-grid { grid-template-columns: 1fr; }

  .config-modules { grid-template-columns: 1fr; }

  /* Le burger de la navbar pilote la sidebar dans la doc */
  .navbar__burger { display: block; }
}
