/* Chatbot Toggle Button - Matching navigation arrows theme */
.chatbot-toggle {
  position: fixed;
  bottom: 150px; /* Position above the navigation arrows */
  right: 10px;
  width: 48px;
  height: 48px;
  background-color: #444;
  border: 2px solid #5050f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 0 30px -5px rgba(0,0,0,.15);
}

.chatbot-toggle:hover {
  background-color: #555;
  transform: scale(1.05);
}

.chatbot-toggle i {
  color: #b5b6b7;
  font-size: 24px;
  transition: color 0.3s ease-in-out;
}

.chatbot-toggle:hover i {
  color: #5050f5;
}

/* Chatbot Container */
.chatbot-container {
  position: fixed;
  bottom: 210px; /* Position above the toggle button */
  right: 10px;
  width: 380px;
  height: 600px;
  background-color: #2b2b2b;
  border: 2px solid #5050f5;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  z-index: 98;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
}

.chatbot-container.active {
  display: flex;
}

/* Chatbot Header */
.chatbot-header {
  background: linear-gradient(135deg, #5050f5 0%, #4040d0 100%);
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chatbot-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.chatbot-header .close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.chatbot-header .close-btn:hover {
  background-color: rgba(255,255,255,0.2);
}

/* Chat Messages Area */
.chatbot-body {
  flex: 1;
  overflow-y: auto;
  background-color: #2b2b2b;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Welcome Message */
.welcome-message {
  background-color: #3a3a3a;
  padding: 20px;
  border-radius: 10px;
  color: #e0e0e0;
  line-height: 1.6;
}

.welcome-message p {
  margin: 10px 0;
}

.welcome-message ul {
  margin: 10px 0;
  padding-left: 25px;
}

.welcome-message li {
  margin: 5px 0;
}

/* Chat Messages */
.chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: slideIn 0.3s ease-out;
}

.user-message {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.user-message .message-content {
  background-color: #5050f5;
  color: white;
  margin-left: auto;
}

.assistant-message .message-content {
  background-color: #444;
  color: #e0e0e0;
}

.error-message .message-content {
  background-color: #f55050;
  color: white;
}

.message-avatar {
  font-size: 24px;
  min-width: 32px;
  text-align: center;
}

.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 75%;
  word-wrap: break-word;
  line-height: 1.5;
}

/* Custom ChatKit styling to match theme */
#chatkit-widget {
  width: 100%;
  height: 100%;
  background-color: #2b2b2b;
}

/* Override ChatKit default styles */
.chatkit-message-user {
  background-color: #5050f5 !important;
}

.chatkit-message-assistant {
  background-color: #444 !important;
  color: #e0e0e0 !important;
}

.chatkit-input {
  background-color: #333 !important;
  border-color: #5050f5 !important;
  color: white !important;
}

.chatkit-input:focus {
  border-color: #6060ff !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .chatbot-container {
    width: calc(100vw - 20px);
    right: 10px;
    left: 10px;
    bottom: 80px;
    height: calc(100vh - 100px);
    max-height: 600px;
  }

  .chatbot-toggle {
    bottom: 70px;
    right: 10px;
  }
}

/* Animation for opening */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-container.active {
  animation: slideUp 0.3s ease-out;
}

/* Pulsing effect on toggle button to draw attention */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(80, 80, 245, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(80, 80, 245, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(80, 80, 245, 0);
  }
}

.chatbot-toggle.pulse {
  animation: pulse 2s infinite;
}

/* Chat Input Area */
.chatbot-input-area {
  padding: 15px;
  background-color: #333;
  border-top: 1px solid #444;
  display: flex;
  gap: 10px;
}

#chatbot-input {
  flex: 1;
  background-color: #2b2b2b;
  border: 2px solid #5050f5;
  color: #e0e0e0;
  padding: 12px 16px;
  border-radius: 25px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#chatbot-input:focus {
  border-color: #6060ff;
}

#chatbot-input::placeholder {
  color: #888;
}

#chatbot-send {
  background-color: #5050f5;
  border: none;
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

#chatbot-send:hover {
  background-color: #6060ff;
  transform: scale(1.05);
}

#chatbot-send:active {
  transform: scale(0.95);
}

/* Typing Indicator */
.typing-dots {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background-color: #888;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
