/* NinjaView Support Bot Styles */

/* ========== CHAT TOGGLE BUTTON ========== */
.nv-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--nv-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.nv-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.55);
}

.nv-chat-toggle .nv-chat-icon-open,
.nv-chat-toggle .nv-chat-icon-close {
  position: absolute;
  transition: opacity 0.2s, transform 0.2s;
}

.nv-chat-toggle .nv-chat-icon-close {
  opacity: 0;
  transform: rotate(-90deg);
}

.nv-chat-toggle.active .nv-chat-icon-open {
  opacity: 0;
  transform: rotate(90deg);
}

.nv-chat-toggle.active .nv-chat-icon-close {
  opacity: 1;
  transform: rotate(0deg);
}

/* ========== CHAT WINDOW ========== */
.nv-chat-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  max-height: 520px;
  background: var(--nv-bg-card, #111118);
  border: 1px solid var(--nv-border, #1e1e2a);
  border-radius: var(--nv-radius, 12px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

/* ========== CHAT HEADER ========== */
.nv-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--nv-bg, #0a0a0f);
  border-bottom: 1px solid var(--nv-border, #1e1e2a);
}

.nv-chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--nv-accent, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.nv-chat-header-info h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--nv-text, #e4e4e7);
  margin: 0;
  line-height: 1.3;
}

.nv-chat-header-info p {
  font-size: 0.75rem;
  color: var(--nv-text-dim, #52526a);
  margin: 0;
  line-height: 1.3;
}

.nv-chat-header-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nv-green, #22c55e);
  margin-left: auto;
  flex-shrink: 0;
}

/* ========== CHAT BODY ========== */
.nv-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 340px;
}

.nv-chat-body::-webkit-scrollbar {
  width: 4px;
}

.nv-chat-body::-webkit-scrollbar-track {
  background: transparent;
}

.nv-chat-body::-webkit-scrollbar-thumb {
  background: var(--nv-border, #1e1e2a);
  border-radius: 2px;
}

/* ========== MESSAGES ========== */
.nv-chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.nv-chat-msg.bot {
  align-self: flex-start;
  background: var(--nv-bg, #0a0a0f);
  border: 1px solid var(--nv-border, #1e1e2a);
  color: var(--nv-text, #e4e4e7);
}

.nv-chat-msg.user {
  align-self: flex-end;
  background: var(--nv-accent, #6366f1);
  color: #fff;
  border: none;
}

.nv-chat-msg a {
  color: var(--nv-accent-hover, #818cf8);
  text-decoration: underline;
}

.nv-chat-msg.user a {
  color: #e0e0ff;
}

.nv-chat-msg code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--nv-mono, 'Consolas', monospace);
}

/* ========== QUICK REPLIES ========== */
.nv-chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.nv-chat-quick-btn {
  background: var(--nv-bg-card, #111118);
  border: 1px solid var(--nv-border, #1e1e2a);
  color: var(--nv-accent, #6366f1);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--nv-font, 'Inter', sans-serif);
}

.nv-chat-quick-btn:hover {
  background: var(--nv-accent-glow, rgba(99, 102, 241, 0.15));
  border-color: var(--nv-accent, #6366f1);
}

/* ========== CHAT INPUT ========== */
.nv-chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--nv-border, #1e1e2a);
  background: var(--nv-bg, #0a0a0f);
}

.nv-chat-input {
  flex: 1;
  background: var(--nv-bg-card, #111118);
  border: 1px solid var(--nv-border, #1e1e2a);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--nv-text, #e4e4e7);
  font-size: 0.8125rem;
  font-family: var(--nv-font, 'Inter', sans-serif);
  outline: none;
  transition: border-color 0.2s;
}

.nv-chat-input:focus {
  border-color: var(--nv-accent, #6366f1);
}

.nv-chat-input::placeholder {
  color: var(--nv-text-dim, #52526a);
}

.nv-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--nv-accent, #6366f1);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.nv-chat-send:hover {
  background: var(--nv-accent-hover, #818cf8);
}

/* ========== TYPING INDICATOR ========== */
.nv-chat-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  align-self: flex-start;
}

.nv-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nv-text-dim, #52526a);
  animation: nvTypingBounce 1.2s infinite;
}

.nv-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.nv-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes nvTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
  .nv-chat-window {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 80px;
    max-height: 70vh;
  }

  .nv-chat-toggle {
    right: 16px;
    bottom: 16px;
  }
}
