/* LeadLoop Chatbot Widget */
:root {
  --ll-accent: #a8ff00;
  --ll-accent-dim: rgba(168, 255, 0, 0.12);
  --ll-bg: #1a2b3d;
  --ll-bg-deep: #0f1923;
  --ll-border: rgba(240, 244, 248, 0.06);
  --ll-text: #f0f4f8;
  --ll-text-muted: #8899aa;
}

/* Toggle button */
#ll-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--ll-accent);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(168, 255, 0, 0.3);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
#ll-toggle:hover { transform: scale(1.1); box-shadow: 0 6px 32px rgba(168, 255, 0, 0.5); }
#ll-toggle svg { width: 28px; height: 28px; fill: var(--ll-bg-deep); }
#ll-toggle.open { background: var(--ll-bg-deep); border: 2px solid var(--ll-accent); }
#ll-toggle.open svg { fill: var(--ll-accent); }

/* Chat window */
#ll-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: var(--ll-bg);
  border: 1px solid var(--ll-border);
  border-radius: 16px;
  display: none;
  flex-direction: column;
  z-index: 9998;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  overflow: hidden;
}
#ll-window.open { display: flex; }

/* Header */
#ll-header {
  background: var(--ll-bg-deep);
  padding: 16px 20px;
  border-bottom: 1px solid var(--ll-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
#ll-header-info { flex: 1; }
#ll-header-name { font-weight: 600; font-size: 15px; color: var(--ll-text); font-family: 'DM Sans', sans-serif; }
#ll-header-status { font-size: 12px; color: var(--ll-accent); display: flex; align-items: center; gap: 5px; }
#ll-header-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ll-accent); display: inline-block; }
#ll-close { background: none; border: none; cursor: pointer; color: var(--ll-text-muted); font-size: 20px; padding: 4px; line-height: 1; }
#ll-close:hover { color: var(--ll-text); }

/* Messages area */
#ll-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#ll-messages::-webkit-scrollbar { width: 4px; }
#ll-messages::-webkit-scrollbar-track { background: transparent; }
#ll-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.ll-msg { font-size: 14px; line-height: 1.5; padding: 10px 14px; border-radius: 12px; font-family: 'DM Sans', sans-serif; }
.ll-msg.bot { background: var(--ll-bg-deep); color: var(--ll-text); align-self: flex-start; border-bottom-left-radius: 4px; max-width: 85%; }
.ll-msg.user { background: var(--ll-accent); color: var(--ll-bg-deep); align-self: flex-end; border-bottom-right-radius: 4px; max-width: 85%; }
.ll-msg-time { font-size: 11px; color: var(--ll-text-muted); margin-top: 4px; display: block; }
.ll-msg.user .ll-msg-time { text-align: right; }

/* Typing indicator */
#ll-typing { display: none; align-items: center; gap: 4px; padding: 10px 14px; background: var(--ll-bg-deep); border-radius: 12px; border-bottom-left-radius: 4px; align-self: flex-start; }
#ll-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ll-text-muted); animation: ll-bounce 1.2s infinite; }
#ll-typing span:nth-child(2) { animation-delay: 0.2s; }
#ll-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ll-bounce { 0%,80%,100%{transform:scale(0.6);opacity:0.4} 40%{transform:scale(1);opacity:1} }

/* Lead capture form */
#ll-lead-form { padding: 16px 20px; border-top: 1px solid var(--ll-border); display: none; }
#ll-lead-form h4 { font-size: 14px; font-weight: 600; color: var(--ll-text); margin-bottom: 12px; font-family: 'DM Sans', sans-serif; }
.ll-field { width: 100%; padding: 10px 12px; border: 1px solid var(--ll-border); border-radius: 8px; background: var(--ll-bg-deep); color: var(--ll-text); font-size: 14px; font-family: 'DM Sans', sans-serif; margin-bottom: 8px; box-sizing: border-box; }
.ll-field::placeholder { color: var(--ll-text-muted); }
.ll-field:focus { outline: none; border-color: var(--ll-accent); }
#ll-submit-lead { width: 100%; padding: 11px; background: var(--ll-accent); color: var(--ll-bg-deep); border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: opacity 0.2s; }
#ll-submit-lead:hover { opacity: 0.85; }
#ll-lead-success { display: none; text-align: center; padding: 20px; color: var(--ll-accent); font-size: 14px; }

/* Input area */
#ll-input-area { padding: 12px 16px; border-top: 1px solid var(--ll-border); display: flex; gap: 8px; }
#ll-input { flex: 1; padding: 10px 14px; border: 1px solid var(--ll-border); border-radius: 24px; background: var(--ll-bg-deep); color: var(--ll-text); font-size: 14px; font-family: 'DM Sans', sans-serif; }
#ll-input::placeholder { color: var(--ll-text-muted); }
#ll-input:focus { outline: none; border-color: rgba(168,255,0,0.4); }
#ll-send { width: 40px; height: 40px; border-radius: 50%; background: var(--ll-accent); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
#ll-send svg { width: 16px; height: 16px; fill: var(--ll-bg-deep); }
#ll-send:disabled { opacity: 0.5; cursor: not-allowed; }