/* ============================================================
   AGENTE ESTER — Tutora do App (Demo / Sistema)
   ============================================================ */

/* ── Botão flutuante ── */
.ester-fab {
  position: fixed;
  bottom: 90px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.ester-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4DB6AC, #80CBC4);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(77,182,172,0.45);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  transition: transform 0.2s;
  position: relative;
}
.ester-btn:hover { transform: scale(1.08); }
.ester-btn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ester-btn .ester-online {
  position: absolute; bottom: 2px; right: 2px;
  width: 12px; height: 12px;
  background: #43A047; border-radius: 50%; border: 2px solid #fff;
}
.ester-hint {
  background: #fff;
  color: #4DB6AC;
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 3px 12px rgba(77,182,172,0.2);
  white-space: nowrap;
  cursor: pointer;
}

/* ── Painel da Ester ── */
.ester-panel {
  position: fixed;
  bottom: 90px;
  right: 80px;
  width: 320px;
  max-height: 500px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(15,15,26,0.16);
  display: flex;
  flex-direction: column;
  z-index: 9997;
  overflow: hidden;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  font-family: 'Poppins', sans-serif;
}
.ester-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}
@media (max-width: 420px) {
  .ester-panel { width: calc(100vw - 24px); right: 12px; bottom: 80px; }
  .ester-fab   { right: 12px; }
}

/* Header */
.ester-header {
  background: linear-gradient(135deg, #4DB6AC, #26A69A);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ester-header-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  object-fit: cover;
  flex-shrink: 0;
}
.ester-header-name { font-size: 0.88rem; font-weight: 700; color: #fff; }
.ester-header-role { font-size: 0.68rem; color: rgba(255,255,255,0.8); margin-top: 1px; }
.ester-close {
  margin-left: auto;
  background: rgba(255,255,255,0.2);
  border: none; color: #fff;
  width: 26px; height: 26px;
  border-radius: 50%; cursor: pointer;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}
.ester-close:hover { background: rgba(255,255,255,0.35); }

/* Progresso do tutorial */
.ester-progress {
  padding: 10px 16px;
  background: #F0FAFA;
  border-bottom: 1px solid #E0F5F3;
  flex-shrink: 0;
}
.ester-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #4DB6AC;
  font-weight: 600;
  margin-bottom: 5px;
}
.ester-progress-bar {
  background: #E0F5F3;
  border-radius: 6px;
  height: 5px;
  overflow: hidden;
}
.ester-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4DB6AC, #80CBC4);
  border-radius: 6px;
  transition: width 0.5s ease;
}

/* Conteúdo */
.ester-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FAFFFE;
}
.ester-body::-webkit-scrollbar { width: 3px; }
.ester-body::-webkit-scrollbar-thumb { background: #B2DFDB; border-radius: 3px; }

/* Mensagem da Ester */
.ester-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: esterMsgIn 0.3s ease;
}
@keyframes esterMsgIn {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:translateY(0); }
}
.ester-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.ester-msg-bubble {
  background: #fff;
  border-radius: 4px 14px 14px 14px;
  padding: 9px 12px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #333;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  max-width: 85%;
}
.ester-msg-bubble .step-num {
  display: inline-block;
  background: #4DB6AC;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  margin-bottom: 4px;
}
.ester-msg-bubble .highlight {
  background: #E0F5F3;
  color: #00796B;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.78rem;
}

/* Typing */
.ester-typing {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  width: fit-content;
}
.ester-typing span {
  width: 6px; height: 6px;
  background: #80CBC4;
  border-radius: 50%;
  animation: esterDot 1.2s infinite;
}
.ester-typing span:nth-child(2) { animation-delay: 0.2s; }
.ester-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes esterDot {
  0%,60%,100% { transform:translateY(0); opacity:0.4; }
  30%          { transform:translateY(-5px); opacity:1; }
}

/* Ações do tutorial */
.ester-actions {
  padding: 10px 14px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  border-top: 1px solid #E0F5F3;
  background: #fff;
  flex-shrink: 0;
}
.ester-action-btn {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
  border: none;
}
.ester-action-btn.primary {
  background: linear-gradient(135deg, #4DB6AC, #26A69A);
  color: #fff;
  box-shadow: 0 3px 10px rgba(77,182,172,0.3);
}
.ester-action-btn.primary:hover { transform: translateY(-1px); }
.ester-action-btn.secondary {
  background: #F0FAFA;
  color: #4DB6AC;
  border: 1px solid #B2DFDB;
}
.ester-action-btn.secondary:hover { background: #E0F5F3; }
