/* === GV Chat Widget — Design Portal === */

/* Launcher (WhatsApp — mantém verde) */
#gv-launcher {
  position: fixed; bottom: 20px; right: 20px; z-index: 99999;
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  background: #25d366; color: #fff;
  box-shadow: 0 4px 20px rgba(37,211,102,.4);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
#gv-launcher:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(37,211,102,.5); }
#gv-launcher svg { width: 32px; height: 32px; fill: #fff; }
#gv-launcher.active svg.wpp { display: none; }
#gv-launcher.active svg.close { display: block; }
#gv-launcher svg.close { display: none; }

/* Pulse animation */
#gv-launcher::before {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  background: rgba(37,211,102,.25); z-index: -1;
  animation: gvPulse 2s infinite;
}
#gv-launcher.active::before { display: none; }
@keyframes gvPulse {
  0% { transform: scale(1); opacity: .6; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* Chat window — desktop */
#gv-chat {
  position: fixed; bottom: 96px; right: 20px; z-index: 99998;
  width: 380px; border-radius: 20px; overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 48px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.06);
  display: none; flex-direction: column;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#gv-chat.open { display: flex; animation: gvSlideUp .3s ease; }
@keyframes gvSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.gvc-header {
  background: linear-gradient(135deg, #1c2d41 0%, #004274 60%, #1a5c2e 100%);
  color: #fff; padding: 20px 22px; display: flex; align-items: center; gap: 14px;
  position: relative;
}
.gvc-avatar {
  width: 46px; height: 46px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 14px; font-weight: 800; color: #004274;
  letter-spacing: -.3px;
}
.gvc-info h3 { font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.gvc-info p { font-size: 11px; opacity: .85; margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.gvc-info p::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }

/* Close button inside header (mobile only) */
.gvc-close {
  display: none; /* hidden on desktop */
  position: absolute; top: 50%; right: 18px; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none; border-radius: 50%;
  width: 36px; height: 36px; cursor: pointer;
  align-items: center; justify-content: center;
}
.gvc-close svg { width: 20px; height: 20px; fill: #fff; }

/* Messages */
.gvc-body {
  flex: 1; overflow-y: auto; padding: 18px; display: flex;
  flex-direction: column; gap: 10px;
  background: #f6f7f9;
  min-height: 300px; max-height: 400px;
}
.gvc-msg {
  max-width: 84%; padding: 10px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.55; word-wrap: break-word;
  position: relative; animation: gvFadeIn .3s ease;
}
@keyframes gvFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.gvc-msg.bot {
  background: #fff; align-self: flex-start; color: #1c2d41;
  border-top-left-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.gvc-msg.user {
  background: #e8f4ff; align-self: flex-end; color: #1c2d41;
  border-top-right-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.gvc-msg .ts {
  font-size: 10px; color: #8793a9; margin-top: 4px; text-align: right;
}

/* Typing dots */
.gvc-dots {
  display: flex; gap: 5px; padding: 14px 16px; align-self: flex-start;
  background: #fff; border-radius: 12px; border-top-left-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.gvc-dots span { width: 7px; height: 7px; border-radius: 50%; background: #b1b9c8; animation: gvDot .6s infinite alternate; }
.gvc-dots span:nth-child(2) { animation-delay: .15s; }
.gvc-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes gvDot { to { opacity: .3; transform: translateY(-3px); } }

/* Option buttons */
.gvc-opts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.gvc-opt {
  background: #fff; border: 1.5px solid #409fff; border-radius: 12px;
  padding: 11px 16px; font-size: 13.5px; color: #409fff; cursor: pointer;
  font-weight: 600; text-align: center; transition: all .2s;
  font-family: inherit;
}
.gvc-opt:hover { background: #409fff; color: #fff; box-shadow: 0 4px 12px rgba(64,159,255,.25); }

/* WhatsApp final CTA */
.gvc-wpp-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #25d366; color: #fff; border: none; border-radius: 12px;
  padding: 14px 22px; font-size: 14px; font-weight: 700; cursor: pointer;
  margin-top: 8px; transition: all .2s; text-decoration: none;
  font-family: inherit; width: 100%;
  box-shadow: 0 4px 16px rgba(37,211,102,.3);
}
.gvc-wpp-btn:hover { background: #1da851; box-shadow: 0 6px 20px rgba(37,211,102,.4); }
.gvc-wpp-btn svg { width: 22px; height: 22px; fill: #fff; flex-shrink: 0; }

/* LGPD link */
.gvc-lgpd { font-size: 10px; color: #8793a9; margin-top: 8px; line-height: 1.4; }
.gvc-lgpd a { color: #409fff; text-decoration: underline; }

/* ── Mobile: fullscreen ── */
@media (max-width: 768px) {
  #gv-chat {
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    border-radius: 0;
    box-shadow: none;
    z-index: 100000;
  }
  #gv-chat.open { animation: gvFadeIn .2s ease; }

  .gvc-header { padding: 16px 18px; padding-right: 60px; }
  .gvc-close { display: flex; }

  .gvc-body {
    min-height: 0; max-height: none;
    flex: 1; padding: 20px 16px;
  }

  .gvc-msg { font-size: 14.5px; padding: 12px 16px; max-width: 88%; }
  .gvc-opt { font-size: 14.5px; padding: 14px 18px; }
  .gvc-wpp-btn { font-size: 15px; padding: 16px 24px; }
  .gvc-lgpd { font-size: 11px; }

  /* Launcher fica por cima do chat quando aberto */
  #gv-launcher { bottom: 16px; right: 16px; width: 56px; height: 56px; z-index: 100001; }
  #gv-launcher svg { width: 28px; height: 28px; }
}
