/* Lightning Leads AI Chatbot Widget */

#ll-chatbot-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fde047;
  border: none;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(253, 224, 71, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

#ll-chatbot-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(253, 224, 71, 0.5);
}

#ll-chatbot-bubble svg {
  width: 28px;
  height: 28px;
  fill: #0a0a0a;
}

#ll-chatbot-bubble .close-icon {
  display: none;
}

#ll-chatbot-bubble.open .chat-icon {
  display: none;
}

#ll-chatbot-bubble.open .close-icon {
  display: block;
}

/* Chat Panel */
#ll-chatbot-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: #111827;
  border: 1px solid rgba(253, 224, 71, 0.2);
  border-radius: 16px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#ll-chatbot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.ll-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 1px solid rgba(253, 224, 71, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ll-chat-header-icon {
  width: 36px;
  height: 36px;
  background: #fde047;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ll-chat-header-icon svg {
  width: 20px;
  height: 20px;
  fill: #0a0a0a;
}

.ll-chat-header-text h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  font-family: 'Inter', sans-serif;
}

.ll-chat-header-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #9ca3af;
  font-family: 'Inter', sans-serif;
}

/* Messages Area */
.ll-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #374151 transparent;
}

.ll-chat-messages::-webkit-scrollbar {
  width: 5px;
}

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

.ll-chat-messages::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 3px;
}

/* Message Bubbles */
.ll-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
  animation: ll-fade-in 0.25s ease;
}

.ll-msg-user {
  align-self: flex-end;
  background: #1f2937;
  color: #e5e7eb;
  border-bottom-right-radius: 4px;
}

.ll-msg-assistant {
  align-self: flex-start;
  background: #1a1a2e;
  color: #e5e7eb;
  border-left: 3px solid #fde047;
  border-bottom-left-radius: 4px;
}

.ll-msg-assistant a {
  color: #fde047;
  text-decoration: underline;
}

/* Typing Indicator */
.ll-typing {
  align-self: flex-start;
  padding: 12px 18px;
  background: #1a1a2e;
  border-left: 3px solid #fde047;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 5px;
  animation: ll-fade-in 0.25s ease;
}

.ll-typing-dot {
  width: 7px;
  height: 7px;
  background: #6b7280;
  border-radius: 50%;
  animation: ll-bounce 1.4s infinite ease-in-out;
}

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

/* Input Area */
.ll-chat-input {
  padding: 12px 16px;
  border-top: 1px solid rgba(253, 224, 71, 0.1);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
  background: #0d1117;
}

.ll-chat-input textarea {
  flex: 1;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 10px 14px;
  color: #e5e7eb;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  resize: none;
  max-height: 80px;
  min-height: 40px;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.2s;
}

.ll-chat-input textarea:focus {
  border-color: #fde047;
}

.ll-chat-input textarea::placeholder {
  color: #6b7280;
}

.ll-chat-input button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fde047;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
}

.ll-chat-input button:hover {
  background: #fcd34d;
}

.ll-chat-input button:active {
  transform: scale(0.95);
}

.ll-chat-input button:disabled {
  background: #374151;
  cursor: not-allowed;
}

.ll-chat-input button svg {
  width: 18px;
  height: 18px;
  fill: #0a0a0a;
}

/* Animations */
@keyframes ll-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Mobile Responsive */
@media (max-width: 640px) {
  #ll-chatbot-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 140px);
    right: 8px;
    bottom: 92px;
    border-radius: 12px;
  }

  #ll-chatbot-bubble {
    bottom: 16px;
    right: 16px;
  }
}

/* Unread badge */
.ll-unread-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #0a0a0a;
  display: none;
}

#ll-chatbot-bubble.has-unread .ll-unread-badge {
  display: block;
}
