/* Sine Wave International - AI Chat Widget Styles */

/* Position launcher on bottom-left to prevent any overlap with WhatsApp FAB on bottom-right */
.sw-chat-launcher {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: auto;
  z-index: 999;
  background: linear-gradient(135deg, #c5a059 0%, #dfba73 50%, #b38b46 100%);
  color: #0b0e14;
  border: none;
  border-radius: 50px;
  padding: 11px 18px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), 0 0 10px rgba(197, 160, 89, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sw-chat-launcher:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 14px rgba(197, 160, 89, 0.55);
}

.sw-chat-launcher svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sw-chat-window {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: auto;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 48px);
  background: #11141c;
  border: 1px solid rgba(197, 160, 89, 0.25);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow: hidden;
  font-family: 'Inter', -apple-system, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.sw-chat-header {
  background: #181c26;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sw-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sw-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c5a059, #b38b46);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d1017;
  font-weight: 800;
  font-size: 15px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.sw-chat-title h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f3f4f6;
}

.sw-chat-title p {
  margin: 2px 0 0;
  font-size: 0.73rem;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sw-chat-title p::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
}

.sw-chat-close {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  font-size: 20px;
  line-height: 1;
}

.sw-chat-close:hover {
  color: #f3f4f6;
}

.sw-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sw-chat-msg {
  max-width: 88%;
  font-size: 0.86rem;
  line-height: 1.45;
  border-radius: 12px;
  padding: 10px 14px;
  word-wrap: break-word;
}

.sw-chat-msg.agent {
  align-self: flex-start;
  background: #1c2130;
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top-left-radius: 2px;
}

.sw-chat-msg.agent p {
  margin: 0 0 6px 0;
}

.sw-chat-msg.agent p:last-child {
  margin-bottom: 0;
}

.sw-chat-msg.agent ul {
  margin: 4px 0 6px 18px;
  padding: 0;
}

.sw-chat-msg.agent li {
  margin-bottom: 3px;
}

.sw-chat-msg.agent strong {
  color: #dfba73;
}

.sw-chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #c5a059, #b38b46);
  color: #0b0e14;
  font-weight: 500;
  border-top-right-radius: 2px;
}

.sw-chat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.sw-chat-pill {
  background: rgba(197, 160, 89, 0.12);
  border: 1px solid rgba(197, 160, 89, 0.3);
  color: #dfba73;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 0.74rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

.sw-chat-pill:hover {
  background: rgba(197, 160, 89, 0.25);
  border-color: #dfba73;
}

.sw-chat-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: #1c2130;
  border-radius: 12px;
  border-top-left-radius: 2px;
}

.sw-chat-typing span {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: sw-blink 1.2s infinite ease-in-out;
}

.sw-chat-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.sw-chat-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes sw-blink {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.sw-chat-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  background: #181c26;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sw-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-chat-input {
  flex: 1;
  background: #0f1218;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

.sw-chat-input:focus {
  border-color: #c5a059;
}

.sw-chat-send {
  background: #c5a059;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #0b0e14;
}

.sw-chat-send:hover {
  background: #dfba73;
}

.sw-chat-subfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #6b7280;
}

.sw-chat-wa-handoff {
  color: #25d366;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 500;
}

.sw-chat-wa-handoff:hover {
  text-decoration: underline;
}

/* Call-to-action WhatsApp Forward Button inside Chat Messages */
.sw-chat-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  background: #25d366;
  color: #fff;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
}

.sw-chat-action-btn:hover {
  background: #22bf5b;
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .sw-chat-launcher {
    bottom: 20px;
    left: 16px;
    right: auto;
    padding: 9px 14px;
    font-size: 0.8rem;
  }
  .sw-chat-window {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: 16px;
    height: 520px;
  }
}
