/* ── AI Meet-Setup Assistant Chat Widget ───────────────────── */

/* Floating action button */
.aiChatFab{
  position:fixed;
  bottom:24px;
  right:24px;
  z-index:100;
  width:56px;
  height:56px;
  border-radius:50%;
  background:var(--accent, #7c3aed);
  color:#fff;
  border:none;
  cursor:pointer;
  box-shadow:0 4px 16px rgba(124,58,237,.35);
  display:flex;
  align-items:center;
  justify-content:center;
  transition:transform .15s, box-shadow .15s;
}
.aiChatFab:hover{transform:scale(1.08);box-shadow:0 6px 24px rgba(124,58,237,.45);}
.aiChatFab:active{transform:scale(0.96);}
.aiChatFab svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}

/* Chat panel */
.aiChatPanel{
  position:fixed;
  bottom:92px;
  right:24px;
  z-index:101;
  width:min(420px, calc(100vw - 32px));
  max-height:min(600px, calc(100vh - 120px));
  background:var(--card, #fff);
  border:1px solid var(--bd, #e2e8f0);
  border-radius:16px;
  box-shadow:0 8px 40px rgba(0,0,0,.18);
  display:none;
  flex-direction:column;
  overflow:hidden;
}
body.aiChatOpen .aiChatPanel{display:flex;}
body.aiChatOpen .aiChatFab .aiIconChat{display:none;}
body.aiChatOpen .aiChatFab .aiIconClose{display:block;}
.aiChatFab .aiIconClose{display:none;}

/* Header */
.aiChatHd{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--bd, #e2e8f0);
  gap:10px;
}
.aiChatHdLeft{display:flex;align-items:center;gap:10px;min-width:0;}
.aiChatAvatar{
  width:34px;height:34px;border-radius:50%;
  background:var(--accent, #7c3aed);
  color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-weight:900;font-size:15px;
  flex-shrink:0;
}
.aiChatTitle{font-weight:900;font-size:15px;color:var(--text, #1e293b);}
.aiChatSub{font-size:11px;color:var(--muted, #94a3b8);font-weight:600;}
.aiChatClear{
  background:none;
  border:1px solid var(--bd, #e2e8f0);
  border-radius:8px;
  padding:5px 10px;
  font-size:11px;
  font-weight:800;
  color:var(--muted, #94a3b8);
  cursor:pointer;
  white-space:nowrap;
}
.aiChatClear:hover{color:var(--text);border-color:var(--text);}

/* Messages area */
.aiChatMessages{
  flex:1;
  overflow-y:auto;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-height:200px;
}
.aiMsg{
  max-width:88%;
  padding:10px 14px;
  border-radius:14px;
  font-size:13.5px;
  line-height:1.55;
  word-break:break-word;
}
.aiMsgUser{
  align-self:flex-end;
  background:var(--accent, #7c3aed);
  color:#fff;
  border-bottom-right-radius:4px;
}
.aiMsgAssistant{
  align-self:flex-start;
  background:var(--bg, #f1f5f9);
  color:var(--text, #1e293b);
  border-bottom-left-radius:4px;
}
.aiMsgWelcome{
  text-align:center;
  max-width:100%;
  background:none;
  color:var(--muted, #94a3b8);
  font-size:13px;
  padding:24px 16px;
  line-height:1.6;
}
.aiMsgWelcome strong{color:var(--text);display:block;font-size:15px;margin-bottom:6px;}

/* Typing indicator */
.aiTyping{
  align-self:flex-start;
  display:flex;
  align-items:center;
  gap:5px;
  padding:10px 18px;
  background:var(--bg, #f1f5f9);
  border-radius:14px;
  border-bottom-left-radius:4px;
}
.aiTyping span{
  width:7px;height:7px;border-radius:50%;
  background:var(--muted, #94a3b8);
  animation:aiDotBounce .6s ease-in-out infinite;
}
.aiTyping span:nth-child(2){animation-delay:.15s;}
.aiTyping span:nth-child(3){animation-delay:.3s;}
@keyframes aiDotBounce{
  0%,80%,100%{opacity:.3;transform:scale(.8);}
  40%{opacity:1;transform:scale(1);}
}

/* Input area */
.aiChatInput{
  display:flex;
  align-items:center;
  gap:8px;
  padding:12px 14px;
  border-top:1px solid var(--bd, #e2e8f0);
}
.aiChatInput textarea{
  flex:1;
  resize:none;
  border:1px solid var(--bd, #e2e8f0);
  border-radius:10px;
  padding:9px 12px;
  font-size:13.5px;
  font-family:inherit;
  line-height:1.4;
  max-height:88px;
  background:var(--bg, #f1f5f9);
  color:var(--text, #1e293b);
  outline:none;
}
.aiChatInput textarea:focus{border-color:var(--accent, #7c3aed);}
.aiChatInput textarea::placeholder{color:var(--muted, #94a3b8);}
.aiChatSend{
  width:36px;height:36px;
  border-radius:50%;
  background:var(--accent, #7c3aed);
  color:#fff;
  border:none;
  cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
  transition:opacity .15s;
}
.aiChatSend:disabled{opacity:.4;cursor:default;}
.aiChatSend svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;}

/* Upgrade prompt (shown to free users) */
.aiUpgradePrompt{
  padding:32px 24px;
  text-align:center;
  color:var(--muted);
}
.aiUpgradePrompt strong{display:block;font-size:16px;color:var(--text);margin-bottom:8px;}
.aiUpgradePrompt p{font-size:13px;line-height:1.6;margin:0 0 16px;}
.aiUpgradePrompt a{
  display:inline-block;
  padding:10px 20px;
  background:var(--accent);
  color:#fff;
  border-radius:10px;
  text-decoration:none;
  font-weight:800;
  font-size:13px;
}
.aiUpgradePrompt a:hover{opacity:.9;}

/* Mobile adjustments */
@media (max-width: 480px){
  .aiChatFab{bottom:16px;right:16px;width:50px;height:50px;}
  .aiChatFab svg{width:24px;height:24px;}
  .aiChatPanel{
    bottom:76px;
    right:8px;
    width:calc(100vw - 16px);
    max-height:calc(100vh - 96px);
  }
}
