/* Chatbot Container */
#chatbot-container {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  font-family: 'Outfit', sans-serif;
}

/* Chatbot Header (The Bubble) */
#chatbot-header {
  background: linear-gradient(90deg, #00e5ff, #009dff);
  color: #041226;
  padding: 12px 18px;
  border-radius: 28px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 229, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  transition: transform 0.2s;
  user-select: none;
}

#chatbot-header:hover {
  transform: scale(1.05);
}

/* Chatbot Box (The Window) */
#chatbot-box {
  width: 380px;
  height: 520px;
  max-height: 80vh;
  /* Responsive height */
  background: rgba(5, 9, 27, 0.98);
  border-radius: 12px;
  margin-top: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  border: 1px solid rgba(0, 229, 255, 0.1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

/* Messages Area */
#chatbot-messages {
  flex: 1;
  /* Takes all available space */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
  min-height: 0;
  /* Critical for flex scrolling */
}

/* Message Bubbles */
.user-msg {
  background: linear-gradient(90deg, #00e5ff, #009dff);
  color: #041226;
  padding: 10px 14px;
  border-radius: 14px 14px 2px 14px;
  align-self: flex-end;
  max-width: 85%;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 229, 255, 0.1);
}

.bot-msg {
  background: rgba(255, 255, 255, 0.05);
  color: #e6eef8;
  padding: 10px 14px;
  border-radius: 14px 14px 14px 2px;
  align-self: flex-start;
  max-width: 85%;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Custom Scrollbar */
#chatbot-messages::-webkit-scrollbar {
  width: 5px;
}

#chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.2);
  border-radius: 5px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.4);
}

/* Typing Indicator */
.typing-indicator {
  padding: 12px 16px;
  display: flex;
  gap: 4px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #00e5ff;
  border-radius: 50%;
  animation: typing 1s infinite alternate;
  opacity: 0.4;
}

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

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

@keyframes typing {
  from {
    transform: translateY(0);
    opacity: 0.4;
  }

  to {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* Input Area */
.chat-input {
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  /* Prevents input from shrinking */
}

#chatbot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#chatbot-input:focus {
  border-color: #00e5ff;
}

#chatbot-send {
  background: #00e5ff;
  color: #041226;
  border: none;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

#chatbot-send:hover {
  transform: scale(1.05);
}

/* Method Badges */
.method-badge {
  display: block;
  font-size: 10px;
  margin-top: 6px;
  opacity: 0.7;
  font-weight: 600;
}

/* Animations */
.animate-in {
  animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}