/* ==========================================================================
   Nevgo Institute — AI Assistant Chat Widget (Botanical Theme)
   ========================================================================== */

/* --- Floating Chat Button (Launcher) --- */
.nevgo-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a594b 0%, #2d473b 100%);
  border: 2px solid rgba(192, 114, 92, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(58, 89, 75, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.nevgo-chat-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(58, 89, 75, 0.35);
  border-color: rgba(192, 114, 92, 0.6);
}

.nevgo-chat-launcher:active {
  transform: scale(0.95);
}

.nevgo-chat-launcher svg {
  width: 28px;
  height: 28px;
  fill: #fbf9f5;
  transition: transform 0.3s ease;
}

.nevgo-chat-launcher.active svg {
  transform: rotate(45deg);
}

/* Pulsing ring animation */
.nevgo-chat-launcher::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(58, 89, 75, 0.2);
  animation: chat-pulse 2s ease-in-out infinite;
}

@keyframes chat-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.4; }
}

/* Unread badge */
.nevgo-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c0725c;
  color: #fbf9f5;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Inter', system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s ease;
}

.nevgo-chat-badge.show {
  opacity: 1;
  transform: scale(1);
}

/* --- Chat Widget Panel --- */
.nevgo-chat-widget {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 9998;
  width: 380px;
  height: 560px;
  max-height: calc(100vh - 140px);
  background: #fbf9f5;
  border-radius: 18px;
  border: 1px solid rgba(58, 89, 75, 0.12);
  box-shadow: 0 12px 48px rgba(58, 89, 75, 0.15);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.nevgo-chat-widget.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* --- Chat Header --- */
.nevgo-chat-header {
  background: linear-gradient(135deg, #3a594b 0%, #2d473b 100%);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nevgo-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(251, 249, 245, 0.15);
  border: 1.5px solid rgba(251, 249, 245, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}

.nevgo-chat-header-info {
  flex: 1;
  min-width: 0;
}

.nevgo-chat-header-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 15px;
  font-weight: 600;
  color: #fbf9f5;
  line-height: 1.2;
}

.nevgo-chat-header-status {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  color: rgba(251, 249, 245, 0.6);
  display: flex;
  align-items: center;
  gap: 4px;
}

.nevgo-chat-header-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7bc96a;
  display: inline-block;
}

.nevgo-chat-header-close {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(251, 249, 245, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(251, 249, 245, 0.6);
  font-size: 16px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.nevgo-chat-header-close:hover {
  background: rgba(251, 249, 245, 0.2);
  color: #fbf9f5;
}

/* --- Chat Messages Area --- */
.nevgo-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.nevgo-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.nevgo-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.nevgo-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(58, 89, 75, 0.15);
  border-radius: 4px;
}

/* --- Message Bubbles --- */
.nevgo-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  line-height: 1.6;
  word-wrap: break-word;
  animation: nevgo-msg-in 0.3s ease;
}

@keyframes nevgo-msg-in {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.nevgo-message.bot {
  align-self: flex-start;
  background: #f4f0e6;
  color: #2b3631;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(58, 89, 75, 0.08);
}

.nevgo-message.bot strong {
  color: #3a594b;
  font-weight: 600;
}

.nevgo-message.bot em {
  color: #a0543e;
  font-style: italic;
}

.nevgo-message.user {
  align-self: flex-end;
  background: #3a594b;
  color: #fbf9f5;
  border-bottom-right-radius: 4px;
}

.nevgo-message .msg-sender {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-bottom: 2px;
}

/* --- Typing Indicator --- */
.nevgo-typing {
  align-self: flex-start;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: #f4f0e6;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(58, 89, 75, 0.08);
}

.nevgo-typing.show {
  display: flex;
}

.nevgo-typing .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7d8b84;
  animation: nevgo-bounce 1.4s ease-in-out infinite;
}

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

@keyframes nevgo-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* --- Quick Reply Buttons --- */
.nevgo-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.nevgo-quick-btn {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid rgba(58, 89, 75, 0.2);
  background: rgba(58, 89, 75, 0.05);
  color: #3a594b;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.nevgo-quick-btn:hover {
  background: rgba(58, 89, 75, 0.1);
  border-color: rgba(58, 89, 75, 0.35);
}

.nevgo-quick-btn:active {
  transform: scale(0.96);
}

/* --- Chat Input Area --- */
.nevgo-chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(58, 89, 75, 0.1);
  background: rgba(251, 249, 245, 0.95);
  flex-shrink: 0;
}

.nevgo-chat-input {
  flex: 1;
  border: 1px solid rgba(58, 89, 75, 0.15);
  border-radius: 22px;
  padding: 9px 16px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: #2b3631;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s ease;
}

.nevgo-chat-input:focus {
  border-color: #3a594b;
}

.nevgo-chat-input::placeholder {
  color: #9aa8a0;
}

.nevgo-chat-send-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a594b 0%, #2d473b 100%);
  color: #fbf9f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.nevgo-chat-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 2px 10px rgba(58, 89, 75, 0.25);
}

.nevgo-chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.nevgo-chat-send-btn svg {
  width: 16px;
  height: 16px;
  fill: #fbf9f5;
  margin-left: 2px;
}

/* --- Welcome Message Brand Elements --- */
.nevgo-welcome-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.nevgo-welcome-brand .brand-icon {
  font-size: 20px;
}

.nevgo-welcome-brand .brand-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 13px;
  font-weight: 600;
  color: #3a594b;
  letter-spacing: 0.03em;
}

/* --- Program Card in Chat --- */
.nevgo-program-card {
  background: rgba(58, 89, 75, 0.04);
  border: 1px solid rgba(58, 89, 75, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 6px;
}

.nevgo-program-card .prog-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  color: #3a594b;
}

.nevgo-program-card .prog-price {
  font-size: 12px;
  color: #c0725c;
  font-weight: 600;
}

.nevgo-program-card .prog-desc {
  font-size: 12px;
  color: #58655f;
  margin-top: 4px;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .nevgo-chat-widget {
    right: 12px;
    bottom: 88px;
    width: calc(100vw - 24px);
    height: calc(100vh - 120px);
    max-height: none;
    border-radius: 14px;
  }

  .nevgo-chat-launcher {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }

  .nevgo-chat-launcher svg {
    width: 24px;
    height: 24px;
  }
}
