/* VA Chatbot Widget Styles */

:root {
  --va-primary: #001489;
  --va-primary-light: #1a2da1;
  --va-white: #ffffff;
  --va-gray-light: #f5f5f5;
  --va-gray: #666666;
  --va-border: #ddd;
  --va-shadow: rgba(0, 20, 137, 0.15);
  --va-error: #d32f2f;
}

/* Chat Widget Container */
#va-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  z-index: 9999;
}

/* Chat Button (Minimized State) */
#va-chat-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--va-primary);
  color: var(--va-white);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--va-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 24px;
}

#va-chat-button:hover {
  background: var(--va-primary-light);
  transform: scale(1.05);
}

#va-chat-button.hidden {
  display: none;
}

/* Chat Container (Expanded State) */
#va-chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 380px;
  height: 600px;
  min-width: 320px;
  min-height: 400px;
  max-width: 100vw;
  max-height: calc(100vh - 40px);
  background: var(--va-white);
  border-radius: 12px;
  border: 3px solid #999;
  box-shadow: 0 8px 32px var(--va-shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
  transition: all 0.3s ease;
}

#va-chat-container.active {
  display: flex;
}

/* Resize Handles */
\.va-resize-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  z-index: 10;
  background: var(--va-primary);
  border: 2px solid white;
  border-radius: 50%;
  opacity: 0.7;
  transition: opacity 0.2s;
}

\.va-resize-handle:hover {
  opacity: 1;
  transform: scale(1.2);
}

\.va-resize-nw {
  top: -10px;
  left: -10px;
  cursor: nw-resize;
}

\.va-resize-ne {
  top: -10px;
  right: -10px;
  cursor: ne-resize;
}

\.va-resize-sw {
  bottom: -10px;
  left: -10px;
  cursor: sw-resize;
}

\.va-resize-se {
  bottom: -10px;
  right: -10px;
  cursor: se-resize;
}

/* Full-width mode for search results */
#va-chat-container.search-mode {
  width: calc(100vw - 40px) !important;
  max-width: 1800px !important;
  height: calc(100vh - 100px) !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  bottom: 50px !important;
  resize: both !important;
  overflow: auto !important;
}

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

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

/* Chat Header */
#va-chat-header {
  background: var(--va-primary);
  color: var(--va-white);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
}

#va-chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #d0d0d0;
}

#va-chat-header \.va-header-controls {
  display: flex;
  gap: 8px;
}

#va-chat-header button {
  background: transparent;
  border: none;
  color: var(--va-white);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
  font-size: 14px;
}

#va-chat-header button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Mode Toggle */
#va-mode-toggle {
  background: var(--va-gray-light);
  padding: 8px;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--va-border);
}

#va-mode-toggle button {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s;
  color: var(--va-gray);
}

#va-mode-toggle button.active {
  background: var(--va-primary);
  color: var(--va-white);
  font-weight: 600;
}

/* Chat Messages Area */
#va-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--va-gray-light);
}

/* Message Bubbles */
\.va-message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  animation: fadeIn 0.3s ease;
}

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

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

\.va-message.user {
  align-self: flex-end;
  margin-left: 25%;
}

\.va-message.assistant {
  align-self: flex-start;
  margin-right: 25%;
}

\.va-message-content {
  padding: 12px 16px;
  border-radius: 16px;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 14px;
  max-height: none;
  overflow-y: auto;
  white-space: pre-wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

\.va-message.user \.va-message-content {
  background: linear-gradient(135deg, #001489 0%, #1a2da1 100%);
  color: var(--va-white);
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 20, 137, 0.25);
}

\.va-message.assistant \.va-message-content {
  background: #ffffff;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  max-height: none;
  overflow: visible;
}

\.va-message-content a {
  color: #1a0dab;
  text-decoration: underline;
  word-break: break-all;
}

\.va-message-content a:hover {
  color: #0066cc;
}

/* Search Results */
\.va-search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

\.va-search-result {
  background: #f8f9fa;
  padding: 14px;
  border-left: 4px solid var(--va-primary);
  border-radius: 6px;
  transition: all 0.2s;
}

\.va-search-result:hover {
  background: #e3f2fd;
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(0, 20, 137, 0.1);
}

\.va-search-result h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

\.va-search-result h4::before {
  content: "📄";
  margin-right: 8px;
  font-size: 16px;
}

\.va-search-result h4 a {
  color: var(--va-primary);
  text-decoration: none;
  flex: 1;
}

\.va-search-result a:hover {
  color: #0066cc;
  text-decoration: underline;
}

\.va-result-url {
  font-size: 14px;
  color: #006621;
  margin-bottom: 4px;
  word-break: break-all;
  line-height: 1.3;
}

\.va-result-url a {
  color: #006621;
  text-decoration: none;
}

\.va-result-url a:hover {
  text-decoration: underline;
}

\.va-search-result p {
  margin: 0;
  font-size: 13px;
  color: #555;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow: visible;
  text-overflow: clip;
}

/* Loading Indicator */
\.va-loading {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
}

\.va-loading span {
  width: 8px;
  height: 8px;
  background: var(--va-gray);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

\.va-loading span:nth-child(1) {
  animation-delay: -0.32s;
}

\.va-loading span:nth-child(2) {
  animation-delay: -0.16s;
}

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

  40% {
    transform: scale(1);
  }
}

/* Input Area */
#va-chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--va-border);
  background: var(--va-white);
  display: flex;
  gap: 8px;
}

#va-chat-input {
  flex: 1;
  border: 1px solid var(--va-border);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  max-height: 100px;
  font-family: inherit;
}

#va-chat-input:focus {
  border-color: var(--va-primary);
}

#va-send-button {
  background: var(--va-primary);
  color: var(--va-white);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

#va-send-button:hover:not(:disabled) {
  background: var(--va-primary-light);
}

#va-send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Citations */
\.va-citations {
  margin-top: 12px;
  padding: 12px;
  background: #f8f9fa;
  border-left: 3px solid var(--va-primary);
  border-radius: 4px;
  font-size: 12px;
}

\.va-citations-title {
  font-weight: 700;
  color: var(--va-primary);
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

\.va-citation {
  display: flex;
  align-items: flex-start;
  color: var(--va-primary);
  text-decoration: none;
  padding: 6px 8px;
  margin: 4px 0;
  background: white;
  border-radius: 4px;
  transition: all 0.2s;
  border: 1px solid #e0e0e0;
}

\.va-citation:hover {
  background: #e3f2fd;
  border-color: var(--va-primary);
  transform: translateX(2px);
}

\.va-citation::before {
  content: "🔗";
  margin-right: 6px;
  font-size: 14px;
}

/* Error Messages */
\.va-error {
  background: #ffebee;
  color: var(--va-error);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  border-left: 3px solid var(--va-error);
}

/* Responsive Design */
@media (max-width: 480px) {
  #va-chat-container {
    width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    bottom: 20px;
    right: 20px;
  }
}

/* Scrollbar Styling */
#va-chat-messages::-webkit-scrollbar {
  width: 6px;
}

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

#va-chat-messages::-webkit-scrollbar-thumb {
  background: var(--va-border);
  border-radius: 3px;
}

#va-chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--va-gray);
}

/* Enhanced Typing Indicator */
.va-typing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  align-self: flex-start;
  max-width: 240px;
  margin-left: 48px; /* Align with avatar */
  border: none;
  box-shadow: var(--shadow-sm);
}

.va-typing-content {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 85%;
}

.va-typing-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.va-avatar-initials {
  color: white;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.va-typing-bubble {
  background: #f1f3f4;
  border-radius: 18px 18px 18px 4px;
  padding: 12px 16px;
  min-width: 120px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.va-typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.va-typing-dot {
  width: 8px;
  height: 8px;
  background: #5f6368;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes typingBounce {
  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

.va-typing-text {
  font-size: 12px;
  color: #5f6368;
  font-weight: 500;
}

/* Enhanced Message Avatars */
.va-message {
  margin: 12px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  clear: both;
  position: relative;
}

.va-message.user {
  justify-content: flex-end;
}

.va-message.assistant {
  justify-content: flex-start;
}

.va-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-top: 4px;
}

.va-message-content-container {
  max-width: calc(100% - 40px);
}

/* Enhanced Message Bubbles */
.va-message.user .va-message-content {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border-radius: 18px 18px 4px 18px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
  max-width: 100%;
  position: relative;
}

.va-message.user .va-message-content::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: -6px;
  width: 0;
  height: 0;
  border-left: 8px solid #0056b3;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

.va-message.assistant .va-message-content {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #212529;
  border-radius: 18px 18px 18px 4px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  max-width: 100%;
  border: 1px solid #e0e0e0;
  position: relative;
}

.va-message.assistant .va-message-content::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -6px;
  width: 0;
  height: 0;
  border-right: 8px solid #e9ecef;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

/* Enhanced Message Status */
.va-message-status {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.va-message.user .va-message-status {
  justify-content: flex-end;
  margin-right: 4px;
}

.va-message.assistant .va-message-status {
  justify-content: flex-start;
  margin-left: 40px;
  /* Account for avatar */
}

.va-status-icon {
  font-size: 12px;
  line-height: 1;
}

.va-status-sent {
  color: #6c757d;
}

.va-status-delivered {
  color: #007bff;
}

.va-status-read {
  color: #28a745;
}

.va-status-text {
  color: #6c757d;
  font-weight: 500;
}

/* Enhanced Timestamps */
.va-message-time {
  font-size: 11px;
  color: #6c757d;
  margin-top: 2px;
  font-weight: 500;
}

.va-message.user .va-message-time {
  text-align: right;
  margin-right: 4px;
}

.va-message.assistant .va-message-time {
  text-align: left;
  margin-left: 40px;
  /* Account for avatar */
}

/* Animation for new messages */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.va-message {
  animation: fadeIn 0.3s ease;
}

.va-typing-indicator {
  animation: fadeIn 0.3s ease;
}

/* Enhanced loading animation */
.va-loading {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 18px 18px 18px 4px;
  margin: 12px 0 12px 40px;
  /* Account for avatar space */
  float: left;
  clear: both;
  max-width: 85%;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.va-loading span {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  animation: loadingPulse 1.5s ease-in-out infinite;
  margin: 0 2px;
}

@keyframes loadingPulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Enhanced Citations Styling */
.va-citations-container {
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid #e3e8f0;
  background: #f8fafc;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.va-citations-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-bottom: 1px solid #e3e8f0;
}

.va-citation-icon {
  color: #475569;
  stroke: #475569;
}

.va-citations-title {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.va-citations-grid {
  padding: 8px;
}

.va-citation-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
  margin-bottom: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.va-citation-card:last-child {
  margin-bottom: 0;
}

.va-citation-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.va-citation-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, #667eea, #764ba2);
  border-radius: 3px 0 0 3px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.va-citation-card:hover::before {
  opacity: 1;
}

.va-citation-number {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.va-citation-content {
  flex: 1;
  min-width: 0; /* Allows text truncation */
}

.va-citation-title {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.va-citation-domain {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

.va-link-icon {
  color: #94a3b8;
  stroke: #94a3b8;
}

.va-citation-arrow {
  color: #94a3b8;
  font-size: 16px;
  font-weight: 300;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.va-citation-card:hover .va-citation-arrow {
  color: #667eea;
  opacity: 1;
  transform: translateX(2px);
}

.va-citations-footer {
  padding: 8px 16px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  border-top: 1px solid #e3e8f0;
  background: #f1f5f9;
  font-weight: 500;
}

/* Make sure citations fit well in message bubbles */
.va-message.assistant .va-citations-container {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
}

.va-message.user .va-citations-container {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.va-message.user .va-citations-header {
  background: linear-gradient(
    135deg,
    rgba(0, 123, 255, 0.1) 0%,
    rgba(0, 86, 179, 0.1) 100%
  );
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.va-message.user .va-citations-footer {
  background: rgba(0, 123, 255, 0.05);
  border-top-color: rgba(255, 255, 255, 0.2);
}

.va-message.user .va-citation-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.3);
}

.va-message.user .va-citation-card:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(255, 255, 255, 0.5);
}

.va-message.user .va-citation-number {
  background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
}

.va-message.user .va-citation-title {
  color: #1e293b;
}

.va-message.user .va-citation-domain {
  color: #64748b;
}

.va-message.user .va-citation-card:hover .va-citation-arrow {
  color: #0056b3;
}

/* Enhanced Search Results with Avatar Support */
.va-message.assistant .va-search-results {
  background: white;
  border-radius: 12px;
  padding: 0;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin: 0;
  max-width: 100%;
  overflow: hidden;
}

.va-search-header {
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.va-search-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.va-search-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
}

.va-search-tips {
  font-size: 11px;
  opacity: 0.9;
}

.va-search-result {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.va-search-result:last-child {
  border-bottom: none;
}

.va-search-result:hover {
  background-color: #f8fafc;
}

.va-result-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.va-result-rank {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}

.va-result-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  flex: 1;
}

.va-result-title a {
  color: #1a0dab;
  text-decoration: none;
  transition: color 0.2s ease;
}

.va-result-title a:hover {
  color: #667eea;
  text-decoration: underline;
}

.va-result-url {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #006621;
  font-size: 13px;
  margin-bottom: 8px;
}

.va-url-icon {
  color: #006621;
  stroke: #006621;
  opacity: 0.7;
}

.va-result-link {
  color: #006621;
  text-decoration: none;
  font-weight: 500;
}

.va-result-link:hover {
  text-decoration: underline;
}

.va-result-snippet {
  color: #4d5156;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 12px 0;
}

.va-result-actions {
  display: flex;
  justify-content: flex-end;
}

.va-result-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.va-result-button:hover {
  background: #5568d3;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.va-button-icon {
  stroke: white;
}

.va-search-result-empty {
  padding: 32px 16px;
  text-align: center;
}

.va-search-empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.va-search-result-empty h4 {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 16px;
}

.va-search-result-empty p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

/* Ensure search results work with avatar layout */
.va-message.assistant .va-message-content-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Search mode specific styles */
.va-chat-window.search-mode .va-text-input {
  font-size: 15px;
  padding: 14px 18px;
  min-height: 54px;
  border-radius: var(--radius-xl);
  background: var(--bg-primary);
  border: 2px solid var(--accent-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.va-chat-window.search-mode .va-input-wrapper {
  gap: 16px;
  width: 100%;
}

.va-chat-window.search-mode .va-send-button {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
}

.va-chat-window.search-mode .va-input-hint {
  text-align: right;
  padding-right: 12px;
  font-weight: 500;
  color: var(--accent-color);
}

.va-typing-indicator .va-typing-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.va-typing-indicator .va-avatar-initials {
  color: white;
  font-size: 12px;
  font-weight: 600;
}

.va-typing-indicator .va-typing-bubble {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.va-typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.va-typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

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

@keyframes typingBounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.va-typing-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* Clean Avatar Styling */
.va-message-avatar .va-avatar-gradient {
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  margin-top: 4px;
  border: none;
  box-shadow: var(--shadow-sm);
}

/* Remove borders from message bubbles */
.va-message-bubble.assistant {
  background: var(--bg-tertiary);
  border: none;
  align-self: flex-start;
  border-radius: var(--radius-xl);
  border-bottom-left-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.va-message-bubble.user {
  background: var(--primary-gradient);
  color: white;
  align-self: flex-end;
  border-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  border: none;
}

/* ============================================
   SEARCH MODE & TYPING INDICATOR FIXES
   ============================================ */

/* Search Mode - Expanded Input */
.va-chat-window.search-mode .va-input-container {
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-top: 1px solid var(--border-color);
}

.va-chat-window.search-mode .va-input-wrapper {
  gap: 16px;
  align-items: center;
}

.va-chat-window.search-mode .va-text-input {
  font-size: 15px;
  padding: 16px 20px;
  min-height: 56px;
  border-radius: var(--radius-xl);
  background: white;
  border: 2px solid var(--accent-color);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
  font-weight: 500;
}

.va-chat-window.search-mode .va-text-input:focus {
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
  transform: translateY(-1px);
}

.va-chat-window.search-mode .va-send-button {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  background: var(--primary-gradient);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.va-chat-window.search-mode .va-send-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.va-chat-window.search-mode .va-input-hint {
  text-align: right;
  margin-top: 12px;
  padding-right: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-color);
  letter-spacing: 0.3px;
}

/* Clean Typing Indicator */
.va-typing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
  align-self: flex-start;
  max-width: 240px;
  margin-left: 48px;
  box-shadow: var(--shadow-sm);
  animation: slideIn 0.3s ease;
  border: none;
}

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

.va-typing-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.va-typing-avatar .va-avatar-initials {
  color: white;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.va-typing-bubble {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.va-typing-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.va-typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

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

@keyframes typingBounce {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.4;
  }
  40% {
    transform: scale(1.1);
    opacity: 1;
  }
}

.va-typing-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* Clean Avatar Styling - Remove Borders */
.va-message-avatar .va-avatar-gradient {
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: var(--shadow-sm);
  border: none;
}

/* Clean Message Bubbles - Remove Container Borders */
.va-message-bubble.assistant {
  background: var(--bg-tertiary);
  align-self: flex-start;
  border-radius: var(--radius-xl);
  border-bottom-left-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: none;
}

.va-message-bubble.user {
  background: var(--primary-gradient);
  color: white;
  align-self: flex-end;
  border-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  border: none;
}

/* Message Content without extra borders */
.va-message-content {
  font-size: 14px;
  line-height: 1.5;
  color: inherit;
}

/* Search Results - Keep clean design but match theme */
.va-search-results {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin: 0;
  border: none;
}

.va-search-header {
  padding: 16px 20px;
  background: var(--primary-gradient);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.va-search-result {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.va-search-result:hover {
  background: var(--bg-secondary);
}
