/* ========================================
   Arcadian Chatbot - Clean Professional Styling
   ======================================== */

/* CSS Variables */
:root {
  --arc-primary-color: #B53086;
  --arc-primary-light: #AC2A7B;
  --arc-success-color: #28a745;
  --arc-success-dark: #1e7e34;
  --arc-gray-50: #F9F9F9;
  --arc-gray-100: #F4F4F4;
  --arc-gray-200: #E7E7E7;
  --arc-gray-300: #C8C8C8;
  --arc-gray-400: #ABABAB;
  --arc-gray-500: #9F9F9F;
  --arc-gray-600: #979797;
  --arc-gray-700: #2E2E2E;
  --arc-gray-800: #39393A;
  --arc-gray-900: #000000;
  --arc-white: #FFFFFF;
  --arc-font-family: Inter, sans-serif;
}

/* ========================================
   Base Container & Layout
   ======================================== */

.arc-chatbot-container {
  font-family: var(--arc-font-family);
  background: var(--arc-white);
  border: 1px solid var(--arc-gray-200);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Messages Container & Layout
   ======================================== */

.arc-chat-messages {
  flex: 1;
  padding: 24px;
  background: var(--arc-gray-50);
  overflow-y: auto;
  min-height: 400px;
  max-height: 600px;
}

.arc-message {
  display: flex;
  margin-bottom: 20px;
  align-items: flex-start;
  gap: 12px;
  animation: slideInUp 0.3s ease-out;
}

.arc-message-user {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.arc-message-content {
  max-width: 80%;
  word-wrap: break-word;
}

/* Remove avatars for cleaner look */
.arc-message-avatar {
  display: none;
}

/* ========================================
   Message Bubbles
   ======================================== */

.arc-message-bubble {
  padding: 16px 20px;
  border-radius: 20px;
  line-height: 1.5;
  font-size: 15px;
}

/* User Messages */
.arc-message-user .arc-message-bubble {
  background: var(--arc-gray-200);
  color: var(--arc-gray-800);
  border-bottom-right-radius: 6px;
  margin-left: 60px;
}

/* Bot Messages */
.arc-message-bot .arc-message-bubble {
  background: var(--arc-white);
  color: var(--arc-gray-700);
  border: 1px solid var(--arc-gray-200);
  border-bottom-left-radius: 6px;
  margin-right: 60px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Welcome Message */
.arc-welcome-message .arc-message-bubble {
  background: linear-gradient(135deg, var(--arc-gray-100) 0%, var(--arc-gray-200) 100%);
  border: 1px solid var(--arc-gray-300);
}

/* ========================================
   Message Text Formatting
   ======================================== */

.arc-message-text {
  margin: 0;
}

.arc-message-text p {
  margin: 0 0 12px 0;
}

.arc-message-text p:last-child {
  margin-bottom: 0;
}

.arc-message-text strong {
  font-weight: 600;
  color: var(--arc-gray-800);
}

/* Lists */
.arc-message-text ul {
  margin: 8px 0;
  padding-left: 0;
  list-style: none;
}

.arc-message-text li {
  margin-bottom: 8px;
  padding-left: 16px;
  position: relative;
}

.arc-message-text li:before {
  content: "🔗";
  position: absolute;
  left: 0;
  top: 0;
}

/* ========================================
   Links & Interactive Elements
   ======================================== */

/* General Links */
/* .arc-message-text a,
.arc-response-link {
  color: var(--arc-primary-color);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.arc-message-text a:hover,
.arc-response-link:hover {
  color: var(--arc-primary-light);
  border-bottom-color: var(--arc-primary-light);
  text-decoration: none;
  background-color: rgba(181, 48, 134, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
  margin: -2px -4px;
}
*/
/* External Link Indicator */
/*.arc-response-link[target="_blank"]:after {
  content: "↗";
  font-size: 12px;
  margin-left: 4px;
  opacity: 0.7;
}
*/
/* Product Links */
/* .arc-product-link {
  color: var(--arc-success-color) !important;
  text-decoration: none;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(40, 167, 69, 0.1);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-block;
}

.arc-product-link:hover {
  color: var(--arc-white) !important;
  background-color: var(--arc-success-color);
  border-color: var(--arc-success-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.arc-product-link:after {
  content: "🛒";
  font-size: 11px;
  margin-left: 4px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.arc-product-link:hover:after {
  opacity: 1;
} */

/* Source Links Section */
.arc-message-text strong:contains("📚 Related Pages:") {
  display: block;
  margin-top: 15px;
  margin-bottom: 8px;
  color: #667eea;
  font-size: 14px;
}

/* More Info Links */
.arc-more-info-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.arc-more-info-link::after {
  content: '→';
  font-size: 14px;
  transition: transform 0.2s ease;
}

.arc-more-info-link:hover::after {
  transform: translateX(2px);
}

/* ========================================
   Input Container & Controls
   ======================================== */

.arc-chat-input-container {
  background: var(--arc-white);
  border-top: 1px solid var(--arc-gray-200);
  padding: 20px 24px;
}

.arc-input-container {
  display: flex;
  align-items: flex-end;
  background: var(--arc-gray-50);
  border: 1px solid var(--arc-gray-300);
  border-radius: 24px;
  padding: 8px 12px 8px 20px;
  transition: all 0.2s ease;
}

.arc-input-container:focus-within {
  border-color: var(--arc-primary-color);
  box-shadow: 0 0 0 3px rgba(181, 48, 134, 0.1);
  background: var(--arc-white);
}

.arc-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 15px;
  font-family: var(--arc-font-family);
  color: var(--arc-gray-700);
  padding: 12px 0;
  min-height: 20px;
  max-height: 120px;
  line-height: 1.4;
}

.arc-chat-input::placeholder {
  color: var(--arc-gray-400);
}

/* Send Button */
.arc-send-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--arc-primary-color);
  color: var(--arc-white);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-left: 12px;
  flex-shrink: 0;
}

.arc-send-btn svg {
  width: 18px;
  height: 18px;
  margin-left: 1px; /* Center the arrow */
}

/* ========================================
   Typing Indicator
   ======================================== */

.arc-typing-indicator {
  padding: 0 24px 20px;
  background: var(--arc-gray-50);
}

.arc-typing-dots {
  display: flex;
  gap: 4px;
  padding: 16px 20px;
  background: var(--arc-white);
  border: 1px solid var(--arc-gray-200);
  border-radius: 20px;
  border-bottom-left-radius: 6px;
  margin-right: 60px;
  width: fit-content;
}

.arc-typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--arc-gray-400);
  animation: arc-typing 1.4s infinite ease-in-out;
}

.arc-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.arc-typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.arc-typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes arc-typing {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================
   Suggestions
   ======================================== */

.arc-suggestions-container {
  margin: 16px 0;
  text-align: left;
}

.arc-suggestions-label {
  font-size: 14px;
  color: var(--arc-gray-500);
  margin-bottom: 12px;
  font-weight: 500;
}

.arc-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.arc-suggestion-btn {
  background: var(--arc-white);
  border: 1px solid var(--arc-gray-200);
  color: var(--arc-gray-700);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.arc-suggestion-btn:hover {
  border-color: var(--arc-primary-color);
  color: var(--arc-primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Error Messages
   ======================================== */

.arc-error-container {
  position: relative;
  background: #FFF2F2;
  border: 1px solid #FF9ED2;
  color: #F05A22;
  padding: 12px 20px;
  margin: 16px 24px;
  border-radius: 8px;
  font-size: 14px;

  .arc-error-message {
    position: relative;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 10px;
  }

  .arc-error-close {
    position: absolute;
    right: 10px;
    top: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #000;
  }
}

.arc-citation {
  color: var(--arc-gray-500);
}

/* ========================================
   Scrollbar Styling
   ======================================== */

.arc-chat-messages::-webkit-scrollbar {
  width: 6px;
}

.arc-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.arc-chat-messages::-webkit-scrollbar-thumb {
  background: var(--arc-gray-300);
  border-radius: 3px;
}

.arc-chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--arc-gray-400);
}

/* ========================================
   Animations
   ======================================== */

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

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
  .arc-chat-messages {
    padding: 16px;
    min-height: 300px;
  }
  
  .arc-message-content {
    max-width: 85%;
  }
  
  .arc-message-user .arc-message-bubble {
    margin-left: 40px;
  }
  
  .arc-message-bot .arc-message-bubble {
    margin-right: 40px;
  }
  
  .arc-chat-input-container {
    padding: 16px;
  }

  .arc-product-link {
    padding: 1px 4px;
    font-size: 14px;
  }

  .arc-message-text a,
  .arc-response-link {
    font-size: 14px;
  }
}

/* ========================================
   High Contrast & Accessibility
   ======================================== */

@media (prefers-contrast: high) {
  :root {
    --arc-primary-color: #000;
    --arc-primary-light: #333;
    --arc-success-color: #006400;
    --arc-success-dark: #004000;
  }
  
  .arc-chatbot-container {
    border: 2px solid var(--arc-gray-900);
  }
  
  .arc-message-bubble {
    border: 2px solid var(--arc-gray-700);
  }
}

@media (prefers-reduced-motion: reduce) {
  .arc-message {
    animation: none;
  }
  
  .arc-typing-dots span {
    animation: none;
  }
  
  * {
    transition: none !important;
    transform: none !important;
  }
}