/**
 * Sistema de comentários · Etapa 1
 * Anexo ao styles.css principal — carregado depois pra ter precedência.
 */

/* =========================================================
   Botão flutuante "modo comentário"
   ========================================================= */
.comment-toggle{
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #111;
  color: #fff;
  border: 1px solid #111;
  border-radius: 999px;
  font-family: var(--mono, "JetBrains Mono", monospace);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  transition: background .15s, transform .15s;
}
.comment-toggle:hover{ transform: translateY(-1px); }
.comment-toggle.is-active{
  background: #00FF6A;
  color: #111;
  border-color: #111;
}
.comment-toggle svg{ stroke: currentColor; }
.comment-badge{
  background: #E8443B;
  color: #fff;
  font-size: 10px;
  letter-spacing: 0;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 4px;
}

/* =========================================================
   Wrapper "commentable"
   - visual mudança APENAS no modo comentário
   ========================================================= */
.commentable{ position: relative; }
.commentable.is-commenting{ cursor: crosshair; }
body.comment-mode .commentable.is-commenting{
  outline: 1.5px dashed rgba(0,255,106,.5);
  outline-offset: 4px;
}
body.comment-mode .commentable.is-commenting:hover{
  outline-color: #00FF6A;
  outline-style: solid;
}

/* =========================================================
   Pin
   ========================================================= */
.comment-pin{
  position: absolute;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 4px;
  rotate: -45deg;
  background: #00FF6A;
  border: 2px solid #111;
  color: #111;
  font-family: var(--mono, monospace);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  transition: transform .12s ease;
}
.comment-pin > *{ rotate: 45deg; display: inline-block; }
.comment-pin:hover{ transform: translate(-50%, -50%) scale(1.1); }
.comment-pin.is-resolved{
  background: #fff;
  color: #777;
  opacity: .6;
}

/* =========================================================
   Popover (thread)
   ========================================================= */
.comment-popover{
  position: absolute;
  /* offset abaixo+direita do pin */
  transform: translate(8px, 14px);
  width: 320px;
  max-height: 480px;
  background: #fff;
  border: 1px solid #111;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  z-index: 60;
  display: flex;
  flex-direction: column;
  font-family: var(--sans, "Inter", system-ui, sans-serif);
  border-radius: 2px;
  overflow: hidden;
  animation: popoverIn .14s ease;
}
@keyframes popoverIn{
  from { opacity: 0; transform: translate(8px, 22px); }
  to   { opacity: 1; transform: translate(8px, 14px); }
}
.comment-popover-head{
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}
.comment-popover-num{
  font-family: var(--mono, monospace);
  font-size: 11px;
  color: #888;
  letter-spacing: .14em;
  margin-right: 8px;
  text-transform: uppercase;
}
.comment-popover-author{
  font-size: 13px;
  font-weight: 600;
  color: #111;
}
.comment-popover-close{
  background: transparent; border: 0; cursor: pointer;
  font-size: 22px; line-height: 1;
  color: #888;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.comment-popover-close:hover{ color: #111; }
.comment-popover-body{
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}
.comment-text{
  font-size: 14px;
  line-height: 1.5;
  color: #111;
  margin: 0 0 6px;
  white-space: pre-wrap;
}
.comment-ts{
  font-family: var(--mono, monospace);
  font-size: 10px;
  color: #999;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.comment-replies{
  border-top: 1px solid #eee;
  background: #fafafa;
  padding: 10px 14px;
  max-height: 180px;
  overflow-y: auto;
}
.comment-reply{
  padding: 8px 0;
  border-bottom: 1px dashed #e5e5e5;
}
.comment-reply:last-child{ border-bottom: 0; }
.comment-reply-author{
  font-size: 12px;
  font-weight: 600;
  color: #111;
  display: block;
  margin-bottom: 2px;
}
.comment-reply p{
  font-size: 13px;
  margin: 0 0 4px;
  color: #333;
  line-height: 1.45;
  white-space: pre-wrap;
}

.comment-popover-foot{
  border-top: 1px solid #eee;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}
.comment-popover-foot textarea,
.comment-popover-foot input{
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 2px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}
.comment-popover-foot textarea:focus,
.comment-popover-foot input:focus{
  outline: none;
  border-color: #111;
}

.comment-label{
  display: block;
  font-family: var(--mono, monospace);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #888;
  margin-bottom: 6px;
}

.comment-actions{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn-primary, .btn-secondary, .btn-link{
  font-family: inherit;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, color .12s;
}
.btn-primary{
  background: #111; color: #fff; border-color: #111;
}
.btn-primary:hover:not(:disabled){ background: #333; }
.btn-primary:disabled{ opacity: .35; cursor: not-allowed; }
.btn-secondary{
  background: #fff; color: #111; border-color: #111;
}
.btn-secondary:hover{ background: #f5f5f5; }
.btn-link{
  background: transparent; color: #888; border-color: transparent;
  margin-right: auto;
}
.btn-link:hover{ color: #E8443B; }

.comment-popover-draft{ border-color: #00FF6A; box-shadow: 0 12px 40px rgba(0,255,106,.25); }
.comment-popover-draft .comment-popover-head{ background: #f5fff8; }

/* =========================================================
   Modo comentário · ajustes globais
   ========================================================= */
body.comment-mode .slide{
  /* sutilmente diminui contraste do conteúdo "não-comentável" */
}
body.comment-mode .deck-stage-controls,
body.comment-mode #tweaks-host{
  /* não interfere */
}
