/* ===== CHAT DE APOIO - ESTILOS ===== */

.chat-apoio-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 380px;
  max-height: 600px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.chat-apoio-widget.chat-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header do Chat */
.chat-apoio-header {
  background: linear-gradient(135deg, #7b42ff, #ff4a18);
  color: #ffffff;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 20px 20px 0 0;
}

.chat-apoio-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-apoio-header-info i {
  font-size: 1.5rem;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.chat-apoio-header-info h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: #ffffff;
}

.chat-status {
  font-size: 0.75rem;
  opacity: 0.9;
  display: block;
  margin-top: 0.125rem;
}

.chat-apoio-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.chat-apoio-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

/* Área de Mensagens */
.chat-apoio-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background: #f8f9fa;
  max-height: 400px;
  min-height: 300px;
}

.chat-apoio-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-apoio-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chat-apoio-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.chat-apoio-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.chat-apoio-message {
  margin-bottom: 1rem;
  display: flex;
  animation: messageSlideIn 0.3s ease-out;
  opacity: 0;
}

.chat-apoio-message.chat-message-visible {
  opacity: 1;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-apoio-message-user {
  justify-content: flex-end;
}

.chat-apoio-message-bot {
  justify-content: flex-start;
}

.chat-apoio-message-content {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 0.9375rem;
  word-wrap: break-word;
}

.chat-apoio-message-user .chat-apoio-message-content {
  background: linear-gradient(135deg, #7b42ff, #ff4a18);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-apoio-message-bot .chat-apoio-message-content {
  background: #ffffff;
  color: #333333;
  border: 1px solid #e5e5e5;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Área de Ações (Botões de Opção) */
.chat-apoio-actions {
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
}

.chat-apoio-option {
  background: #f8f9fa;
  border: 2px solid #e5e5e5;
  color: #333333;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.chat-apoio-option:hover {
  background: linear-gradient(135deg, rgba(123, 66, 255, 0.1), rgba(255, 74, 24, 0.1));
  border-color: #7b42ff;
  color: #7b42ff;
  transform: translateX(4px);
}

.chat-apoio-option:active {
  transform: translateX(2px) scale(0.98);
}

/* Footer do Chat */
.chat-apoio-footer {
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid #e5e5e5;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.chat-apoio-reset,
.chat-apoio-back {
  background: #f8f9fa;
  border: 1px solid #e5e5e5;
  color: #666666;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.chat-apoio-reset:hover,
.chat-apoio-back:hover {
  background: #e9ecef;
  border-color: #c1c1c1;
  color: #333333;
}

.chat-apoio-reset:active,
.chat-apoio-back:active {
  transform: scale(0.98);
}

/* Quando o chat está aberto, esconder o botão flutuante (regra movida para utilitarios.css) */

/* Responsividade */
@media (max-width: 480px) {
  .chat-apoio-widget {
    width: calc(100vw - 40px);
    bottom: 20px;
    right: 20px;
    left: 20px;
    max-height: calc(100vh - 40px);
  }

  .chat-apoio-messages {
    max-height: 300px;
    min-height: 200px;
  }

  .chat-apoio-header {
    padding: 1rem 1.25rem;
  }

  .chat-apoio-header-info h3 {
    font-size: 1rem;
  }

  .chat-apoio-message-content {
    max-width: 85%;
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
  }

  .chat-apoio-actions {
    padding: 0.875rem 1.25rem;
  }

  .chat-apoio-footer {
    padding: 0.875rem 1.25rem;
  }
}

/* Animação de heartbeat para o ícone */
@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.1);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.1);
  }
  70% {
    transform: scale(1);
  }
}

