/* ========= BuddyPanel / Toggle Thème ========= */

.encralys-theme-toggle{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px; line-height:1;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.encralys-theme-toggle:hover{
  background: var(--elev-1);
  border-color: color-mix(in lab, var(--border) 70%, var(--text) 30%);
}
.encralys-theme-toggle .txt{ font-weight:600; }
.encralys-theme-toggle .icon{ width:16px; height:16px; display:inline-flex; align-items:center; }

/* Optionnel: harmoniser le fond du BuddyPanel avec le thème */
#buddypanel, .bb-buddypanel, .buddypanel{
  background: var(--surface);
  color: var(--text);
  border-right: 1px solid var(--border);
}
/* === ENCRALYS • Boutons flottants "Écrire" (à droite de l'icône) === */
/* CHANGEMENTS CLÉS :
   - position:fixed (au lieu de absolute) pour rester collé à l'ancre au scroll via recalcul JS
   - flèche décorative ::after
   - thèmes light/dark + reduced-motion + fallback mobile
*/

:root{
  --bbp-float-gap: 10px;           /* écart horizontal depuis l’icône */
  --bbp-float-radius: 10px;
  --bbp-float-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.bbp-float-actions {
  position: fixed;                 /* ← avant: absolute */
  z-index: 99999;
  transform: translateY(-50%) translateX(-4px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;            /* pas cliquable si caché */
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  /* sécurité bord d’écran */
  max-width: 80vw;
}

.bbp-float-actions.is-visible {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* flèche (petit “tooltip arrow”) */
.bbp-float-actions::after{
  content:"";
  position: absolute;
  left: -6px;                      /* colle à la gauche du bloc */
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid var(--bb-panel-bg, #151515);
  filter: drop-shadow(0 0 0 var(--bb-border-color, #303030));
}

/* Style des deux boutons */
.bbp-float-actions .bbp-float-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;

  padding: 8px 10px;
  border-radius: var(--bbp-float-radius);
  border: 1px solid var(--bb-border-color, #303030);
  background: var(--bb-panel-bg, #151515);
  color: var(--bb-text, #eaeaea);
  font-size: 13px;
  line-height: 1;

  box-shadow: var(--bbp-float-shadow);
}

.bbp-float-actions .bbp-float-btn:hover {
  background: var(--bb-panel-bg-hover, #1c1c1c);
  border-color: var(--bb-border-color-strong, #3a3a3a);
}

.bbp-float-actions .bbp-float-btn i {
  font-size: 16px;
}

/* Thème clair */
:root[data-theme="light"] .bbp-float-actions .bbp-float-btn {
  border-color: #e2e2e2;
  background: #ffffff;
  color: #202020;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
:root[data-theme="light"] .bbp-float-actions .bbp-float-btn:hover {
  background: #f6f6f6;
  border-color: #d7d7d7;
}
:root[data-theme="light"] .bbp-float-actions::after{
  border-right-color: #ffffff;
}

/* Accessibilité : réduit les animations si demandé */
@media (prefers-reduced-motion: reduce){
  .bbp-float-actions{
    transition: opacity .01s linear;
    transform: translateY(-50%);
  }
  .bbp-float-actions.is-visible{
    transform: translateY(-50%);
  }
}

/* Mobile étroit : passe en rangée pour éviter la sortie d’écran */
@media (max-width: 480px){
  .bbp-float-actions{
    flex-direction: row;
    transform: translateY(-50%) translateX(-6px);
  }
  .bbp-float-actions::after{
    display:none;
  }
  .bbp-float-actions .bbp-float-btn{
    padding: 8px 9px;
    font-size: 12px;
  }
}