/* Chatbot toggle bubble */
.chat-toggle{position:fixed;bottom:20px;right:20px;width:60px;height:60px;background:#2e7d32;border-radius:50%;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:10000;box-shadow:0 4px 16px rgba(0,0,0,.3);transition:transform .2s}
.chat-toggle:hover{transform:scale(1.08)}
.chat-toggle svg{width:28px;height:28px;fill:#fff}
.chat-toggle .chat-badge{position:absolute;top:-2px;right:-2px;width:18px;height:18px;background:#ff5252;border-radius:50%;display:none;align-items:center;justify-content:center;font-size:11px;color:#fff;font-weight:700}

/* Chatbot panel */
#ai-chatbot{position:fixed;bottom:90px;right:20px;width:340px;max-height:480px;background:#fff;border-radius:14px;box-shadow:0 8px 32px rgba(0,0,0,.18);display:none;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;z-index:10000;overflow:hidden}
#ai-chatbot.open{display:flex}

/* Header */
#chat-header{background:#2e7d32;color:#fff;padding:14px 16px;font-weight:700;font-size:15px;display:flex;align-items:center;justify-content:space-between}
#chat-header button{background:none;border:none;color:#fff;font-size:20px;cursor:pointer;padding:0 4px;line-height:1}

/* Messages area */
#chat-messages{flex:1;overflow-y:auto;padding:14px;min-height:200px;max-height:320px;display:flex;flex-direction:column;gap:8px}
#chat-messages::-webkit-scrollbar{width:4px}
#chat-messages::-webkit-scrollbar-thumb{background:#ccc;border-radius:4px}

/* Message bubbles */
.chat-msg{max-width:85%;padding:10px 14px;border-radius:14px;font-size:14px;line-height:1.45;word-wrap:break-word}
.chat-msg.user{align-self:flex-end;background:#e8f5e9;color:#1b5e20;border-bottom-right-radius:4px}
.chat-msg.ai{align-self:flex-start;background:#f5f5f5;color:#333;border-bottom-left-radius:4px}
.chat-msg.ai a{color:#2e7d32;text-decoration:underline}

/* Typing indicator */
.chat-typing{align-self:flex-start;padding:10px 14px;background:#f5f5f5;border-radius:14px;font-size:14px;color:#999}
.chat-typing span{animation:blink 1.4s infinite both}
.chat-typing span:nth-child(2){animation-delay:.2s}
.chat-typing span:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:.3}40%{opacity:1}}

/* Input area */
#chat-input-wrap{display:flex;border-top:1px solid #e0e0e0;padding:8px}
#chat-input{flex:1;border:none;padding:10px 12px;outline:none;font-size:14px;font-family:inherit;background:transparent}
#chat-send{background:#2e7d32;border:none;color:#fff;width:38px;height:38px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0}
#chat-send:disabled{opacity:.5;cursor:default}
#chat-send svg{width:18px;height:18px;fill:#fff}

/* Lead capture form inside chat */
.chat-lead-form{padding:12px;background:#f9f9f9;border-top:1px solid #e0e0e0}
.chat-lead-form input{width:100%;padding:8px 10px;margin-bottom:8px;border:1px solid #ddd;border-radius:6px;font-size:13px;font-family:inherit;box-sizing:border-box}
.chat-lead-form button{width:100%;padding:10px;background:#2e7d32;color:#fff;border:none;border-radius:6px;font-weight:700;cursor:pointer;font-size:14px}

/* Mobile responsive */
@media(max-width:480px){
  #ai-chatbot{right:0;left:0;bottom:0;width:100%;max-height:100vh;border-radius:14px 14px 0 0}
  .chat-toggle{bottom:80px}
}
