/* ================================================
   NextGen Sales Chatbot — Styles
   ================================================ */

/* CHATBOT TRIGGER BUTTON */
.ng-chat-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0C1F3F 0%, #1B7A64 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(12, 31, 63, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ng-chat-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(12, 31, 63, 0.45);
}

.ng-chat-trigger svg {
  width: 28px;
  height: 28px;
  fill: white;
  transition: transform 0.3s ease;
}

.ng-chat-trigger.open svg.chat-icon { display: none; }
.ng-chat-trigger:not(.open) svg.close-icon { display: none; }
.ng-chat-trigger.open svg.close-icon { display: block; }

/* NOTIFICATION BADGE */
.ng-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #E84040;
  border-radius: 50%;
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  font-weight: 600;
  animation: badgePulse 2s ease-in-out infinite;
}

.ng-chat-trigger.open .ng-chat-badge { display: none; }

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* WELCOME BUBBLE */
.ng-chat-welcome {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 9998;
  background: white;
  border-radius: 16px 16px 4px 16px;
  padding: 14px 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  max-width: 280px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #1A2B3C;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.ng-chat-welcome.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ng-chat-welcome .welcome-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #5A7089;
  line-height: 1;
}

.ng-chat-welcome strong {
  color: #1B7A64;
}

/* CHAT WINDOW */
.ng-chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 9999;
  width: 380px;
  max-height: 560px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(12, 31, 63, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

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

/* CHAT HEADER */
.ng-chat-header {
  background: linear-gradient(135deg, #0C1F3F 0%, #163557 100%);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ng-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1B7A64;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ng-chat-avatar svg {
  width: 22px;
  height: 22px;
  fill: white;
}

.ng-chat-header-info h4 {
  color: white;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.ng-chat-header-info p {
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  margin: 2px 0 0;
}

.ng-chat-status {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #4CC9A4;
  border-radius: 50%;
  margin-right: 4px;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* CHAT BODY */
.ng-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 360px;
  min-height: 280px;
  background: #F8F9FB;
}

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

.ng-chat-body::-webkit-scrollbar-thumb {
  background: #DDE5EF;
  border-radius: 3px;
}

/* MESSAGES */
.ng-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  animation: msgSlide 0.3s ease;
}

@keyframes msgSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ng-msg.bot {
  align-self: flex-start;
  background: white;
  color: #1A2B3C;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.ng-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0C1F3F, #1B7A64);
  color: white;
  border-bottom-right-radius: 4px;
}

/* TYPING INDICATOR */
.ng-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-self: flex-start;
  background: white;
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.ng-typing span {
  width: 7px;
  height: 7px;
  background: #5A7089;
  border-radius: 50%;
  animation: typeDot 1.2s ease-in-out infinite;
}

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

@keyframes typeDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-5px); }
}

/* QUICK REPLY BUTTONS */
.ng-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  align-self: flex-start;
  max-width: 90%;
  animation: msgSlide 0.3s ease;
}

.ng-quick-reply {
  background: white;
  border: 1.5px solid #DDE5EF;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12.5px;
  color: #0C1F3F;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
}

.ng-quick-reply:hover {
  background: #0C1F3F;
  color: white;
  border-color: #0C1F3F;
}

/* INPUT AREA */
.ng-chat-input {
  padding: 12px 16px;
  border-top: 1px solid #EEF1F5;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
}

.ng-chat-input input {
  flex: 1;
  border: 1.5px solid #DDE5EF;
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  color: #1A2B3C;
}

.ng-chat-input input:focus {
  border-color: #4CC9A4;
}

.ng-chat-input input::placeholder {
  color: #99A8B8;
}

.ng-chat-input button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0C1F3F, #1B7A64);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.ng-chat-input button:hover {
  transform: scale(1.06);
}

.ng-chat-input button svg {
  width: 16px;
  height: 16px;
  fill: white;
}

/* EMAIL INPUT STEP */
.ng-email-capture {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-start;
  max-width: 90%;
  animation: msgSlide 0.3s ease;
}

.ng-email-capture input {
  border: 1.5px solid #DDE5EF;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}

.ng-email-capture input:focus {
  border-color: #4CC9A4;
}

.ng-email-capture button {
  background: #1B7A64;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.ng-email-capture button:hover {
  background: #0C1F3F;
}

/* POWERED BY */
.ng-chat-footer {
  text-align: center;
  padding: 6px;
  font-size: 10px;
  color: #99A8B8;
  background: white;
}

/* MOBILE */
@media (max-width: 480px) {
  .ng-chat-window {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 90px;
    max-height: 70vh;
  }

  .ng-chat-welcome {
    right: 10px;
    max-width: calc(100vw - 90px);
  }

  .ng-chat-trigger {
    right: 16px;
    bottom: 16px;
    width: 54px;
    height: 54px;
  }
}
