/* ==========================================================================
   Sedex Floating Chatbot Widget — Design Responsivo & Alta Conversão
   Cores oficiais: Azul Marinho (#00416b), Amarelo Ouro (#fed300)
   ========================================================================== */

/* Botão Flutuante (Launcher) */
.sedex-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: linear-gradient(135deg, #00416b 0%, #002e4d 100%);
  color: #ffffff;
  border: 2px solid #fed300;
  border-radius: 9999px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 46, 77, 0.35);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.sedex-chat-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 46, 77, 0.45);
  background: linear-gradient(135deg, #005083 0%, #003659 100%);
}

.sedex-chat-launcher__icon {
  width: 26px;
  height: 26px;
  background: #fed300;
  color: #002e4d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  flex-shrink: 0;
  position: relative;
}

.sedex-chat-launcher__dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sedex-chat-launcher__text {
  letter-spacing: -0.2px;
}

/* Painel de Conversa Flutuante */
.sedex-chat-window {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 31, 51, 0.3);
  border: 1px solid rgba(0, 65, 107, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sedex-chat-window.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Cabeçalho do Chat */
.sedex-chat-header {
  background: linear-gradient(135deg, #002e4d 0%, #00416b 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #fed300;
  flex-shrink: 0;
}

.sedex-chat-header__info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sedex-chat-header__avatar {
  width: 38px;
  height: 38px;
  background: #fed300;
  color: #002e4d;
  font-weight: 900;
  font-size: 1.1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sedex-chat-header__name {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.2;
}

.sedex-chat-header__status {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.sedex-chat-header__status-indicator {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
}

.sedex-chat-header__close-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.sedex-chat-header__close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Corpo das Mensagens */
.sedex-chat-body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sedex-chat-msg {
  max-width: 86%;
  padding: 12px 15px;
  font-size: 0.9rem;
  line-height: 1.45;
  border-radius: 14px;
  word-break: break-word;
}

.sedex-chat-msg.bot {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  align-self: flex-start;
  border-bottom-left-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.sedex-chat-msg.user {
  background: #00416b;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}

/* Card de Ações Rápidas no Chat (Rastrear, Cancelar, Suporte) */
.sedex-chat-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.sedex-chat-action-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #00416b;
  color: #0f172a;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s;
  text-decoration: none;
}

.sedex-chat-action-btn__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sedex-chat-action-btn__icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: rgba(0, 65, 107, 0.08);
  color: #00416b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sedex-chat-action-btn.action--cancel .sedex-chat-action-btn__icon {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.sedex-chat-action-btn.action--support .sedex-chat-action-btn__icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.sedex-chat-action-btn:hover {
  background: #f1f5f9;
  border-color: #00416b;
  transform: translateX(3px);
}

.sedex-chat-action-btn:hover {
  background: #f1f5f9;
  border-color: #00416b;
  transform: translateX(3px);
}

.sedex-chat-action-btn.action--tracking {
  border-left-color: #00416b;
}

.sedex-chat-action-btn.action--cancel {
  border-left-color: #ef4444;
}

.sedex-chat-action-btn.action--support {
  border-left-color: #10b981;
}

/* Card de Resultado de Rastreio dentro do Chat */
.sedex-chat-tracking-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin-top: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.sedex-chat-tracking-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.sedex-chat-tracking-card__code {
  font-weight: 800;
  font-size: 0.95rem;
  color: #00416b;
}

.sedex-chat-tracking-card__badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  background: #e0f2fe;
  color: #0369a1;
}

.sedex-chat-tracking-card__badge.entregue {
  background: #dcfce7;
  color: #15803d;
}

.sedex-chat-tracking-card__badge.saiu {
  background: #fef3c7;
  color: #b45309;
}

.sedex-chat-tracking-card__btn {
  display: block;
  text-align: center;
  background: #00416b;
  color: #ffffff !important;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 10px;
  text-decoration: none;
  transition: background 0.15s;
}

.sedex-chat-tracking-card__btn:hover {
  background: #0284c7;
}

/* Indicador de Digitação */
.sedex-chat-typing {
  display: none;
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 0.8rem;
  color: #64748b;
  font-style: italic;
}

.sedex-chat-typing.is-visible {
  display: block;
}

/* Barra de Input */
.sedex-chat-footer {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.sedex-chat-footer input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sedex-chat-footer input:focus {
  border-color: #00416b;
  box-shadow: 0 0 0 3px rgba(0, 65, 107, 0.1);
}

.sedex-chat-footer button {
  background: #00416b;
  color: #ffffff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.sedex-chat-footer button:hover {
  background: #0284c7;
  transform: scale(1.05);
}

/* Adaptação Mobile */
@media (max-width: 600px) {
  .sedex-chat-launcher {
    bottom: 16px;
    right: 16px;
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  .sedex-chat-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
}

