/* chatbot.css */
/* Chatbot Floating Toggle Button */
.chatbot-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  color: var(--color-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  cursor: pointer;
  z-index: 1005;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), var(--shadow-glow);
  transition: all var(--transition-normal);
}

.chatbot-toggle:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), var(--shadow-glow-hover);
}

/* Chatbot Window */
.chatbot-window {
  position: fixed;
  bottom: 105px;
  right: 30px;
  width: calc(100% - 60px);
  max-width: 380px;
  height: 500px;
  background: rgba(15, 20, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  z-index: 1004;
  box-shadow: var(--shadow-xl), 0 20px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.chatbot-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chatbot-header {
  background: var(--gradient-accent);
  padding: var(--space-md) var(--space-lg);
  color: var(--color-bg-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  background: var(--color-bg-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  font-size: 1.15rem;
}

.chatbot-name h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-bg-primary);
}

.chatbot-status {
  font-size: 0.75rem;
  color: rgba(11, 17, 32, 0.8);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background-color: var(--color-bg-primary);
  border-radius: var(--radius-full);
  display: inline-block;
}

.chatbot-close {
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.chatbot-close:hover {
  opacity: 1;
}

/* Chat Messages Box */
.chatbot-messages {
  flex-grow: 1;
  padding: var(--space-lg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  scroll-behavior: smooth;
}

/* Scrollbar inside messages */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: var(--color-bg-surface);
}

/* Message Bubble */
.chat-msg {
  max-width: 80%;
  padding: 0.75rem var(--space-md);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.45;
  animation: fadeInUp 0.3s ease forwards;
}

.chat-msg.bot {
  align-self: flex-start;
  background: rgba(36, 48, 45, 0.86);
  border: 1px solid var(--color-border);
  color: var(--color-white);
  border-bottom-left-radius: var(--radius-sm);
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--gradient-accent);
  color: var(--color-bg-primary);
  font-weight: 500;
  border-bottom-right-radius: var(--radius-sm);
  box-shadow: 0 4px 10px rgba(212, 167, 69, 0.15);
}

/* Quick Replies Box */
.chat-replies {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
  align-self: flex-start;
}

.reply-btn {
  background: rgba(212, 167, 69, 0.08);
  border: 1px solid rgba(212, 167, 69, 0.25);
  color: var(--color-accent);
  padding: 0.4rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.reply-btn:hover {
  background: var(--color-accent);
  color: var(--color-bg-primary);
  border-color: var(--color-accent);
}

/* Chat Input Bar */
.chatbot-input-area {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  background: rgba(11, 17, 32, 0.95);
  display: flex;
  gap: var(--space-sm);
}

.chatbot-input {
  flex-grow: 1;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.65rem var(--space-md);
  color: var(--color-white);
  font-size: 0.9rem;
}

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

.chatbot-send {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--gradient-accent);
  color: var(--color-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.chatbot-send:hover {
  background: var(--gradient-accent-hover);
  transform: scale(1.05);
}

/* Typing Indicator */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

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

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Hide scroll top button when chatbot overlay is active on small devices to prevent overlapping */
@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100% - 30px);
    right: 15px;
    left: 15px;
    bottom: 90px;
    height: 420px;
  }
  .chatbot-toggle {
    bottom: 15px;
    right: 15px;
  }
  .scroll-top.show {
    /* Hide on extremely small layouts when chatbot is visible */
    display: none;
  }
}
