/* ══════════════════════════════════════
   CHAT WIDGET — Guru Agenda Assistant
   ══════════════════════════════════════ */

/* Botão flutuante (acima do WhatsApp) */
.gw-button {
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  background: #0000fe;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 254, .35);
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.gw-button:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(0, 0, 254, .5);
}
.gw-button svg { color: #fff; }
.gw-button.gw-hidden { opacity: 0; visibility: hidden; transform: scale(.8); }

/* Pulse animado pra chamar atenção quando carrega */
.gw-button::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #0000fe;
  opacity: .4;
  animation: gw-pulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes gw-pulse {
  0%   { transform: scale(1); opacity: .4; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Badge "Novo" pequenininho */
.gw-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 100px;
  border: 2px solid #fff;
  letter-spacing: .04em;
}

/* Painel do chat */
.gw-panel {
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 9999;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(13, 17, 41, .2), 0 4px 12px rgba(13, 17, 41, .06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(.96);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.gw-panel.gw-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.gw-header {
  background: linear-gradient(135deg, #0000fe 0%, #4f46e5 100%);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.gw-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.gw-header-text { flex: 1; min-width: 0; }
.gw-header-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}
.gw-header-sub {
  font-size: 12px;
  opacity: .8;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gw-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, .3);
}
.gw-close {
  background: rgba(255, 255, 255, .12);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .15s;
}
.gw-close:hover { background: rgba(255, 255, 255, .25); transform: rotate(90deg); }

/* Lista de mensagens */
.gw-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fc;
}
.gw-messages::-webkit-scrollbar { width: 6px; }
.gw-messages::-webkit-scrollbar-thumb { background: rgba(13,17,41,.15); border-radius: 6px; }

.gw-msg {
  max-width: 85%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: gw-slide-in .25s ease;
}
@keyframes gw-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gw-msg-bot {
  background: #fff;
  color: #090f29;
  border: 1px solid #ececf3;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.gw-msg-user {
  background: #0000fe;
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.gw-msg a {
  color: inherit;
  text-decoration: underline;
}
.gw-msg-bot a { color: #0000fe; }
.gw-msg strong { font-weight: 700; }

/* Indicador "digitando..." */
.gw-typing {
  background: #fff;
  border: 1px solid #ececf3;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  padding: 13px 16px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.gw-typing span {
  width: 6px;
  height: 6px;
  background: #c9ccd6;
  border-radius: 50%;
  animation: gw-bounce 1.2s ease-in-out infinite;
}
.gw-typing span:nth-child(2) { animation-delay: .15s; }
.gw-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes gw-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* Sugestões clicáveis */
.gw-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 4px 8px 4px;
}
.gw-suggestion {
  background: #fff;
  border: 1px solid #ececf3;
  color: #0000fe;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.gw-suggestion:hover {
  background: #0000fe;
  color: #fff;
  border-color: #0000fe;
}

/* Footer com input */
.gw-footer {
  border-top: 1px solid #ececf3;
  padding: 12px 14px;
  background: #fff;
}
.gw-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.gw-input {
  flex: 1;
  border: 1px solid #ececf3;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 42px;
  max-height: 100px;
  outline: none;
  transition: border-color .15s;
  background: #f8f9fc;
}
.gw-input:focus { border-color: #0000fe; background: #fff; }
.gw-input::placeholder { color: #9ca3b0; }
.gw-send {
  width: 42px;
  height: 42px;
  background: #0000fe;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .15s;
}
.gw-send:hover:not(:disabled) { background: #0000d1; transform: translateY(-1px); }
.gw-send:disabled { background: #c9ccd6; cursor: not-allowed; }

.gw-footer-hint {
  text-align: center;
  font-size: 10.5px;
  color: #9ca3b0;
  margin-top: 8px;
}
.gw-footer-hint a { color: #6b7280; text-decoration: underline; }

/* Mobile */
@media (max-width: 480px) {
  .gw-panel {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    max-width: 100vw;
    border-radius: 0;
  }
  .gw-button { bottom: 96px; right: 16px; }
}

/* ══════════════════════════════════════
   TEASER (bolha-isca contextual)
   ══════════════════════════════════════ */
.gw-teaser {
  position: fixed;
  bottom: 100px;
  right: 96px;
  z-index: 9997;
  max-width: 260px;
  background: #fff;
  border-radius: 16px;
  padding: 14px 36px 12px 16px;
  box-shadow: 0 12px 30px rgba(13,17,41,.18);
  border: 1px solid #ececf3;
  opacity: 0;
  transform: translateY(8px) scale(.95);
  visibility: hidden;
  transition: opacity .28s ease, transform .28s ease, visibility .28s;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.gw-teaser.gw-teaser-show {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}
.gw-teaser:hover {
  box-shadow: 0 16px 36px rgba(0,0,254,.18);
  border-color: rgba(0,0,254,.25);
}
.gw-teaser-text {
  font-size: 13.5px;
  color: #090f29;
  line-height: 1.42;
  font-weight: 500;
}
.gw-teaser-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #0000fe;
  letter-spacing: -0.005em;
}
.gw-teaser-cta::after {
  content: '→';
  transition: transform .15s;
}
.gw-teaser:hover .gw-teaser-cta::after { transform: translateX(3px); }
.gw-teaser-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px; height: 22px;
  background: rgba(13,17,41,.05);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  padding: 0;
  transition: background .15s, color .15s;
}
.gw-teaser-close:hover {
  background: rgba(13,17,41,.12);
  color: #090f29;
}

/* Pontinha apontando pro botão (estilo balão de chat) */
.gw-teaser::after {
  content: '';
  position: absolute;
  bottom: 22px;
  right: -7px;
  width: 14px; height: 14px;
  background: #fff;
  transform: rotate(45deg);
  border-right: 1px solid #ececf3;
  border-top: 1px solid #ececf3;
}
.gw-teaser:hover::after { border-color: rgba(0,0,254,.25); }

@media (max-width: 640px) {
  .gw-teaser {
    bottom: 162px;
    right: 16px;
    left: auto;
    max-width: calc(100vw - 90px);
  }
  .gw-teaser::after { display: none; }
}
