/* ============================================================
   GELB CORE WIDGET v1.1
   Widget flutuante — NÃO interfere no layout da página
   ============================================================ */

/* ── FLOATING BUTTON ─────────────────────────────────────── */
#gcBtn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, #43e7ff 0%, #7c4dff 100%);
  box-shadow: 0 4px 24px rgba(67,231,255,.35), 0 2px 8px rgba(0,0,0,.4);
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
  outline: none;
  padding: 0;
}
#gcBtn:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 8px 32px rgba(67,231,255,.45), 0 4px 12px rgba(0,0,0,.5);
}
#gcBtn:active { transform: scale(.96); }

.gc-brain-icon {
  font-size: 24px;
  line-height: 1;
  display: block;
}

.gc-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(67,231,255,.5);
  animation: gc-pulse 2.5s ease-out infinite;
  pointer-events: none;
}
@keyframes gc-pulse {
  0%   { transform: scale(1);   opacity: .8; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ── CHAT PANEL ──────────────────────────────────────────── */
#gcPanel {
  position: fixed;
  right: 24px;
  bottom: 90px;
  width: 360px;
  height: 560px;
  max-height: calc(100vh - 110px);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #0d1b2e;
  border: 1px solid rgba(67,231,255,.15);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.05),
    0 24px 64px rgba(0,0,0,.7),
    0 0 40px rgba(67,231,255,.08);
  z-index: 2147483646;
  transform-origin: bottom right;
  transform: scale(.85) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform .22s cubic-bezier(.16,1,.3,1),
    opacity .18s ease;
}
#gcPanel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── HEADER ──────────────────────────────────────────────── */
.gc-head {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: rgba(67,231,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.gc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #43e7ff, #7c4dff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(67,231,255,.25);
}
.gc-online {
  position: absolute;
  width: 9px;
  height: 9px;
  right: -1px;
  bottom: -1px;
  border-radius: 50%;
  background: #00ff99;
  border: 2px solid #0d1b2e;
}

.gc-head-info { margin-left: 10px; flex: 1; min-width: 0; }
.gc-head-info h4 {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  font-family: inherit;
}
.gc-head-info p {
  color: #9ca3af;
  font-size: 11px;
  margin: 2px 0 0;
  font-family: inherit;
}

.gc-head-actions { display: flex; gap: 4px; }
.gc-btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,.06);
  color: #9ca3af;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
  font-family: inherit;
}
.gc-btn-icon:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* ── CHIPS ───────────────────────────────────────────────── */
.gc-chips {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.gc-chips::-webkit-scrollbar { display: none; }
.gc-chip {
  white-space: nowrap;
  padding: 5px 11px;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  color: #e2e8f0;
  font-size: 11px;
  cursor: pointer;
  transition: .15s;
  flex-shrink: 0;
  font-family: inherit;
}
.gc-chip:hover {
  background: rgba(67,231,255,.12);
  border-color: rgba(67,231,255,.3);
  color: #43e7ff;
}

/* ── MESSAGES ────────────────────────────────────────────── */
.gc-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}
.gc-msgs::-webkit-scrollbar { width: 4px; }
.gc-msgs::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.1);
  border-radius: 4px;
}

.gc-msg { display: flex; gap: 8px; align-items: flex-start; }
.gc-msg.user { flex-direction: row-reverse; }

.gc-msg-av {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #43e7ff, #7c4dff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.gc-msg.user .gc-msg-av {
  background: rgba(255,255,255,.1);
  color: #9ca3af;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
}

.gc-msg-bubble {
  max-width: calc(100% - 42px);
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  font-family: inherit;
  word-break: break-word;
}
.gc-msg.ai .gc-msg-bubble {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.07);
  color: #e2e8f0;
  border-top-left-radius: 4px;
}
.gc-msg.user .gc-msg-bubble {
  background: rgba(67,231,255,.12);
  border: 1px solid rgba(67,231,255,.18);
  color: #e2e8f0;
  border-top-right-radius: 4px;
}
.gc-msg-bubble h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
  font-family: inherit;
}
.gc-msg-bubble p {
  margin: 0 0 5px;
  color: #9ca3af;
  font-family: inherit;
}
.gc-msg-bubble p:last-child { margin: 0; }
.gc-msg-bubble strong { color: #e2e8f0; }

.gc-examples {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.gc-examples a {
  color: #43e7ff;
  text-decoration: none;
  font-size: 12px;
  opacity: .8;
  cursor: pointer;
  transition: .15s;
  font-family: inherit;
}
.gc-examples a:hover { opacity: 1; }

/* Typing indicator */
.gc-dots { display: flex; gap: 4px; align-items: center; padding: 2px 0; }
.gc-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #43e7ff;
  animation: gc-bounce .7s infinite;
  opacity: .7;
}
.gc-dots span:nth-child(2) { animation-delay: .12s; }
.gc-dots span:nth-child(3) { animation-delay: .24s; }
@keyframes gc-bounce {
  0%,80%,100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}

/* ── INPUT AREA ──────────────────────────────────────────── */
.gc-input-wrap {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
  background: rgba(0,0,0,.15);
}
.gc-input {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.06);
  padding: 0 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
  min-width: 0;
}
.gc-input:focus { border-color: rgba(67,231,255,.4); }
.gc-input::placeholder { color: #64748b; }

.gc-send {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 15px;
  background: linear-gradient(135deg, #43e7ff, #7c4dff);
  box-shadow: 0 2px 12px rgba(67,231,255,.2);
  transition: .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gc-send:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 20px rgba(67,231,255,.35);
}
.gc-send:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 480px) {
  #gcPanel {
    width: calc(100vw - 20px);
    height: 70vh;
    right: 10px;
    bottom: 80px;
    border-radius: 16px;
  }
  #gcBtn {
    right: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
  }
  .gc-brain-icon { font-size: 20px; }
}

/* Garante que o widget não herda estilos do sistema host */
#gcBtn, #gcPanel, #gcPanel * {
  box-sizing: border-box;
  line-height: normal;
}