/* ═══════════════════════════════════════════════════════════
   APV SHOP — Chatbot NOAH Widget
   ═══════════════════════════════════════════════════════════ */

.chatbot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-chatbot);
  font-family: var(--font-body);
}

/* Toggle Button */
.chatbot__toggle {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--color-accent-glow);
  transition: all var(--duration-normal) var(--ease-smooth);
  position: relative;
}

.chatbot__toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px var(--color-accent-glow);
}

.chatbot__toggle svg {
  width: 28px;
  height: 28px;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.chatbot.active .chatbot__toggle svg.chat-icon { display: none; }
.chatbot:not(.active) .chatbot__toggle svg.close-icon { display: none; }

.chatbot__pulse {
  position: absolute;
  inset: -4px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-accent);
  animation: pulseGlow 2s infinite;
}

.chatbot.active .chatbot__pulse { display: none; }

/* Badge notification */
.chatbot__notification {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: var(--color-success);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: var(--fw-bold);
  color: #FFFFFF;
  animation: scaleBounce 0.4s var(--ease-bounce);
}

.chatbot.active .chatbot__notification { display: none; }

/* Window */
.chatbot__window {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.chatbot.active .chatbot__window {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.chatbot__header {
  background: var(--color-accent);
  color: #FFFFFF;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chatbot__avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.chatbot__header-info {
  flex: 1;
}

.chatbot__header-name {
  font-weight: var(--fw-bold);
  font-size: 0.9375rem;
}

.chatbot__header-status {
  font-size: 0.75rem;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot__header-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: var(--radius-full);
  animation: pulse 2s infinite;
}

.chatbot__close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #FFFFFF;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: background var(--duration-fast) var(--ease-smooth);
}

.chatbot__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Messages */
.chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chatbot__message {
  display: flex;
  gap: 8px;
  max-width: 85%;
  animation: fadeInUp 0.3s var(--ease-smooth);
}

.chatbot__message--bot {
  align-self: flex-start;
}

.chatbot__message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chatbot__message-avatar {
  width: 28px;
  height: 28px;
  background: var(--color-accent-light);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  color: var(--color-accent);
}

.chatbot__message--user .chatbot__message-avatar {
  background: var(--color-secondary);
  color: #FFFFFF;
}

.chatbot__message-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.5;
}

.chatbot__message--bot .chatbot__message-bubble {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border-bottom-left-radius: 4px;
}

.chatbot__message--user .chatbot__message-bubble {
  background: var(--color-accent);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

/* Quick Actions */
.chatbot__quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chatbot__quick-btn {
  padding: 6px 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  color: var(--color-text);
}

.chatbot__quick-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Typing indicator */
.chatbot__typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.chatbot__typing-dot {
  width: 6px;
  height: 6px;
  background: var(--color-text-muted);
  border-radius: var(--radius-full);
  animation: bounce 1.4s infinite ease-in-out;
}

.chatbot__typing-dot:nth-child(2) { animation-delay: 0.16s; }
.chatbot__typing-dot:nth-child(3) { animation-delay: 0.32s; }

/* Input */
.chatbot__input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.chatbot__input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-smooth);
}

.chatbot__input:focus {
  border-color: var(--color-accent);
}

.chatbot__input::placeholder {
  color: var(--color-text-muted);
}

.chatbot__send {
  width: 40px;
  height: 40px;
  background: var(--color-accent);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  flex-shrink: 0;
}

.chatbot__send:hover {
  background: var(--color-accent-hover);
  transform: scale(1.05);
}

.chatbot__send svg {
  width: 18px;
  height: 18px;
}

/* Mobile */
@media (max-width: 480px) {
  .chatbot__window {
    width: calc(100vw - 16px);
    right: -16px;
    bottom: 68px;
    height: calc(100vh - 100px);
    border-radius: var(--radius-md);
  }
}
