/**
 * Guardião X — Chat de Suporte (widget flutuante).
 * Usa as mesmas variáveis de design de style.css (--bg-elevated,
 * --bg-card, --primary, --border, etc.) para ficar visualmente
 * consistente com o resto do site, sem depender de nenhum framework.
 */

.suporte-chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, background 0.15s ease;
}
.suporte-chat-fab:hover {
  background: var(--primary-light);
  transform: scale(1.05);
}
.suporte-chat-fab svg {
  width: 26px;
  height: 26px;
}

.suporte-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 1000;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 140px));
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.suporte-chat-panel.aberto {
  display: flex;
}

.suporte-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.suporte-chat-header h3 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}
.suporte-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.suporte-chat-header button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.suporte-chat-header button:hover {
  color: var(--text);
}
.suporte-chat-header button svg {
  width: 20px;
  height: 20px;
}

.suporte-chat-banner {
  padding: 8px 16px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: none;
}
.suporte-chat-banner.visivel {
  display: block;
}

.suporte-chat-mensagens {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.suporte-chat-vazio {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  padding: 0 12px;
}

.suporte-chat-bolha {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.suporte-chat-bolha.usuario {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.suporte-chat-bolha.ia,
.suporte-chat-bolha.atendente {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.suporte-chat-bolha.sistema {
  align-self: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  max-width: 90%;
}

.suporte-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.suporte-chat-form input {
  flex: 1;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
}
.suporte-chat-form input:focus {
  outline: none;
  border-color: var(--primary-light);
}
.suporte-chat-form button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.suporte-chat-form button:hover {
  background: var(--primary-light);
}
.suporte-chat-form button:disabled {
  opacity: 0.5;
  cursor: default;
}
.suporte-chat-form button svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 480px) {
  .suporte-chat-panel {
    right: 16px;
    bottom: 88px;
  }
  .suporte-chat-fab {
    right: 16px;
    bottom: 16px;
  }
}
