/* ══════════════════════════════════════════════════════════════
   RichEditor CSS — porté depuis Pokeswidou pour SwidCine.
   Bloc d'alias : mappe les variables Pokeswidou vers celles de SwidCine.
════════════════════════════════════════════════════════════════ */
.re-wrap, .re-modal-overlay, .rich-content {
  --card: var(--bg2);
  --primary: var(--accent);
  --text-muted: var(--text3);
  --text-dim: var(--text2);
  --radius-lg: 14px;
  --shadow: 0 8px 32px rgba(0,0,0,.4);
}
/* Boutons & inputs utilisés par le markup de l'éditeur (absents de SwidCine) */
.re-wrap .btn-primary, .re-modal .btn-primary { background: var(--accent); color:#0a0a0f; font-weight:600; }
.re-wrap .btn-primary:hover, .re-modal .btn-primary:hover { background:#f0d040; }
.re-wrap .btn-outline, .re-modal .btn-outline { background:transparent; border:1px solid var(--border2); color:var(--text2); }
.re-wrap .btn-outline:hover, .re-modal .btn-outline:hover { background:var(--bg3); color:var(--text); }
.re-wrap .form-control, .re-modal .form-control { width:100%; background:var(--bg3); border:1px solid var(--border); color:var(--text); padding:9px 12px; border-radius:8px; font-size:14px; font-family:inherit; outline:none; }
.re-wrap .form-control:focus, .re-modal .form-control:focus { border-color:var(--accent); }
.re-modal select.form-control { cursor:pointer; }

/* ===== CONTAINER ===== */
.re-wrap {
  display:flex; flex-direction:column;
  height:auto; min-height:340px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  overflow:hidden;
  box-shadow:var(--shadow);
}
.re-wrap.re-compact { height:auto; min-height:280px; }

/* ===== TOOLBAR ===== */
.re-wrap .re-toolbar {
  background:var(--bg3);
  border-bottom:1px solid var(--border);
  padding:5px 8px;
  display:flex; flex-wrap:wrap; gap:2px; align-items:center;
}
.re-wrap .tb-group { display:flex; align-items:center; gap:2px; }
.re-wrap .tb-sep { width:1px; height:22px; background:var(--border); margin:0 5px; flex-shrink:0; }

.re-wrap .tb-btn {
  position:relative; display:inline-flex; align-items:center; justify-content:center;
  min-width:28px; height:28px; padding:0 5px;
  border:none; background:transparent; color:var(--text);
  border-radius:4px; cursor:pointer; font-size:13px;
  transition:background .12s, color .12s;
  white-space:nowrap; gap:4px; font-family:inherit;
}
.re-wrap .tb-btn:hover { background:rgba(255,255,255,.08); }
.re-wrap .tb-btn.active { background:var(--primary); color:#0a0a0f; }
.re-wrap .tb-btn[data-tip]:hover::after {
  content:attr(data-tip);
  position:absolute; bottom:-30px; left:50%; transform:translateX(-50%);
  background:#0f172a; color:#e2e8f0; font-size:11px;
  padding:3px 8px; border-radius:4px; white-space:nowrap;
  z-index:2000; pointer-events:none; border:1px solid var(--border);
}

.re-wrap .tb-select {
  background:var(--bg); border:1px solid var(--border); color:var(--text);
  border-radius:4px; padding:2px 5px; font-size:12px; cursor:pointer;
  height:28px; font-family:inherit; outline:none;
}
.re-wrap .tb-select:focus { border-color:var(--primary); }

/* ===== COLOR PICKER ===== */
.re-wrap .color-wrap { position:relative; }
.re-wrap .color-btn {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:2px; min-width:28px; height:28px; padding:0 5px;
  border:none; background:transparent; cursor:pointer; border-radius:4px;
  color:var(--text); font-size:11px;
}
.re-wrap .color-btn:hover { background:rgba(255,255,255,.08); }
.re-wrap .color-bar { width:18px; height:3px; border-radius:2px; }

.re-wrap .color-palette {
  position:absolute; top:35px; left:0;
  background:var(--card); border:1px solid var(--border);
  border-radius:10px; padding:10px; z-index:800;
  display:none; min-width:196px;
  box-shadow:0 8px 32px rgba(0,0,0,.4);
}
.re-wrap .color-palette.open { display:block; }
.re-wrap .color-grid { display:grid; grid-template-columns:repeat(10,17px); gap:3px; margin-bottom:8px; }
.re-wrap .c-swatch {
  width:17px; height:17px; border-radius:3px; cursor:pointer;
  border:1px solid rgba(255,255,255,.1); transition:transform .1s, box-shadow .1s;
}
.re-wrap .c-swatch:hover { transform:scale(1.35); box-shadow:0 0 0 2px #fff3; }
.re-wrap .color-custom {
  display:flex; align-items:center; gap:8px;
  border-top:1px solid var(--border); padding-top:7px;
}
.re-wrap .color-custom input[type=color] { width:28px; height:24px; border:none; background:none; cursor:pointer; padding:0; border-radius:3px; }
.re-wrap .color-custom span { font-size:11px; color:var(--text-muted); }

/* ===== TABLE PICKER ===== */
.re-wrap .table-wrap { position:relative; }
.re-wrap .table-popup {
  position:absolute; top:35px; left:0;
  background:var(--card); border:1px solid var(--border);
  border-radius:10px; padding:10px; z-index:800;
  display:none; box-shadow:0 8px 32px rgba(0,0,0,.4);
}
.re-wrap .table-popup.open { display:block; }
.re-wrap .table-grid-ui { display:grid; grid-template-columns:repeat(10,19px); gap:3px; }
.re-wrap .tg-cell {
  width:19px; height:19px; border:1px solid var(--border);
  border-radius:2px; cursor:pointer; background:var(--bg3);
  transition:all .08s;
}
.re-wrap .tg-cell.hl { background:var(--primary); border-color:var(--primary); }
.re-wrap .tg-label { text-align:center; font-size:11px; color:var(--text-muted); margin-top:6px; }

/* ===== EMOJI / SPECIAL ===== */
.re-wrap .float-popup {
  position:absolute; top:35px; left:0;
  background:var(--card); border:1px solid var(--border);
  border-radius:10px; padding:10px; z-index:800;
  display:none; box-shadow:0 8px 32px rgba(0,0,0,.4);
}
.re-wrap .float-popup.open { display:block; }
.re-wrap .emoji-grid { display:flex; flex-wrap:wrap; gap:3px; width:260px; max-height:220px; overflow-y:auto; }
.re-wrap .e-btn {
  font-size:19px; cursor:pointer; padding:3px 4px;
  border-radius:4px; border:none; background:transparent; line-height:1;
}
.re-wrap .e-btn:hover { background:var(--border); }
.re-wrap .spec-grid { display:flex; flex-wrap:wrap; gap:5px; max-height:280px; overflow-y:auto; }
.re-wrap .s-char {
  width:34px; height:34px; display:flex; align-items:center; justify-content:center;
  background:var(--bg3); border:1px solid var(--border); border-radius:5px;
  cursor:pointer; font-size:15px; transition:all .1s;
}
.re-wrap .s-char:hover { background:var(--primary); border-color:var(--primary); color:#0a0a0f; }

/* ===== FIND BAR ===== */
.re-wrap .find-bar {
  display:none; background:var(--bg3); border-bottom:1px solid var(--border);
  padding:6px 12px; gap:7px; align-items:center; flex-wrap:wrap;
}
.re-wrap .find-bar.open { display:flex; }
.re-wrap .find-bar input {
  background:var(--bg); border:1px solid var(--border); color:var(--text);
  padding:4px 10px; border-radius:5px; font-size:13px; width:160px; outline:none;
  font-family:inherit;
}
.re-wrap .find-bar input:focus { border-color:var(--primary); }
.re-wrap .find-label { font-size:12px; color:var(--text-muted); font-weight:700; }
.re-wrap .find-count { font-size:12px; color:var(--text-muted); min-width:55px; }

/* ===== EDITOR BODY ===== */
.re-wrap .re-body { display:flex; flex:1; overflow:hidden; position:relative; }
.re-wrap .re-area {
  flex:1; overflow-y:auto; background:#141920;
  transform-origin:top left;
}
.re-wrap .re-page {
  max-width:860px; margin:0 auto;
  padding:24px 32px; min-height:100%;
}
.re-wrap .re-editor {
  outline:none; min-height:200px;
  font-family:Georgia,serif; font-size:16px; color:#cdd6f4;
  line-height:1.8; caret-color:#6ea8fe; word-break:break-word;
}
.re-wrap .re-editor:empty::before { content:attr(data-placeholder); color:#4a5568; pointer-events:none; }
.re-wrap .re-editor h1 { font-size:2.2em; font-weight:900; margin:.4em 0 .6em; color:#e8edf8; }
.re-wrap .re-editor h2 { font-size:1.7em; font-weight:800; margin:.4em 0 .5em; color:#e2e8f4; }
.re-wrap .re-editor h3 { font-size:1.35em; font-weight:700; margin:.4em 0 .4em; color:#dde4f2; }
.re-wrap .re-editor h4 { font-size:1.1em; font-weight:700; margin:.4em 0 .3em; color:#d8e0f0; }
.re-wrap .re-editor h5 { font-size:1em; font-weight:700; margin:.4em 0; color:#d0d9ee; }
.re-wrap .re-editor h6 { font-size:.9em; font-weight:700; color:#8896b3; margin:.4em 0; }
.re-wrap .re-editor p { margin:.4em 0; }
.re-wrap .re-editor blockquote {
  border-left:4px solid #4a86e8; padding:10px 18px;
  color:#94a8cc; margin:18px 0; font-style:italic;
  background:#1a2340; border-radius:0 8px 8px 0;
}
.re-wrap .re-editor pre {
  background:#0d1117; color:#c9d1d9; padding:18px 22px;
  border-radius:10px; font-family:'Courier New',monospace;
  font-size:14px; overflow-x:auto; line-height:1.6; margin:16px 0;
  border:1px solid #21262d;
}
.re-wrap .re-editor code {
  background:#2d1f2e; color:#f87171; padding:2px 6px;
  border-radius:4px; font-family:'Courier New',monospace; font-size:13px;
}
.re-wrap .re-editor a { color:#6ea8fe; text-decoration:underline; }
.re-wrap .re-editor a:hover { color:#93c5fd; }
.re-wrap .re-editor table { border-collapse:collapse; width:100%; margin:16px 0; }
.re-wrap .re-editor th { background:#1e2840; font-weight:700; padding:9px 13px; border:1px solid #2d3a52; color:#e2e8f4; }
.re-wrap .re-editor td { border:1px solid #2d3a52; padding:8px 13px; }
.re-wrap .re-editor tr:nth-child(even) td { background:#19202e; }
.re-wrap .re-editor img { max-width:100%; height:auto; border-radius:6px; }
.re-wrap .re-editor hr { border:none; border-top:2px solid #2d3748; margin:28px 0; }
.re-wrap .re-editor ul { padding-left:26px; }
.re-wrap .re-editor ol { padding-left:26px; }
.re-wrap .re-editor li { margin:.2em 0; }
.re-wrap .re-editor mark.find-hl { background:#854d0e; color:#fef3c7; border-radius:2px; }

/* Source editor */
.re-wrap .re-source {
  display:none; width:100%; height:100%;
  background:#0f172a; color:#94a3b8;
  font-family:'Courier New',monospace; font-size:13px;
  border:none; padding:24px; resize:none; outline:none; line-height:1.7;
  tab-size:2;
}

/* ===== STATUS BAR ===== */
.re-wrap .re-status {
  background:var(--bg3); border-top:1px solid var(--border);
  padding:4px 16px; display:flex; align-items:center; gap:18px;
  font-size:11px; color:var(--text-muted); flex-wrap:wrap;
}
.re-wrap .re-status b { color:var(--text); }

/* ===== MODALS ===== */
.re-modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.65);
  z-index:10000; display:none; align-items:center; justify-content:center;
}
.re-modal-overlay.open { display:flex; }
.re-modal {
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:28px;
  min-width:340px; max-width:540px; width:90%;
  box-shadow:0 20px 60px rgba(0,0,0,.5);
}
.re-modal h3 { font-size:16px; font-weight:900; margin-bottom:20px; display:flex; align-items:center; gap:10px; }
.re-modal .re-fg { margin-bottom:13px; }
.re-modal .re-fg label { display:block; font-size:11px; color:var(--text-muted); margin-bottom:5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
.re-modal .re-ma { display:flex; gap:10px; margin-top:20px; }

/* ===== FULLSCREEN ===== */
.re-wrap.fullscreen {
  position:fixed; inset:0; z-index:8000;
  border-radius:0; height:100vh;
}

/* ===== ZOOM ===== */
.re-wrap .zoom-wrap { display:flex; align-items:center; gap:3px; }
.re-wrap .re-zoom-val { font-size:11px; color:var(--text-muted); min-width:36px; text-align:center; }

/* ══════════════════════════════════════════════════════════════
   RENDU PUBLIC — .rich-content (affichage des messages du forum)
════════════════════════════════════════════════════════════════ */
.rich-content { line-height:1.7; word-break:break-word; color:var(--text); }
.rich-content h1 { font-size:1.9em; font-weight:900; margin:.5em 0 .4em; }
.rich-content h2 { font-size:1.55em; font-weight:800; margin:.5em 0 .4em; }
.rich-content h3 { font-size:1.3em; font-weight:700; margin:.5em 0 .3em; }
.rich-content h4 { font-size:1.12em; font-weight:700; margin:.5em 0 .3em; }
.rich-content h5 { font-size:1em; font-weight:700; margin:.4em 0; }
.rich-content h6 { font-size:.9em; font-weight:700; margin:.4em 0; color:var(--text-muted); }
.rich-content p { margin:.5em 0; }
.rich-content ul, .rich-content ol { padding-left:26px; margin:.5em 0; }
.rich-content li { margin:.25em 0; }
.rich-content a { color:var(--accent); text-decoration:underline; }
.rich-content img { max-width:100%; height:auto; border-radius:8px; margin:8px 0; }
.rich-content blockquote {
  border-left:4px solid var(--accent); padding:8px 16px; margin:14px 0;
  color:var(--text-muted); font-style:italic;
  background:rgba(255,255,255,.03); border-radius:0 8px 8px 0;
}
.rich-content pre {
  background:var(--bg); border:1px solid var(--border); border-radius:8px;
  padding:14px 18px; overflow-x:auto; font-family:'Courier New',monospace;
  font-size:13px; line-height:1.6; margin:12px 0;
}
.rich-content code { background:var(--bg); padding:2px 6px; border-radius:4px; font-family:'Courier New',monospace; font-size:.9em; }
.rich-content pre code { background:none; padding:0; }
.rich-content hr { border:none; border-top:1px solid var(--border); margin:22px 0; }
.rich-content table { border-collapse:collapse; width:100%; margin:14px 0; }
.rich-content th { background:var(--bg3); font-weight:700; padding:8px 12px; border:1px solid var(--border); }
.rich-content td { border:1px solid var(--border); padding:7px 12px; }
