/* ============================================================================
   commandes-slash-app.css — layout 2 cols (menu violet Discord + fiche)
   pour commandes-slash.php (et reutilisable pour features.php)
   v2 — 2026-05-05 :
     • cache le c2o-sidebar general sur ces pages, ajout mini-topbar logo+lien
     • titres de groupes du menu gauche en vert flashy
     • panneau fiche : bordure blurple + fond violet pale
     • mobile : focus scroll sur la fiche apres clic (gere en JS)
   ============================================================================ */

/* === Cacher le sidebar c2o general sur ces pages ===
   .tcs-page-shell est ajoute par le PHP. On utilise :has() en fallback. */
.tcs-page-shell .c2o-sidebar,
.c2o-shell:has(.tcs-app) .c2o-sidebar { display: none !important; }
.tcs-page-shell .c2o-shell,
.c2o-shell:has(.tcs-app) { grid-template-columns: 1fr !important; }
.tcs-page-shell .c2o-mobile-bar,
.c2o-shell:has(.tcs-app) .c2o-mobile-bar { display: none !important; }

/* === Mini topbar (logo + Main Menu link) === */
.tcs-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: linear-gradient(145deg, rgba(88,101,242,0.08), rgba(88,101,242,0.02));
  border: 1px solid rgba(88,101,242,0.18);
  border-radius: 12px;
  margin: 0 0 14px;
  font-family: 'Inter', system-ui, sans-serif;
}
.tcs-topbar__logo {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.tcs-topbar__home {
  color: #4752c4;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.tcs-topbar__home::before { content: "←"; font-weight: 700; }
.tcs-topbar__home:hover { color: #5865f2; text-decoration: underline; }
.tcs-topbar__title {
  font-size: 14px;
  color: #6b5a30;
  margin-left: auto;
}
.tcs-topbar__sep { width: 1px; height: 18px; background: rgba(88,101,242,0.25); }

/* === Titre principal de la page (H1 centre, plus gros) ===
   Concu pour rester dans un .panel — pas de marge externe (le panel a son padding) */
.tcs-page-title {
  text-align: center;
  font-size: 30px;
  line-height: 1.2;
  margin: 0;
  color: #5a4316;
  letter-spacing: 0.01em;
  font-weight: 700;
}
@media (max-width: 600px) {
  .tcs-page-title { font-size: 22px; }
}

/* ============================================================================
   Conteneur principal : 2 colonnes
   ============================================================================ */
.tcs-app {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  margin: 12px 0 24px;
  align-items: start;
  min-height: 60vh;
}

/* ============================================================================
   MENU GAUCHE — violet Discord (blurple #5865f2)
   ============================================================================ */
.tcs-menu {
  background: linear-gradient(180deg, #5865f2 0%, #4752c4 100%);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(70, 80, 200, 0.18);
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  color: #fff;
  font-family: 'gg sans', 'Inter', system-ui, sans-serif;
}

.tcs-menu__head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.16);
  display: flex; align-items: center; gap: 8px;
}
.tcs-menu__title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  flex: 1;
}
.tcs-menu__count {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.tcs-menu__filter {
  margin: 8px 16px;
  width: calc(100% - 32px);
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  padding: 8px 10px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.tcs-menu__filter::placeholder { color: rgba(255,255,255,0.55); }
.tcs-menu__filter:focus { border-color: rgba(255,255,255,0.35); background: rgba(0,0,0,0.30); }

.tcs-menu__list {
  overflow-y: auto;
  padding: 6px 8px 14px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.30) transparent;
}
.tcs-menu__list::-webkit-scrollbar { width: 8px; }
.tcs-menu__list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.28); border-radius: 4px; }
.tcs-menu__list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.45); }

/* === GROUP TITLES — vert flashy === */
.tcs-menu__group {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7cf09e;
  text-shadow: 0 0 8px rgba(124,240,158,0.35);
  padding: 14px 10px 4px;
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid rgba(124,240,158,0.18);
  margin: 0 -2px 4px;
}
.tcs-menu__group::before {
  content: "▸";
  color: #7cf09e;
  font-size: 10px;
  opacity: 0.7;
}

.tcs-menu__item {
  display: block;
  padding: 7px 10px;
  margin: 1px 0;
  border-radius: 4px;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  word-break: break-word;
  line-height: 1.35;
  transition: background 0.10s ease;
  position: relative;
}

/* === Sous-titre Cadres / Membres dans le menu (sobre, pas bold, pas indent) === */
.tcs-menu__sub-group {
  font-size: 13.5px;                       /* meme taille que les items */
  font-weight: 500;                        /* pas de bold */
  color: rgba(255,255,255,0.82);           /* meme couleur que les items */
  padding: 8px 10px 2px;                   /* meme indent horizontal que les items */
  margin: 6px 0 0;
  border-top: 1px dotted rgba(255,255,255,0.18);
  text-decoration: underline;              /* souligne pour distinguer */
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  letter-spacing: 0.02em;
}
.tcs-menu__sub-group:first-of-type { border-top: none; padding-top: 4px; }
.tcs-menu__item:hover {
  background: rgba(255,255,255,0.10);
  color: #fff;
  text-decoration: none;
}
.tcs-menu__item--active {
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-weight: 600;
}
.tcs-menu__item--active::before {
  content: "";
  position: absolute;
  left: -8px; top: 6px; bottom: 6px;
  width: 4px;
  background: #7cf09e;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px rgba(124,240,158,0.6);
}
.tcs-menu__cmd {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12.5px;
  display: block;
}
.tcs-menu__hint {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-family: 'gg sans', 'Inter', system-ui, sans-serif;
  font-weight: 400;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tcs-menu__empty {
  padding: 20px 14px;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  text-align: center;
  font-style: italic;
}

/* ============================================================================
   ZONE FICHE DROITE
   ============================================================================ */
.tcs-cards { min-width: 0; }

.tcs-card {
  display: none;
  /* === Fond violet tres pale + bordure blurple === */
  background: #f7f8ff;
  border: 2px solid #5865f2;
  border-radius: 14px;
  padding: 18px 22px 22px;
  box-shadow: 0 6px 18px rgba(88, 101, 242, 0.10);
}
.tcs-card--active { display: block; animation: tcs-fade 0.18s ease-out; }
@keyframes tcs-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tcs-card__group-tag {
  display: inline-block;
  background: #5865f2;
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.tcs-card__group-tag--cli      { background: #6b5a30; }
.tcs-card__group-tag--votes    { background: #eb459e; }
.tcs-card__group-tag--member   { background: #23a55a; }
.tcs-card__group-tag--position { background: #f0731c; }
.tcs-card__group-tag--metiers  { background: #1abc9c; }
.tcs-card__group-tag--couillu  { background: #ad6cd2; }
.tcs-card__group-tag--types    { background: #a17b27; }
.tcs-card__group-tag--python   { background: #3776ab; }

.tcs-card__title {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 18px;
  font-weight: 400;      /* pas de gras : le monospace suffit a marquer le titre */
  color: #5a4316;        /* on garde la couleur du reste du site */
  word-break: break-word;
  margin: 0 0 6px;
}
.tcs-card__subtitle {
  font-size: 14px;
  color: #6b5a30;
  margin: 0 0 14px;
  font-style: italic;
}
.tcs-card__authority {
  display: inline-block;
  background: #fff6de;
  color: #8a6200;
  border: 1px solid #e0c87a;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin: 4px 0 14px;
}
.tcs-card__body { color: #2a2218; line-height: 1.55; }
.tcs-card__body p { margin: 0 0 10px; }
.tcs-card__body p:last-child { margin-bottom: 0; }
.tcs-card__body code {
  background: #fff;
  color: #5a4316;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  border: 1px solid rgba(88,101,242,0.18);
}
.tcs-card__body strong { color: #5a4316; }

.tcs-card__examples {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(88,101,242,0.10);
  border-left: 3px solid #5865f2;
  border-radius: 6px;
}
.tcs-card__examples h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #5a4316;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tcs-card__related {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(88,101,242,0.25);
  font-size: 13px;
  color: #6b5a30;
}
.tcs-card__related a { color: #4752c4; font-weight: 600; }

/* === Tutoriel inline (accordeon details/summary) === */
.tcs-card__tutorial {
  margin-top: 16px;
  border: 1px solid rgba(88,101,242,0.25);
  border-radius: 8px;
  background: rgba(255,255,255,0.6);
  overflow: hidden;
}
.tcs-card__tutorial[open] {
  background: rgba(255,255,255,0.85);
}
.tcs-card__tutorial-summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  color: #4752c4;
  font-size: 14px;
  user-select: none;
  list-style: none;
  background: rgba(88,101,242,0.06);
  transition: background 0.15s;
}
.tcs-card__tutorial-summary:hover { background: rgba(88,101,242,0.12); }
.tcs-card__tutorial-summary::-webkit-details-marker { display: none; }
.tcs-card__tutorial[open] .tcs-card__tutorial-summary {
  border-bottom: 1px solid rgba(88,101,242,0.18);
}
.tcs-card__tutorial[open] .tcs-card__tutorial-summary::before {
  content: "▾ ";
}
.tcs-card__tutorial:not([open]) .tcs-card__tutorial-summary {
  /* le ▸ vient du PHP (texte) — rien a faire ici, mais permet de remplacer le caret */
}
.tcs-card__tutorial[open] .tcs-card__tutorial-summary {
  /* on remplace le caret du PHP par ▾ via ::before quand open */
}
.tcs-card__tutorial-body {
  padding: 14px 16px;
}
.tcs-card__tutorial-body .dm-step {
  margin: 12px 0;     /* serrer les steps dans le panel */
}
.tcs-card__tutorial-body .dm-step:first-child { margin-top: 0; }
.tcs-card__tutorial-body .dm-step:last-child  { margin-bottom: 0; }

/* Bouton retour menu — visible uniquement sur mobile */
.tcs-card__back-to-menu {
  display: none;
  margin-top: 18px;
  text-align: center;
}
.tcs-card__back-to-menu a {
  display: inline-block;
  background: #5865f2;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 900px) {
  .tcs-app { grid-template-columns: 1fr; gap: 12px; }
  .tcs-menu {
    position: static;
    max-height: 50vh;
  }
  /* Sur mobile : ancrage du scroll vers la fiche */
  .tcs-cards { scroll-margin-top: 12px; }
  .tcs-card--active .tcs-card__back-to-menu { display: block; }
}
@media (max-width: 600px) {
  .tcs-card { padding: 14px 16px; }
  .tcs-card__title { font-size: 15px; }
  .tcs-topbar { padding: 6px 10px; gap: 8px; }
  .tcs-topbar__title { display: none; }
}

/* ============================================================================
   ANCRES (vieux liens en #cmd-xxx restent fonctionnels mais ne se cassent pas)
   ============================================================================ */
.tcs-card[id] { scroll-margin-top: 80px; }
