/* ============================================================
   NS WORKS — AI CHAT WIDGET STYLES
   Matches the site's existing color variables (see css/style.css)
   ============================================================ */

/* The site already has a floating WhatsApp button (.wa-float) pinned at
   right:22px/bottom:22px, 56px across. This launcher sits directly above
   it with a gap so the two never overlap. */
#nsw-chat-launcher {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--grad, linear-gradient(100deg,#8FB4FF 0%, #6C6CFF 100%));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(76, 92, 255, 0.35);
  z-index: 9998;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#nsw-chat-launcher:hover { transform: scale(1.06); box-shadow: 0 10px 28px rgba(76, 92, 255, 0.45); }
#nsw-chat-launcher svg { width: 28px; height: 28px; fill: #fff; }
#nsw-chat-launcher .nsw-dot {
  position: absolute; top: -2px; right: -2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #33D17A; border: 2px solid #fff;
}

#nsw-chat-panel {
  position: fixed;
  bottom: 164px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 200px);
  background: var(--surface-light-2, #fff);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(10, 13, 20, 0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: inherit;
  border: 1px solid var(--line-light, rgba(18,20,26,0.10));
}
#nsw-chat-panel.nsw-open { display: flex; }

#nsw-chat-header {
  background: var(--grad, linear-gradient(100deg,#8FB4FF 0%, #6C6CFF 100%));
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#nsw-chat-header .nsw-title { font-weight: 700; font-size: 15px; }
#nsw-chat-header .nsw-subtitle { font-size: 12px; opacity: 0.9; margin-top: 2px; }
#nsw-chat-close {
  background: rgba(255,255,255,0.2);
  border: none; color: #fff; width: 26px; height: 26px;
  border-radius: 50%; cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
#nsw-chat-close:hover { background: rgba(255,255,255,0.32); }

#nsw-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface-light, #F4F6FB);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nsw-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.nsw-msg-bot { align-self: flex-start; background: #fff; color: var(--ink, #12141A); border: 1px solid var(--line-light, rgba(18,20,26,0.10)); border-bottom-left-radius: 4px; }
.nsw-msg-user { align-self: flex-end; background: var(--blue, #4A8CFF); color: #fff; border-bottom-right-radius: 4px; }
.nsw-msg-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--line-light, rgba(18,20,26,0.10)); border-radius: 14px; border-bottom-left-radius: 4px; }
.nsw-msg-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-muted, #5B6270); opacity: 0.5; animation: nsw-blink 1.2s infinite ease-in-out; }
.nsw-msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.nsw-msg-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes nsw-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

#nsw-chat-quickreplies { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; background: var(--surface-light, #F4F6FB); flex-shrink: 0; }
.nsw-quick-btn {
  border: 1px solid var(--line-light, rgba(18,20,26,0.12));
  background: #fff; color: var(--ink, #12141A);
  font-size: 12px; padding: 6px 10px; border-radius: 999px; cursor: pointer;
}
.nsw-quick-btn:hover { border-color: var(--blue, #4A8CFF); color: var(--blue, #4A8CFF); }

#nsw-chat-inputbar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px; border-top: 1px solid var(--line-light, rgba(18,20,26,0.10));
  background: #fff; flex-shrink: 0;
}
#nsw-chat-input {
  flex: 1; border: 1px solid var(--line-light, rgba(18,20,26,0.15));
  border-radius: 999px; padding: 10px 14px; font-size: 13.5px;
  outline: none; font-family: inherit; color: var(--ink, #12141A);
}
#nsw-chat-input:focus { border-color: var(--blue, #4A8CFF); }
#nsw-chat-send {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: var(--blue, #4A8CFF); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
#nsw-chat-send:hover { background: var(--indigo, #6C6CFF); }
#nsw-chat-send:disabled { opacity: 0.5; cursor: default; }
#nsw-chat-send svg { width: 16px; height: 16px; fill: #fff; }

#nsw-chat-footer { text-align: center; font-size: 10.5px; color: var(--ink-muted, #5B6270); padding: 6px 0 10px; background: #fff; flex-shrink: 0; }

@media (max-width: 480px) {
  /* Mobile .wa-float is right:16px/bottom:16px, 52px across */
  #nsw-chat-launcher { right: 16px; bottom: 80px; }
  #nsw-chat-panel { right: 12px; left: 12px; width: auto; bottom: 148px; }
}
