/* =============================================
   Venice Chat Widget — SST Class
   ============================================= */

/* ─── Botão flutuante ─────────────────────── */
.venice-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9998;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 4px 24px rgba(124,58,237,.5), 0 0 0 0 rgba(124,58,237,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, box-shadow .2s;
  animation: venice-pulse 2.5s infinite;
}
.venice-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(124,58,237,.65);
}
.venice-fab.open {
  animation: none;
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
}
.venice-fab svg { color: #fff; transition: transform .3s; }
.venice-fab.open svg { transform: rotate(180deg); }

.venice-fab-tooltip {
  position: absolute;
  right: 70px;
  bottom: 50%;
  transform: translateY(50%);
  background: #1a1f35;
  border: 1px solid #2d3561;
  color: #c8d1eb;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  padding: .45rem .85rem;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}
.venice-fab-tooltip::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right: none;
  border-left-color: #2d3561;
}
.venice-fab:hover .venice-fab-tooltip,
.venice-fab-tooltip.visible { opacity: 1; }

@keyframes venice-pulse {
  0%, 100% { box-shadow: 0 4px 24px rgba(124,58,237,.5), 0 0 0 0 rgba(124,58,237,.3); }
  50%       { box-shadow: 0 4px 24px rgba(124,58,237,.5), 0 0 0 10px rgba(124,58,237,.0); }
}

/* Badge de notificação */
.venice-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #07090f;
  font-size: .65rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* ─── Painel do chat ──────────────────────── */
.venice-panel {
  position: fixed;
  bottom: 6.5rem;
  right: 2rem;
  z-index: 9999;
  width: 380px;
  height: 560px;
  background: #0d1021;
  border: 1px solid #1c2240;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(124,58,237,.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  transform-origin: bottom right;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .25s;
}
.venice-panel.hidden {
  transform: scale(.85) translateY(12px);
  opacity: 0;
  pointer-events: none;
}

/* ─── Header ──────────────────────────────── */
.venice-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #13102a 0%, #0d1021 100%);
  border-bottom: 1px solid #1c2240;
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-shrink: 0;
}
.venice-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.venice-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.venice-avatar::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  border: 2px solid #0d1021;
}
.venice-header-info { flex: 1; }
.venice-header-name {
  font-weight: 700;
  font-size: .95rem;
  color: #f0f6fc;
  line-height: 1.2;
}
.venice-header-status {
  font-size: .75rem;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-top: 1px;
}
.venice-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: blink 1.8s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}
.venice-close {
  background: rgba(255,255,255,.06);
  border: 1px solid #1c2240;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #7b88a8;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.venice-close:hover { background: rgba(255,255,255,.1); color: #f0f6fc; }

/* ─── Mensagens ───────────────────────────── */
.venice-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  scroll-behavior: smooth;
}
.venice-messages::-webkit-scrollbar { width: 4px; }
.venice-messages::-webkit-scrollbar-track { background: transparent; }
.venice-messages::-webkit-scrollbar-thumb { background: #1c2240; border-radius: 4px; }

/* Timestamp / separador */
.venice-day {
  text-align: center;
  font-size: .7rem;
  color: #4a5578;
  margin: .25rem 0;
}

/* Bolha de mensagem */
.venice-msg {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  max-width: 90%;
  animation: msg-in .25s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.venice-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.venice-msg.venice { align-self: flex-start; }

.venice-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.venice-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.venice-msg.user .venice-msg-avatar {
  background: linear-gradient(135deg, #1e3a6e, #2563eb);
}

.venice-bubble {
  padding: .65rem 1rem;
  border-radius: 16px;
  font-size: .875rem;
  line-height: 1.6;
  max-width: 100%;
  word-break: break-word;
}
.venice-msg.venice .venice-bubble {
  background: #131728;
  border: 1px solid #1c2240;
  color: #c8d1eb;
  border-bottom-left-radius: 4px;
}
.venice-msg.user .venice-bubble {
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Indicador de digitação */
.venice-typing .venice-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: .75rem 1rem;
}
.venice-typing .dot {
  width: 7px;
  height: 7px;
  background: #4a5578;
  border-radius: 50%;
  animation: typing-dot .9s infinite;
}
.venice-typing .dot:nth-child(2) { animation-delay: .15s; }
.venice-typing .dot:nth-child(3) { animation-delay: .30s; }
@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ─── Input ───────────────────────────────── */
.venice-input-area {
  padding: .75rem 1rem 1rem;
  border-top: 1px solid #1c2240;
  background: #0d1021;
  flex-shrink: 0;
}
.venice-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  background: #131728;
  border: 1px solid #1c2240;
  border-radius: 14px;
  padding: .5rem .5rem .5rem .85rem;
  transition: border-color .2s;
}
.venice-input-wrap:focus-within {
  border-color: rgba(124,58,237,.5);
  box-shadow: 0 0 0 3px rgba(124,58,237,.08);
}
.venice-input {
  flex: 1;
  background: none;
  border: none;
  outline: none !important;
  box-shadow: none !important;
  color: #f0f6fc;
  font-size: .875rem;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  line-height: 1.5;
  padding: .2rem 0;
}
.venice-input:focus { outline: none !important; box-shadow: none !important; }
.venice-input::placeholder { color: #4a5578; }

.venice-send {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6d28d9, #7c3aed);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: opacity .15s, transform .15s;
}
.venice-send:hover { opacity: .85; transform: scale(1.05); }
.venice-send:disabled { opacity: .35; cursor: default; transform: none; }

.venice-footer-note {
  text-align: center;
  font-size: .67rem;
  color: #2d3561;
  margin-top: .5rem;
}

/* ─── Responsivo ──────────────────────────── */
@media (max-width: 480px) {
  .venice-panel {
    right: .75rem;
    left: .75rem;
    width: auto;
    bottom: 5.5rem;
  }
  .venice-fab { right: 1.25rem; bottom: 1.25rem; }
}
