/* ========================================================
   Hermes PureteGO Concierge Chat Widget
   Estilos modernos, mobile-first e de alta performance
   ======================================================== */

:root {
  --hermes-primary: #00d2ff;
  --hermes-primary-dark: #0077b6;
  --hermes-accent: #10b981;
  --hermes-bg-dark: #0a1128;
  --hermes-card-bg: rgba(13, 22, 45, 0.95);
  --hermes-border: rgba(0, 210, 255, 0.25);
  --hermes-text: #f1f5f9;
  --hermes-text-muted: #94a3b8;
  --hermes-shadow: 0 16px 40px -8px rgba(0, 18, 51, 0.6), 0 0 20px rgba(0, 210, 255, 0.25);
}

/* Botão Flutuante */
#hermes-launcher-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff 0%, #0077b6 100%);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: var(--hermes-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999990;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
}

#hermes-launcher-btn:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 20px 45px -5px rgba(0, 210, 255, 0.5);
}

#hermes-launcher-btn svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
  transition: transform 0.3s ease;
}

#hermes-launcher-btn.is-active svg.icon-chat {
  display: none;
}

#hermes-launcher-btn:not(.is-active) svg.icon-close {
  display: none;
}

/* Badge Online Pulsante */
.hermes-status-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: var(--hermes-accent);
  border: 2px solid #0a1128;
  border-radius: 50%;
}

.hermes-status-badge::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  width: 14px;
  height: 14px;
  background-color: var(--hermes-accent);
  border-radius: 50%;
  animation: hermes-pulse 2s infinite ease-out;
  opacity: 0.7;
}

@keyframes hermes-pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Tooltip / Balão Proativo */
#hermes-proactive-bubble {
  position: fixed;
  bottom: 96px;
  right: 24px;
  max-width: 290px;
  background: rgba(10, 17, 40, 0.96);
  border: 1px solid var(--hermes-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--hermes-text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.88rem;
  line-height: 1.45;
  box-shadow: var(--hermes-shadow);
  z-index: 999989;
  display: none;
  cursor: pointer;
  animation: hermes-slide-up 0.4s ease-out forwards;
}

#hermes-proactive-bubble .bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--hermes-primary);
  font-weight: 600;
}

#hermes-proactive-bubble .bubble-close {
  background: transparent;
  border: none;
  color: var(--hermes-text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
}

/* Janela Modal do Chat */
#hermes-chat-modal {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--hermes-card-bg);
  border: 1px solid var(--hermes-border);
  border-radius: 20px;
  box-shadow: var(--hermes-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999995;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
}

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

/* Cabeçalho do Chat */
.hermes-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(10, 17, 40, 0.98), rgba(15, 23, 42, 0.95));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hermes-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hermes-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff, #0077b6);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 210, 255, 0.3);
}

.hermes-avatar-wrap svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.hermes-title-area h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.hermes-title-area span {
  font-size: 0.75rem;
  color: var(--hermes-accent);
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.hermes-title-area span::before {
  content: '';
  width: 6px;
  height: 6px;
  background-color: var(--hermes-accent);
  border-radius: 50%;
  display: inline-block;
}

.hermes-header-close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--hermes-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hermes-header-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Corpo das Mensagens */
.hermes-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.hermes-body::-webkit-scrollbar {
  width: 5px;
}

.hermes-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Mensagens */
.hermes-msg {
  max-width: 84%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
  animation: hermes-fade-in 0.25s ease-out;
}

.hermes-msg-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-left-radius: 4px;
}

.hermes-msg-bot strong {
  color: #ffffff;
}

.hermes-msg-bot a {
  color: var(--hermes-primary);
  text-decoration: underline;
  word-break: break-all;
}

.hermes-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0077b6, #0096c7);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 119, 182, 0.25);
}

/* Indicador de Digitação */
.hermes-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.hermes-typing span {
  width: 6px;
  height: 6px;
  background: var(--hermes-primary);
  border-radius: 50%;
  animation: hermes-dot 1.4s infinite ease-in-out;
  opacity: 0.6;
}

.hermes-typing span:nth-child(2) { animation-delay: 0.2s; }
.hermes-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes hermes-dot {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}

@keyframes hermes-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hermes-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Rodapé / Input */
.hermes-footer {
  padding: 12px 16px;
  background: rgba(10, 17, 40, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hermes-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 4px 6px 4px 14px;
  transition: border-color 0.2s ease;
}

.hermes-input-row:focus-within {
  border-color: var(--hermes-primary);
  background: rgba(255, 255, 255, 0.08);
}

.hermes-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 0.9rem;
  font-family: inherit;
}

.hermes-input-row input::placeholder {
  color: var(--hermes-text-muted);
}

.hermes-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff, #0077b6);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hermes-send-btn:hover {
  transform: scale(1.05);
}

.hermes-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hermes-send-btn svg {
  width: 16px;
  height: 16px;
  fill: #ffffff;
  margin-left: 2px;
}

/* Transição para WhatsApp */
.hermes-wa-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--hermes-text-muted);
  text-decoration: none;
  padding: 3px 0;
  transition: color 0.2s ease;
}

.hermes-wa-link:hover {
  color: #25d366;
}

.hermes-wa-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Mobile Friendly */
@media (max-width: 576px) {
  #hermes-launcher-btn {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }
  #hermes-chat-modal {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }
  #hermes-proactive-bubble {
    bottom: 80px;
    right: 16px;
    max-width: calc(100vw - 32px);
  }
}
