/* ============================================================================
 * Sale AI - Chatbot Widget Styles
 * Version: 2.0
 * Description: Styles for embeddable chat widget
 * ============================================================================ */

/* CSS Variables - Will be injected dynamically by widget.js */
:root {
  --widget-theme-color: #2563eb;
  --widget-font-family: 'Roboto', Arial, sans-serif, 'Inter', 'Open Sans', 'Poppins', 'Nunito';
  --widget-border-radius: 12px;
}

/* ============================================================================
 * SCROLLBAR STYLES
 * ============================================================================ */
#my-chatbot-widget *::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

#my-chatbot-widget *::-webkit-scrollbar-track {
  background: transparent;
}

#my-chatbot-widget *::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 10px;
  border: 2px solid transparent;
  /* Padding effect */
  background-clip: content-box;
}

#my-chatbot-widget *::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.7);
  border: 1px solid transparent;
  background-clip: content-box;
}


/* ============================================================================
 * CHAT BUBBLE
 * ============================================================================ */
/* Main Chat Bubble Container */
#my-chatbot-widget .sale-ai-chat-bubble {
  position: fixed;
  width: 64px;
  height: 64px;
  color: #fff;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  z-index: 2147483647 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, transform 0.3s ease;
  animation: bubblePulse 3s ease-in-out infinite;
  white-space: nowrap;
  background-clip: padding-box;
  /* Prepare for possible gradient border trick, though keeping simple for now */
}

/* RGB Spinning Gradient - The "Running Border" Source */
#my-chatbot-widget .sale-ai-bubble-gradient-spinner {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg,
      transparent 0deg,
      transparent 80deg,
      rgba(255, 255, 255, 0.8) 180deg,
      transparent 180deg);
  animation: spinBorder 2s linear infinite;
  z-index: 0;
  opacity: 0;
  /* Hidden by default */
  transition: opacity 0.3s ease;
  filter: blur(8px);
  /* Soft glow */
}

@keyframes spinBorder {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Inner Background Overlay - Masks the center to show only border */
#my-chatbot-widget .sale-ai-bubble-overlay {
  display: block !important;
  position: absolute;
  inset: 2px;
  /* Border thickness */
  background: var(--widget-theme-color);
  /* Default, overridden by JS */
  border-radius: 30px;
  /* Slightly smaller than bubble */
  z-index: 1;
}

/* Hover State - Show RGB Border & Slide Out */
#my-chatbot-widget .sale-ai-chat-bubble:hover {
  width: 250px;
  /* Slightly wider for better spacing */
  justify-content: space-between;
  padding-left: 0;
  padding-right: 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  /* Glow ring effect */
  animation: none;
  transform: translateY(-2px);
}





/* CTA Text - Chat với AI Agent */
#my-chatbot-widget .sale-ai-chat-bubble::after {
  content: 'Chat với AI Agent';
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  /* White fill */
  -webkit-text-stroke: 1.5px #000;
  /* Black outline stroke */
  paint-order: stroke fill;
  /* Draw stroke behind fill */
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
  /* Bouncy text entry */
  max-width: 0;
  z-index: 5;
  /* Above overlay */
  position: relative;
  /* Ensure z-index works */
}

#my-chatbot-widget .sale-ai-chat-bubble:hover::after {
  opacity: 1;
  max-width: 160px;
  transform: translateX(0);
  margin-left: 10px;
  color: #fff;
  /* Chữ trắng nổi bật */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Make background colorful on hover */
#my-chatbot-widget .sale-ai-chat-bubble:hover .sale-ai-bubble-overlay {
  background: var(--widget-theme-color) !important;
  background: linear-gradient(135deg, var(--widget-theme-color), var(--widget-theme-color-dd)) !important;
}

/* Avatar Styling */
#my-chatbot-widget .sale-ai-bubble-avatar {
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  background: #fff;
  z-index: 5;
  /* Above overlay */
  position: relative;
}

/* Avatar Animation on Hover - Reverted to scale down */
#my-chatbot-widget .sale-ai-chat-bubble:hover .sale-ai-bubble-avatar {
  transform: scale(0.9);
}

#my-chatbot-widget .sale-ai-bubble-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  min-width: 64px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 2;
}

#my-chatbot-widget .sale-ai-chat-bubble.sale-ai-no-avatar {
  background: var(--widget-theme-color) !important;
}

#my-chatbot-widget .sale-ai-chat-bubble.sale-ai-no-avatar .sale-ai-bubble-icon {
  display: flex;
}

/* ============================================================================
 * CHAT WINDOW
 * ============================================================================ */
#my-chatbot-widget {
  font-family: var(--widget-font-family) !important;
}

#my-chatbot-widget * {
  font-family: var(--widget-font-family) !important;
}

#my-chatbot-widget .sale-ai-chat-window {
  display: none;
  position: fixed;
  width: 420px;
  height: 600px;
  /* Glass Card Background with Gradient */
  background: linear-gradient(180deg, #FFF 16.17%, #EAEAEA 100%);
  backdrop-filter: blur(35px);
  -webkit-backdrop-filter: blur(35px);
  /* No border - header will create seamless top edge */
  border: none;
  border-radius: 24px;
  /* Shadow only - removed inset shadows that caused white edges */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  flex-direction: column;
  z-index: 2147483647 !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: var(--widget-font-family);
  overflow: hidden;
}

/* Top Edge Gradient Highlight - DISABLED for seamless header */
#my-chatbot-widget .sale-ai-chat-window::before {
  display: none;
}

/* Left Edge Gradient Highlight - DISABLED for seamless header */
#my-chatbot-widget .sale-ai-chat-window::after {
  display: none;
}

#my-chatbot-widget .sale-ai-chat-window.open {
  display: flex;
}

/* ============================================================================
 * CHAT HEADER 
 * ============================================================================ */
#my-chatbot-widget .sale-ai-chat-header {
  position: relative;
  padding: 14px 16px;
  background: var(--widget-theme-color);
  color: #fff;
  /* NO border-radius on header - let chat-window's overflow:hidden handle corners */
  border-radius: 0;
  z-index: 1;

  /* No margin needed - header fills edge to edge */
  margin: 0;
  /* No border on header */
  border: none;

  /* Keep the glow effect */
  box-shadow: 0 4px 30px var(--widget-theme-color-15);
}

/* Disable legacy 3D layers */
#my-chatbot-widget .sale-ai-chat-header::before,
#my-chatbot-widget .sale-ai-chat-header::after,
#my-chatbot-widget .sale-ai-chat-header .sale-ai-header-glow,
#my-chatbot-widget .sale-ai-header-pattern {
  display: none;
}

#my-chatbot-widget .sale-ai-chat-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#my-chatbot-widget .sale-ai-chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  /* Prevent overflow */
}

#my-chatbot-widget .sale-ai-avatar-container {
  position: relative;
  flex-shrink: 0;
}

#my-chatbot-widget .sale-ai-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

#my-chatbot-widget .sale-ai-online-indicator {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--widget-theme-color);
}

#my-chatbot-widget .sale-ai-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  /* Prevent overflow */
}

#my-chatbot-widget .sale-ai-chat-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#my-chatbot-widget .sale-ai-online-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1;
}

#my-chatbot-widget .sale-ai-chat-header-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

#my-chatbot-widget .sale-ai-chat-resize-btn,
#my-chatbot-widget .sale-ai-chat-close-btn,
#my-chatbot-widget .sale-ai-chat-reset-btn,
#my-chatbot-widget .sale-ai-chat-cart-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#my-chatbot-widget .sale-ai-chat-resize-btn:hover,
#my-chatbot-widget .sale-ai-chat-close-btn:hover,
#my-chatbot-widget .sale-ai-chat-reset-btn:hover,
#my-chatbot-widget .sale-ai-chat-cart-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Cart Button Specific Styles */
#my-chatbot-widget .sale-ai-chat-cart-btn {
  position: relative;
}

#my-chatbot-widget .sale-ai-chat-cart-btn .sale-ai-cart-icon {
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#my-chatbot-widget .sale-ai-chat-cart-btn .sale-ai-cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
  animation: cartBadgePop 0.3s ease-out;
}

@keyframes cartBadgePop {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.2);
  }

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

/* Cart Close Button - Ensure clickable */
#my-chatbot-widget .sale-ai-cart-close-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  border: none !important;
  background: #f3f4f6 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 18px !important;
  color: #6b7280 !important;
  transition: all 0.2s !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
}

#my-chatbot-widget .sale-ai-cart-close-btn:hover {
  background: #e5e7eb !important;
  color: #374151 !important;
}

/* ============================================================================
 * STAFF INTERVENTION INDICATOR (Messenger-style)
 * ============================================================================ */
#my-chatbot-widget .sale-ai-staff-intervention-indicator {
  display: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideDown 0.3s ease-out;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

#my-chatbot-widget .sale-ai-staff-intervention-indicator .sale-ai-indicator-content {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}

#my-chatbot-widget .sale-ai-staff-intervention-indicator .sale-ai-indicator-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#my-chatbot-widget .sale-ai-staff-intervention-indicator .sale-ai-indicator-avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

#my-chatbot-widget .sale-ai-staff-intervention-indicator .sale-ai-indicator-icon {
  font-size: 16px;
  flex-shrink: 0;
}

#my-chatbot-widget .sale-ai-staff-intervention-indicator .sale-ai-indicator-text {
  font-size: 13px;
  flex: 1;
  font-weight: 500;
  letter-spacing: 0.2px;
}

#my-chatbot-widget .sale-ai-staff-intervention-indicator .sale-ai-indicator-text strong {
  font-weight: 600;
}

/* ============================================================================
 * CHAT MESSAGES
 * ============================================================================ */
#my-chatbot-widget .sale-ai-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: transparent;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  isolation: isolate;
  /* Create stacking context */
}


#my-chatbot-widget .sale-ai-message {
  display: flex;
  margin-bottom: 0;
  animation: fadeInUp 0.3s ease-out;
}

#my-chatbot-widget .sale-ai-user-message {
  justify-content: flex-end;
}

#my-chatbot-widget .sale-ai-ai-message {
  justify-content: flex-start;
}

#my-chatbot-widget .sale-ai-agent-message {
  justify-content: flex-start;
}

#my-chatbot-widget .sale-ai-system-message {
  justify-content: center;
  margin: 8px 0;
}

#my-chatbot-widget .sale-ai-message-bubble {
  max-width: 85%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.6;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

#my-chatbot-widget .sale-ai-user-message .sale-ai-message-bubble {
  background: var(--widget-theme-color);
  color: #fff;
  border-radius: 20px 20px 4px 20px;
  /* Tail at bottom-right */
  box-shadow: 0 4px 12px var(--widget-theme-color-30), 0 2px 4px rgba(0, 0, 0, 0.05);
  /* Deep 3D Shadow */
}

#my-chatbot-widget .sale-ai-ai-message .sale-ai-message-bubble {
  background: linear-gradient(180deg, #FFF 0%, #d3d3d3ad 100%);
  color: #1f2937;
  border: none;
  border-radius: 20px 20px 20px 4px;
  /* Tail at bottom-left */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  /* Soft 3D Shadow */
}

#my-chatbot-widget .sale-ai-agent-message .sale-ai-message-bubble {
  background: linear-gradient(180deg, #FFF 0%, #afb3b56b 100%);
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-top-left-radius: 4px;
}

#my-chatbot-widget .sale-ai-system-message .sale-ai-message-bubble {
  background: transparent !important;
  color: #65676B !important;
  border: none !important;
  border-radius: 0 !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  padding: 4px 8px !important;
  max-width: 90% !important;
  text-align: center !important;
  margin: 0 auto !important;
  box-shadow: none !important;
}

/* Message bubbles containing forms should have full width */
#my-chatbot-widget .sale-ai-message-bubble:has(.sale-ai-message-form),
#my-chatbot-widget .sale-ai-message-bubble:has(.sale-ai-message-form-container) {
  max-width: 100% !important;
  overflow: visible !important;
}

/* Custom radio button styling for region selection */
#my-chatbot-widget .sale-ai-region-radio-label input[type="radio"]:checked {
  border-color: #e11d48 !important;
  background: white !important;
}

#my-chatbot-widget .sale-ai-region-radio-label input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e11d48;
}

#my-chatbot-widget .sale-ai-system-message .sale-ai-message-timestamp {
  display: none !important;
}

#my-chatbot-widget .sale-ai-message-timestamp {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
  line-height: 1;
}

/* Table styles - for markdown tables in AI responses */
#my-chatbot-widget .sale-ai-message-bubble table {
  display: table !important;
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 10px 0 !important;
  font-size: 13px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  border-radius: 6px !important;
  overflow: hidden !important;
}

#my-chatbot-widget .sale-ai-message-bubble table th,
#my-chatbot-widget .sale-ai-message-bubble table td {
  display: table-cell !important;
  padding: 10px 12px !important;
  border: 1px solid #dfe2e5 !important;
  text-align: left !important;
  color: #24292e !important;
}

#my-chatbot-widget .sale-ai-message-bubble table th {
  background: linear-gradient(to bottom, #f8f9fa, #f1f3f5) !important;
  font-weight: 600 !important;
}

#my-chatbot-widget .sale-ai-message-bubble table td {
  background: #fff !important;
}

#my-chatbot-widget .sale-ai-message-bubble table tr {
  display: table-row !important;
}

/* Allow horizontal scrolling for wide tables */
#my-chatbot-widget .sale-ai-message-bubble {
  overflow-x: auto;
}

#my-chatbot-widget .sale-ai-user-message .sale-ai-message-timestamp {
  color: rgba(255, 255, 255, 0.8);
}

#my-chatbot-widget .sale-ai-ai-message .sale-ai-message-timestamp {
  color: #9ca3af;
}

/* Streaming message styling */
#my-chatbot-widget .sale-ai-ai-message.streaming {
  background: transparent;
  position: relative;
  animation: fadeIn 0.3s ease-in;
}

#my-chatbot-widget .sale-ai-typing-cursor {
  color: #666;
  font-weight: bold;
  margin-left: 2px;
  animation: blink 1s infinite;
}

#my-chatbot-widget .sale-ai-ai-message img {
  max-width: 100%;
  border-radius: 6px;
  margin: 8px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s ease;
  opacity: 0;
}

#my-chatbot-widget .sale-ai-ai-message img[src] {
  opacity: 1;
}

#my-chatbot-widget .sale-ai-ai-message h1,
#my-chatbot-widget .sale-ai-ai-message h2,
#my-chatbot-widget .sale-ai-ai-message h3 {
  margin: 10px 0 5px 0;
  color: #000;
  font-weight: bold;
}

#my-chatbot-widget .sale-ai-ai-message a {
  color: #2563eb;
  text-decoration: none;
}

#my-chatbot-widget .sale-ai-ai-message a:hover {
  text-decoration: underline;
}

/* Staff Avatar Styles */
#my-chatbot-widget .sale-ai-staff-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 4px;
  border: 2px solid #10b981;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
  display: inline-block;
}

#my-chatbot-widget .sale-ai-staff-avatar-fallback {
  display: inline;
  margin-right: 4px;
}


/* ============================================================================
 * QUICK ACTIONS (Sale AI Prefixed for WordPress/PHP compatibility)
 * ============================================================================ */
#my-chatbot-widget .sale-ai-quick-actions-container,
#my-chatbot-widget .sale-ai-quick-actions-container {
  padding: 12px 16px;
  background: transparent;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
  justify-content: center;
}

#my-chatbot-widget .sale-ai-quick-action-btn,
#my-chatbot-widget .sale-ai-quick-action-btn {
  background: rgba(255, 255, 255, 0.8);
  color: #4b5563;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  max-width: 300px;
  min-width: auto;
  width: auto;
  text-overflow: ellipsis;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#my-chatbot-widget .sale-ai-quick-action-btn:hover,
#my-chatbot-widget .sale-ai-quick-action-btn:hover {
  background: #fff;
  border-color: var(--widget-theme-color);
  color: var(--widget-theme-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#my-chatbot-widget .sale-ai-quick-action-btn.sale-ai-suggestion,
#my-chatbot-widget .sale-ai-quick-action-btn.sale-ai-suggestion {
  background: rgba(255, 255, 255, 0.9);
  color: #374151;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 500;
  padding: 6px 12px;
  font-size: 12px;
  max-width: 320px;
  min-width: auto;
  width: auto;
  flex-shrink: 0;
}

#my-chatbot-widget .sale-ai-quick-action-btn.sale-ai-suggestion:hover,
#my-chatbot-widget .sale-ai-quick-action-btn.sale-ai-suggestion:hover {
  background: #fff;
  border-color: var(--widget-theme-color);
  color: var(--widget-theme-color);
  transform: translateY(-1px);
}

/* ============================================================================
 * FORMS (Sale AI Prefixed for WordPress/PHP compatibility)
 * ============================================================================ */
#my-chatbot-widget .sale-ai-info-collection-form,
#my-chatbot-widget .sale-ai-message-form-container {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  margin: 8px 0;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

#my-chatbot-widget .sale-ai-message-form {
  display: flex;
  flex-direction: column;
}

#my-chatbot-widget .sale-ai-form-group {
  margin-bottom: 12px;
}

#my-chatbot-widget .sale-ai-message-form .sale-ai-form-group {
  margin-bottom: 0;
}

#my-chatbot-widget .sale-ai-form-group label,
#my-chatbot-widget .sale-ai-message-form .sale-ai-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

#my-chatbot-widget .sale-ai-form-group input,
#my-chatbot-widget .sale-ai-message-form .sale-ai-form-group input {
  width: fit-content;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

#my-chatbot-widget .sale-ai-form-group input:focus,
#my-chatbot-widget .sale-ai-message-form .sale-ai-form-group input:focus {
  outline: none;
  border-color: var(--widget-theme-color);
  background: #fff;
  box-shadow: 0 0 0 3px var(--widget-theme-color-15);
}

#my-chatbot-widget .sale-ai-form-actions,
#my-chatbot-widget .sale-ai-form-actions,
#my-chatbot-widget .sale-ai-message-form .sale-ai-form-actions,
#my-chatbot-widget .sale-ai-message-form .sale-ai-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

#my-chatbot-widget .sale-ai-submit-btn,
#my-chatbot-widget .sale-ai-submit-btn,
#my-chatbot-widget .sale-ai-message-form .sale-ai-submit-btn,
#my-chatbot-widget .sale-ai-message-form .sale-ai-submit-btn {
  background: var(--widget-theme-color);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px var(--widget-theme-color-30);
}

#my-chatbot-widget .sale-ai-submit-btn:hover,
#my-chatbot-widget .sale-ai-submit-btn:hover,
#my-chatbot-widget .sale-ai-message-form .sale-ai-submit-btn:hover,
#my-chatbot-widget .sale-ai-message-form .sale-ai-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px var(--widget-theme-color-40);
  filter: brightness(1.05);
}

#my-chatbot-widget .sale-ai-skip-btn,
#my-chatbot-widget .sale-ai-skip-btn,
#my-chatbot-widget .sale-ai-message-form .sale-ai-skip-btn,
#my-chatbot-widget .sale-ai-message-form .sale-ai-skip-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #4b5563;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#my-chatbot-widget .sale-ai-skip-btn:hover,
#my-chatbot-widget .sale-ai-skip-btn:hover,
#my-chatbot-widget .sale-ai-message-form .sale-ai-skip-btn:hover,
#my-chatbot-widget .sale-ai-message-form .sale-ai-skip-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #1f2937;
}

#my-chatbot-widget .sale-ai-cancel-btn,
#my-chatbot-widget .sale-ai-cancel-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #4b5563;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#my-chatbot-widget .sale-ai-cancel-btn:hover,
#my-chatbot-widget .sale-ai-cancel-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #1f2937;
}

/* ============================================================================
 * CHAT INPUT
 * ============================================================================ */
#my-chatbot-widget .sale-ai-chat-input-container {
  padding: 16px 20px;
  background: transparent;
  position: relative;

}

#my-chatbot-widget .sale-ai-chat-input-container::before {
  display: none;
}

#my-chatbot-widget .sale-ai-input-wrapper {
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  /* Center vertically for perfect balance */
  background: #fff;
  /* White bg for better contrast with shadow */
  border-radius: 26px;
  /* Slightly larger radius */
  box-shadow: 0 4px 12px #9ca3af33, 0 2px 4px #9ca3af33;
  /* Deep 3D Shadow */
  border: 1px solid rgba(0, 0, 0, 0.05);
  /* Subtle border definition */
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  padding: 8px 8px 8px 20px;
  /* Left padding larger for text, Right padding smaller for button */
  gap: 8px;
  /* Space between input and button */
}

/* Hover effect - disabled */
#my-chatbot-widget .sale-ai-input-wrapper:hover {
  background: #fff;
}

/* Focus state when typing */
#my-chatbot-widget .sale-ai-input-wrapper:focus-within {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

#my-chatbot-widget .sale-ai-input-wrapper:focus-within {
  border-color: var(--widget-theme-color);
  box-shadow: 0 0 0 3px var(--widget-theme-color-15);
  transform: translateY(-1px);
  animation: none;
}

#my-chatbot-widget .sale-ai-chat-input {
  display: block !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  order: 1 !important;
  max-height: 100px;
  overflow-y: auto;
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 14px;
  line-height: 1.5;
  color: #24292e;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 8px 6px;
  font-family: inherit;
}

#my-chatbot-widget .sale-ai-chat-input:empty {
  display: block !important;
  min-height: 20px !important;
  visibility: visible !important;
}

#my-chatbot-widget .sale-ai-chat-input:empty::before {
  content: attr(placeholder);
  color: #FFFFFF;
  pointer-events: none;
  display: block;
}

#my-chatbot-widget .sale-ai-chat-input * {
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-weight: normal !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: inherit !important;
  box-shadow: none !important;
}

#my-chatbot-widget .sale-ai-input-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  order: 2 !important;
  padding: 0;
  gap: 4px;
  margin-left: auto;
}

#my-chatbot-widget .sale-ai-image-upload-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0 !important;
  padding: 0;
  color: #9ca3af;
  transition: color 0.2s ease;
}

#my-chatbot-widget .sale-ai-image-upload-btn:hover {
  color: var(--widget-theme-color);
}

#my-chatbot-widget .sale-ai-send-btn {
  padding: 0;
  background: var(--widget-theme-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  /* Circle shape */
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 6px var(--widget-theme-color-30);
  position: relative;
  overflow: hidden;
  margin: 0;
  /* Align perfectly */
}

#my-chatbot-widget .sale-ai-send-btn::before {
  display: none;
}

#my-chatbot-widget .sale-ai-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px var(--widget-theme-color-40);
  filter: brightness(1.05);
}

#my-chatbot-widget .sale-ai-send-btn:active {
  transform: scale(0.95);
}

#my-chatbot-widget .sale-ai-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: #9ca3af;
}

#my-chatbot-widget .sale-ai-send-icon {
  width: 18px;
  height: 18px;
  transition: none;
}

#my-chatbot-widget .sale-ai-send-btn:hover .sale-ai-send-icon {
  transform: none;
}

/* ============================================================================
 * TYPING INDICATOR
 * ============================================================================ */
#my-chatbot-widget .sale-ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  background: #ffffff;
  border-radius: 12px;
  margin: 4px 0;
  font-size: 0;
  /* Hide potential text */
  max-width: fit-content;
  animation: fadeInUp 0.3s ease-out;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  /* Subtle shadow for floating effect */
  border: 1px solid rgba(0, 0, 0, 0.02);
}

#my-chatbot-widget .sale-ai-typing-dots {
  display: flex;
  gap: 3px;
  /* Wider gap */
  align-items: center;
}

#my-chatbot-widget .sale-ai-typing-dots span {
  width: 5px;
  /* Larger dots */
  height: 5px;
  border-radius: 50%;
  background: var(--widget-theme-color);
  /* Blue dots as per image */
  animation: typingDots 1.4s infinite ease-in-out both;
  opacity: 0.7;
}

#my-chatbot-widget .sale-ai-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

#my-chatbot-widget .sale-ai-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

/* ============================================================================
 * ORDER FORM
 * ============================================================================ */
#my-chatbot-widget .sale-ai-order-form-container {
  padding: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  backdrop-filter: blur(4px);
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-form-header {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #111827;
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-order-summary {
  font-size: 14px;
  margin-bottom: 16px;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-order-summary ul {
  list-style-type: none;
  padding-left: 0;
  margin: 8px 0;
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-order-summary li {
  margin-bottom: 4px;
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-form-group {
  margin-bottom: 12px;
}

#my-chatbot-widget .sale-ai-order-form-container label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

#my-chatbot-widget .sale-ai-order-form-container input,
#my-chatbot-widget .sale-ai-order-form-container textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

#my-chatbot-widget .sale-ai-order-form-container input:focus,
#my-chatbot-widget .sale-ai-order-form-container textarea:focus {
  outline: none;
  border-color: var(--widget-theme-color);
  background: #fff;
  box-shadow: 0 0 0 3px var(--widget-theme-color-15);
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-submit-btn {
  background: var(--widget-theme-color);
  color: #fff;
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-cancel-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #4b5563;
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-submit-btn,
#my-chatbot-widget .sale-ai-order-form-container .sale-ai-cancel-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-submit-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px var(--widget-theme-color-30);
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-cancel-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #1f2937;
}

#my-chatbot-widget .sale-ai-order-form-container .sale-ai-submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================================================
 * POWERED BY
 * ============================================================================ */
#my-chatbot-widget .sale-ai-powered-by {
  text-align: center;
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 500;
  color: #353434;
  background: transparent;
  border-radius: 24px;
}

/* Dark mode via class (JS controlled) - highest priority */
#my-chatbot-widget.sale-ai-dark-mode .sale-ai-powered-by {
  color: #646262 !important;

}

/* Light mode via class (JS controlled) - highest priority */
#my-chatbot-widget.sale-ai-light-mode .sale-ai-powered-by {
  color: #646262 !important;

}

/* Fallback: Dark mode via media query (lower priority than class) */
@media (prefers-color-scheme: dark) {
  #my-chatbot-widget:not(.sale-ai-light-mode) .sale-ai-powered-by {
    color: #353434;

  }
}

#my-chatbot-widget .sale-ai-powered-by a {
  color: var(--widget-theme-color);
  text-decoration: none;
  font-weight: 600;
}

#my-chatbot-widget .sale-ai-powered-by a:hover {
  text-decoration: underline;
}

/* ============================================================================
 * ANIMATIONS
 * ============================================================================ */
@keyframes bubblePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 0 var(--widget-theme-color-70);
  }

  70% {
    transform: scale(1.05);
    /* Phóng to nhẹ như nhịp tim */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 15px var(--widget-theme-color-00);
    /* Sóng lan rộng */
  }

  100% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 0 var(--widget-theme-color-00);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@keyframes helpTextPulse {

  0%,
  100% {
    transform: translateY(-50%) scale(1);
  }

  50% {
    transform: translateY(-50%) scale(1.05);
  }
}

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

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

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

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

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

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

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

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

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

@keyframes typingDots {

  0%,
  20% {
    opacity: 0.4;
    transform: scale(1);
  }

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

  100% {
    opacity: 0.4;
    transform: scale(1);
  }
}

@keyframes inputPulse {
  0% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  }

  50% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  }

  100% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  }
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

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

@keyframes focusRing {
  0% {
    box-shadow: 0 0 0 0 var(--widget-theme-color-40);
  }

  100% {
    box-shadow: 0 0 0 4px var(--widget-theme-color-15);
  }
}

/* ============================================================================
 * MOBILE RESPONSIVENESS
 * ============================================================================ */
@media screen and (max-width: 480px) {
  #my-chatbot-widget .sale-ai-chat-window {
    width: 85% !important;
    height: auto !important;
    max-height: 65vh !important;
    min-height: 300px !important;
    bottom: 80px !important;
    right: 0 !important;
    left: 0 !important;
    top: auto !important;
    border-radius: 20px !important;
    margin: 0 auto !important;
    display: none;
    /* Hide by default on mobile too */
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15) !important;
  }

  #my-chatbot-widget .sale-ai-chat-window.open {
    display: flex;
    /* Only show when open */
  }

  /* When maximized via JS, this class can be toggled if needed, or JS inline styles used */
  #my-chatbot-widget .sale-ai-chat-window.sale-ai-mobile-fullscreen {
    height: 100dvh !important;
    border-radius: 16px 16px 0 0 !important;
  }

  #my-chatbot-widget .sale-ai-chat-header {
    border-radius: 0 !important;
    padding-top: 12px;
    /* Standard padding */
    margin: 0;
  }

  #my-chatbot-widget .sale-ai-chat-window.sale-ai-mobile-fullscreen .sale-ai-chat-header {
    border-radius: 0 !important;
    padding-top: env(safe-area-inset-top, 16px);
    margin: 0;
  }

  #my-chatbot-widget .sale-ai-chat-input-container {
    padding-bottom: env(safe-area-inset-bottom, 16px);

  }

  /* Hide launcher button when open on mobile */
  #my-chatbot-widget .sale-ai-chat-window.open~.sale-ai-chat-bubble {
    display: none !important;
  }

  /* Disable resize button on mobile */
  #my-chatbot-widget .sale-ai-chat-resize-btn {
    display: none !important;
  }
}

/* ============================================================================
 * LANDSCAPE ORIENTATION (Phone rotated horizontally)
 * ============================================================================ */
@media screen and (max-width: 1000px) and (max-height: 700px) and (orientation: landscape) {
  #my-chatbot-widget .sale-ai-chat-window {
    width: 50% !important;
    height: auto !important;
    max-height: 85vh !important;
    min-height: 280px !important;
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
    border-radius: 16px !important;
    margin: 0 !important;
  }

  #my-chatbot-widget .sale-ai-chat-header {
    padding: 10px 14px !important;
  }

  #my-chatbot-widget .sale-ai-chat-messages {
    padding: 14px !important;
  }

  #my-chatbot-widget .sale-ai-chat-input-container {
    padding: 10px 14px !important;
  }

  /* Keep bubble visible in landscape */
  #my-chatbot-widget .sale-ai-chat-window.open~.sale-ai-chat-bubble {
    display: flex !important;
  }
}

/* ============================================================================
 * THINKING INDICATOR - Refactored v2.0
 * Accordion + Timeline + Custom SVG Icons
 * ============================================================================ */

/* --- Container (Accordion Card) --- */
#my-chatbot-widget .sale-ai-thinking-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin: 6px 0;
  overflow: hidden;
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

#my-chatbot-widget .sale-ai-thinking-container.expanded {
  background: #ffffff;
  border-color: var(--widget-theme-color-30, rgba(37, 99, 235, 0.3));
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* --- Header (Toggle Bar) --- */
#my-chatbot-widget .sale-ai-thinking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  background: transparent;
  transition: background 0.15s;
  user-select: none;
  border: none;
  gap: 8px;
}

#my-chatbot-widget .sale-ai-thinking-header:hover {
  background: #f1f5f9;
}

#my-chatbot-widget .sale-ai-thinking-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

/* Spinner */
#my-chatbot-widget .sale-ai-thinking-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: var(--widget-theme-color, #2563eb);
  border-radius: 50%;
  animation: thinkingSpin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes thinkingSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Status Text */
#my-chatbot-widget .sale-ai-thinking-status {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toggle Chevron */
#my-chatbot-widget .sale-ai-thinking-toggle-icon {
  width: 18px;
  height: 18px;
  color: #94a3b8;
  transition: transform 0.25s ease, color 0.25s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#my-chatbot-widget .sale-ai-thinking-container.expanded .sale-ai-thinking-toggle-icon {
  transform: rotate(180deg);
  color: var(--widget-theme-color, #2563eb);
}

/* --- Details (Collapsible Body) --- */
#my-chatbot-widget .sale-ai-thinking-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0 14px;
}

#my-chatbot-widget .sale-ai-thinking-container.expanded .sale-ai-thinking-details {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px 14px 14px;
  border-top: 1px solid #f1f5f9;
}

/* --- Timeline Steps --- */
#my-chatbot-widget .sale-ai-thinking-step-item {
  position: relative;
  padding: 6px 0 6px 32px;
  animation: thinkingStepIn 0.3s ease-out both;
}

/* Vertical line */
#my-chatbot-widget .sale-ai-thinking-step-item::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

#my-chatbot-widget .sale-ai-thinking-step-item:first-child::before {
  top: 12px;
}

#my-chatbot-widget .sale-ai-thinking-step-item:last-child::before {
  height: 12px;
}

/* Icon Circle */
#my-chatbot-widget .sale-ai-thinking-step-icon {
  position: absolute;
  left: 0;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: transform 0.2s, border-color 0.2s;
}

#my-chatbot-widget .sale-ai-thinking-step-icon svg {
  width: 10px;
  height: 10px;
}

#my-chatbot-widget .sale-ai-thinking-step-item:hover .sale-ai-thinking-step-icon {
  transform: scale(1.15);
}

/* Step Type Colors */
#my-chatbot-widget .sale-ai-thinking-step-item[data-step-type="plan"] .sale-ai-thinking-step-icon {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #3b82f6;
}

#my-chatbot-widget .sale-ai-thinking-step-item[data-step-type="plan"]::before {
  background: #bfdbfe;
}

#my-chatbot-widget .sale-ai-thinking-step-item[data-step-type="tool"] .sale-ai-thinking-step-icon,
#my-chatbot-widget .sale-ai-thinking-step-item[data-step-type="agents"] .sale-ai-thinking-step-icon {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #f59e0b;
}

#my-chatbot-widget .sale-ai-thinking-step-item[data-step-type="tool"]::before,
#my-chatbot-widget .sale-ai-thinking-step-item[data-step-type="agents"]::before {
  background: #fde68a;
}

#my-chatbot-widget .sale-ai-thinking-step-item[data-step-type="analysis"] .sale-ai-thinking-step-icon {
  border-color: #8b5cf6;
  background: #f5f3ff;
  color: #8b5cf6;
}

#my-chatbot-widget .sale-ai-thinking-step-item[data-step-type="analysis"]::before {
  background: #c4b5fd;
}

#my-chatbot-widget .sale-ai-thinking-step-item[data-step-type="result"] .sale-ai-thinking-step-icon {
  border-color: #10b981;
  background: #ecfdf5;
  color: #10b981;
}

#my-chatbot-widget .sale-ai-thinking-step-item[data-step-type="result"]::before {
  background: #6ee7b7;
}

/* Step Title */
#my-chatbot-widget .sale-ai-thinking-step-title {
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}

/* Step Content */
#my-chatbot-widget .sale-ai-thinking-step-content {
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
  margin-top: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Animation */
@keyframes thinkingStepIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

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