/* --- VlookUp Global Chatbot UI --- */

/* Color Variables for easy themeing */
:root {
  --vlookup-dark-blue: #0a192f; /* From your footer */
  --vlookup-bright-blue: #2563eb; /* From buttons and links */
  --vlookup-light-gray: #f3f4f6; /* For bot messages */
  --vlookup-text-dark: #1f2937;
  --vlookup-text-light: #ffffff;
  --vlookup-border-color: #e5e7eb;
}

/* Main floating toggle button */
.chatbot-toggle-button {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 60px;
  height: 60px;
  background-color: var(--vlookup-dark-blue);
  color: var(--vlookup-text-light);
  border: none;
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(10, 25, 47, 0.2);
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-toggle-button:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(10, 25, 47, 0.3);
}

/* The main container for the chat window */
.chatbot-container {
  display: none; /* Hidden by default */
  position: fixed;
  bottom: 90px;  /* <--- MOVED DOWN */
  right: 25px;
  width: 370px;
  height: 500px; /* <--- MADE SLIGHTLY SHORTER */
  z-index: 1000;
  font-family: 'Poppins', 'Segoe UI', 'Roboto', sans-serif;
  flex-direction: column;
  animation: slideUp 0.5s ease-out;
}

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

/* The chat box itself with styling */
.chatbot-box {
  width: 100%;
  height: 100%;
  background: var(--vlookup-text-light);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(10, 25, 47, 0.2);
  border: 1px solid var(--vlookup-border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header section */
.chatbot-header {
  background: var(--vlookup-dark-blue);
  color: var(--vlookup-text-light);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--vlookup-dark-blue);
}

.chatbot-header-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.chatbot-close {
  background: none;
  border: none;
  color: var(--vlookup-text-light);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

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

/* Chat messages area */
.chatbot-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background-color: #f9fafb;
}

/* Styling for individual message bubbles */
.chatbot-message {
  padding: 0.75rem 1rem;
  border-radius: 18px;
  max-width: 85%;
  line-height: 1.5;
  word-wrap: break-word;
}

.chatbot-message.bot {
  background: var(--vlookup-light-gray);
  color: var(--vlookup-text-dark);
  border-radius: 18px 18px 18px 5px;
  align-self: flex-start;
}

.chatbot-message.user {
  background: var(--vlookup-bright-blue);
  color: var(--vlookup-text-light);
  border-radius: 18px 18px 5px 18px;
  align-self: flex-end;
}

.chatbot-message.error {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* Input area at the bottom */
.chatbot-input-section {
  padding: 1rem;
  border-top: 1px solid var(--vlookup-border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--vlookup-text-light);
}

.chatbot-input {
  flex-grow: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--vlookup-border-color);
  border-radius: 25px;
  outline: none;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-input:focus {
  border-color: var(--vlookup-bright-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.chatbot-send-btn {
  background: var(--vlookup-bright-blue);
  color: var(--vlookup-text-light);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.chatbot-send-btn:hover {
  background-color: #1e40af; /* A darker shade of the bright blue */
}

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

/* Typing indicator animation */
.typing-indicator {
  padding: 0.75rem 1rem;
}
.typing-indicator span {
  display: inline-block;
  background-color: #9ca3af;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 2px;
  animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

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

/* Custom scrollbar for a cleaner look */
.chatbot-body::-webkit-scrollbar { width: 6px; }
.chatbot-body::-webkit-scrollbar-track { background: transparent; }
.chatbot-body::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
.chatbot-body::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
  .chatbot-container {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  .chatbot-box {
      border-radius: 0;
  }
  .chatbot-toggle-button {
      bottom: 15px;
      right: 15px;
  }
}

/* Font Awesome Icon CSS (ensure you have Font Awesome linked in your HTML) */
.fas {
    line-height: 1; /* Helps with vertical alignment */
}
/* Add this to your chatbot.css file */
.chatbot-option-message {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    cursor: pointer;
    text-align: center;
    margin: 4px auto !important;
    width: 80%;
    transition: background-color 0.2s;
}

.chatbot-option-message:hover {
    background-color: #e0e0e0;
}