/* ===== CHATBOT VARIABLES ===== */
#sol-chatbot {
  --chat-primary: #da377e;
  --chat-secondary: #ffa751;
  --chat-dark: #2a251d;
  --chat-light: #fbf3ea;
  --chat-bg: #fff4fa;
  --chat-white: #ffffff;
  --chat-gradient: linear-gradient(135deg, #da377e, #ffa751);
  --chat-font: 'Inter', sans-serif;
  --chat-radius: 20px;
  --chat-shadow: 0 10px 40px rgba(218, 55, 126, 0.2);
}

/* ===== ANIMATIONS ===== */
@keyframes sol-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes sol-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

@keyframes sol-messageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sol-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sol-slideUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sol-badgePop {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ===== TOGGLE BUTTON ===== */
#sol-chatbot .chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--chat-gradient);
  border: none;
  cursor: pointer;
  z-index: 10001;
  box-shadow: var(--chat-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  padding: 0;
  animation: sol-pulse 3s ease-in-out infinite;
}

#sol-chatbot .chat-toggle:hover {
  transform: scale(1.1);
  animation: none;
}

#sol-chatbot .chat-toggle svg {
  width: 28px;
  height: 28px;
  fill: white;
  transition: transform 0.3s ease;
}

#sol-chatbot .chat-toggle .notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  background: var(--chat-secondary);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sol-badgePop 0.3s ease;
  font-family: var(--chat-font);
}

/* ===== CHAT WINDOW ===== */
#sol-chatbot .chat-window {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 380px;
  height: 520px;
  background: var(--chat-bg);
  border-radius: var(--chat-radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
  animation: sol-fadeIn 0.3s ease;
  font-family: var(--chat-font);
}

#sol-chatbot .chat-window.active {
  display: flex;
}

/* ===== HEADER ===== */
#sol-chatbot .chat-header {
  background: var(--chat-gradient);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  flex-shrink: 0;
}

#sol-chatbot .chat-header .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

#sol-chatbot .chat-header .avatar img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

#sol-chatbot .chat-header .header-info {
  flex: 1;
  min-width: 0;
}

#sol-chatbot .chat-header .header-info h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
  line-height: 1.3;
}

#sol-chatbot .chat-header .status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  opacity: 0.9;
  margin-top: 2px;
}

#sol-chatbot .chat-header .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}

#sol-chatbot .chat-header .close-chat {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  opacity: 0.8;
  transition: opacity 0.2s;
}

#sol-chatbot .chat-header .close-chat:hover {
  opacity: 1;
}

/* ===== MESSAGES AREA ===== */
#sol-chatbot .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

#sol-chatbot .chat-messages::-webkit-scrollbar {
  width: 4px;
}

#sol-chatbot .chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#sol-chatbot .chat-messages::-webkit-scrollbar-thumb {
  background: rgba(218, 55, 126, 0.3);
  border-radius: 2px;
}

/* ===== MESSAGE BUBBLES ===== */
#sol-chatbot .message {
  display: flex;
  gap: 8px;
  animation: sol-messageIn 0.3s ease;
  max-width: 85%;
}

#sol-chatbot .message.bot {
  align-self: flex-start;
}

#sol-chatbot .message.user {
  align-self: flex-end;
}

#sol-chatbot .message .bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#sol-chatbot .message.bot .bubble {
  background: var(--chat-dark);
  color: var(--chat-light);
  border-bottom-left-radius: 4px;
}

#sol-chatbot .message.user .bubble {
  background: var(--chat-gradient);
  color: white;
  border-bottom-right-radius: 4px;
}

#sol-chatbot .message .bubble a {
  color: var(--chat-secondary);
  text-decoration: underline;
}

#sol-chatbot .message .bubble strong {
  font-weight: 700;
}

#sol-chatbot .message .bubble ul {
  margin: 6px 0;
  padding-left: 18px;
}

#sol-chatbot .message .bubble li {
  margin-bottom: 4px;
}

/* ===== TYPING INDICATOR ===== */
#sol-chatbot .typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--chat-dark);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  animation: sol-messageIn 0.3s ease;
}

#sol-chatbot .typing-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  animation: sol-typing 1.4s infinite ease-in-out;
}

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

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

/* ===== QUICK ACTIONS ===== */
#sol-chatbot .quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 4px;
  flex-shrink: 0;
}

#sol-chatbot .quick-actions button {
  background: transparent;
  border: 1.5px solid var(--chat-primary);
  color: var(--chat-primary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--chat-font);
  white-space: nowrap;
}

#sol-chatbot .quick-actions button:hover {
  background: var(--chat-primary);
  color: white;
}

/* ===== LEAD OPTIONS (inline in messages) ===== */
#sol-chatbot .lead-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

#sol-chatbot .lead-options button {
  background: transparent;
  border: 1.5px solid var(--chat-light);
  color: var(--chat-light);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--chat-font);
}

#sol-chatbot .lead-options button:hover {
  background: var(--chat-light);
  color: var(--chat-dark);
}

/* ===== INPUT AREA ===== */
#sol-chatbot .chat-input-area {
  display: flex;
  padding: 12px 16px;
  gap: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--chat-white);
  flex-shrink: 0;
  align-items: center;
}

#sol-chatbot .chat-input-area input {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: var(--chat-font);
  outline: none;
  transition: border-color 0.2s;
  background: var(--chat-white);
  color: var(--chat-dark);
  min-width: 0;
}

#sol-chatbot .chat-input-area input:focus {
  border-color: var(--chat-primary);
}

#sol-chatbot .chat-input-area input::placeholder {
  color: #999;
}

#sol-chatbot .chat-input-area .send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--chat-gradient);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
  padding: 0;
}

#sol-chatbot .chat-input-area .send-btn:hover {
  transform: scale(1.1);
}

#sol-chatbot .chat-input-area .send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#sol-chatbot .chat-input-area .send-btn svg {
  width: 18px;
  height: 18px;
  fill: white;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  #sol-chatbot .chat-window {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    border-radius: 0;
    animation: sol-slideUp 0.3s ease;
  }

  #sol-chatbot .chat-toggle {
    bottom: 16px;
    right: 16px;
  }
}
