/* public/css/chatbot.css */

:root {
  --chatbot-theme: #7f1f29;
  --chatbot-theme-hover: #5c141d;
}

.chatbot-bg-theme {
  background-color: var(--chatbot-theme) !important;
  color: #ffffff !important;
}

.chatbot-bg-theme:hover {
  background-color: var(--chatbot-theme-hover) !important;
}

.chatbot-btn-send {
  background-color: #ffffff !important;
  border: 2px solid var(--chatbot-theme) !important;
  color: var(--chatbot-theme) !important;
  transition: all 0.2s ease-in-out;
}

.chatbot-btn-send:hover {
  background-color: var(--chatbot-theme) !important;
  color: #ffffff !important;
}


#ai-chatbot-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1050;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#ai-chatbot-toggle {
  width: 60px;
  height: 60px;
  transition: transform 0.3s ease;
  margin-top: 15px;
}

#ai-chatbot-toggle:hover {
  transform: scale(1.1);
}

#ai-chatbot-panel {
  width: 350px;
  height: 500px;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s ease forwards;
}

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

/* Markdown parsing inside bot bubble */
.chat-message.bot {
  font-size: 0.95rem;
}
.chat-message.bot p {
  margin-bottom: 0.5rem;
}
.chat-message.bot p:last-child {
  margin-bottom: 0;
}

/* Chat Bubbles */
.chat-message {
  max-width: 85%;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-message.user {
  align-self: flex-end;
  background-color: var(--chatbot-theme);
  color: #fff;
  border-radius: 15px 15px 0 15px;
}

.chat-message.bot {
  align-self: flex-start;
  background-color: #f1f1f1;
  color: #333;
  border-radius: 15px 15px 15px 0;
}

.chat-message.bot a {
  color: var(--chatbot-theme);
  text-decoration: underline;
  font-weight: 600;
}

.chat-message.bot a:hover {
  color: var(--chatbot-theme-hover);
}

/* Typing Indicator Animation */
.typing-indicator .dot {
  animation: blink 1.4s infinite both;
}

.typing-indicator .dot:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes blink {
  0% { opacity: 0.2; }
  20% { opacity: 1; }
  100% { opacity: 0.2; }
}

/* Error message styling */
.chat-message.error {
  align-self: center;
  background-color: var(--bs-danger-light, #f8d7da);
  color: var(--bs-danger, #dc3545);
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  padding: 8px 12px;
}

/* System message styling */
.chat-message.system {
  align-self: center;
  color: var(--bs-text-muted, #6c757d);
  font-size: 0.85rem;
  text-align: center;
  background: transparent;
}

/* Mobile Responsiveness */
@media (max-width: 576px) {
  #ai-chatbot-widget {
    bottom: 15px;
    right: 15px;
  }
  
  #ai-chatbot-toggle {
    width: 55px;
    height: 55px;
  }
  
  #ai-chatbot-panel {
    width: calc(100vw - 30px);
    height: 80vh;
    max-height: 600px;
  }
}

