/* ═══════════════════════════════════
   CHATBOT — Luna (La Loba Ink)
   Usa as cores de style.css
═══════════════════════════════════ */

/* ── Avatar "L" ── */
.bot-ava {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  color: var(--bg);
}

/* ── Botão flutuante (launcher) ── */
.bot-launcher {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  box-shadow: 0 10px 25px rgba(0,0,0,.5);
  cursor: pointer;
  z-index: 999998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: botPulse 2.4s ease-in-out infinite;
  transition: transform .2s;
}
.bot-launcher:hover { transform: scale(1.06); }
.bot-launcher .bot-ava { font-size: 30px; }
.bot-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--wa);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--sans);
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}
.bot-launcher.hidden { display: none; }

@keyframes botPulse {
  0%   { box-shadow: 0 10px 25px rgba(0,0,0,.5), 0 0 0 0 rgba(239,233,225,.35); }
  70%  { box-shadow: 0 10px 25px rgba(0,0,0,.5), 0 0 0 14px rgba(239,233,225,0); }
  100% { box-shadow: 0 10px 25px rgba(0,0,0,.5), 0 0 0 0 rgba(239,233,225,0); }
}

/* ── Janela ── */
.bot-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 370px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 40px);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  z-index: 999999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--sans);
  animation: botUp .3s cubic-bezier(.34,1.56,.64,1) both;
}
.bot-panel.open { display: flex; }
@keyframes botUp {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Cabeçalho ── */
.bot-head {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.bot-head-ava {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bot-head-ava .bot-ava { font-size: 22px; }
.bot-head-info { flex: 1; line-height: 1.25; }
.bot-head-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.bot-head-sub { font-size: 11px; color: var(--dim); }
.bot-online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; display: inline-block;
  animation: botBlink 1.8s infinite;
}
@keyframes botBlink {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); }
  70% { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.bot-close {
  background: rgba(239,233,225,.08);
  border: none;
  color: var(--ink);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.bot-close:hover { background: rgba(239,233,225,.16); }

/* ── Handoff ── */
.bot-handoff {
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.bot-handoff-txt { flex: 1; font-size: 11.5px; color: var(--dim); }
.bot-handoff-btn {
  background: var(--wa);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 18px;
  text-decoration: none;
  white-space: nowrap;
}

/* ── Mensagens ── */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  animation: botFade .28s cubic-bezier(.34,1.56,.64,1) both;
}
.msg.bot {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px;
  align-self: flex-start;
}
.msg.bot strong { color: var(--accent); font-weight: 500; }
.msg.user {
  background: var(--ink);
  color: var(--bg);
  border-radius: 14px 4px 14px 14px;
  align-self: flex-end;
  font-weight: 500;
}
@keyframes botFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mlbl { font-size: 10px; color: var(--dim); margin-bottom: -4px; display: flex; align-items: center; gap: 6px; }
.mlbl.u { justify-content: flex-end; }
.mlbl-ava {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Digitando ── */
.typing-dot {
  display: flex;
  gap: 5px;
  padding: 13px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px;
  align-self: flex-start;
}
.typing-dot span { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: botTd 1.2s infinite; }
.typing-dot span:nth-child(2) { animation-delay: .2s; }
.typing-dot span:nth-child(3) { animation-delay: .4s; }
@keyframes botTd { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ── Chips ── */
.inline-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 2px 0 8px;
  transition: opacity .25s;
}
.qrb {
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 8px 13px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.qrb:hover { background: rgba(239,233,225,.08); }
.qrb-wa { border-color: rgba(37,211,102,.55); color: #4ade80; }
.qrb-back { opacity: .55; font-size: 11.5px; }

@media (max-width: 600px) {
  .bot-panel {
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 100%;
    height: 86vh;
    max-height: 86vh;
    border-radius: 22px 22px 0 0;
  }
  .bot-launcher { right: 16px; bottom: 86px; }
  .wa-float { right: 16px; }
}

/* Fotos de um estilo dentro da conversa (tocar abre em ecrã inteiro) */
.bot-fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 10px 0; }
.bot-fotos img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  cursor: zoom-in;
}
