/* ============================================================
   Xicom Tech Chatbot  —  style.css
   ============================================================ */

:root {
  --primary:       #7c3aed;
  --primary-dark:  #4f46e5;
  --primary-glow:  rgba(124, 58, 237, 0.35);
  --navy:          #0a0a1a;
  --navy-mid:      #1a1040;
  --navy-card:     #1e1b4b;
  --navy-card2:    #312e81;
  --accent:        #a78bfa;
  --accent-dim:    rgba(139, 92, 246, 0.25);
  --text-main:     #e0e7ff;
  --text-dim:      #94a3b8;
  --bg-glass:      white;
  --border-glass:   rgb(247 247 247);
  --shadow:        0 20px 60px rgba(2, 53, 117, 0.7);
  --radius:        20px;
  --font:          'Lato', sans-serif;
  --font-head:     'Outfit', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Launcher ── */
.launcher {
  position: fixed; bottom: 28px; right: 28px;
  width: 64px; height: 64px;
  border-radius: 50%; cursor: pointer;
  overflow: visible;
  /*box-shadow: 0 8px 30px var(--primary-glow);*/
  transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
  padding: 0;
  background: transparent;
}
/* Pulse ring */
/*.launcher::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid #0099da;
  animation: launcherPulse 2.2s ease-out infinite;
  pointer-events: none;
}*/
@keyframes launcherPulse {
  0%   { opacity: .7; transform: scale(1); }
  70%  { opacity: 0; transform: scale(1.45); }
  100% { opacity: 0; transform: scale(1.45); }
}
/* Tooltip */
.launcher::after {
  display: none !important;
  content: 'Chat with us! 💬';
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  background: rgba(15, 10, 30, 0.95);
  color: #e0e7ff;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  /*box-shadow: 0 4px 16px rgba(0,0,0,.4);*/
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.launcher:hover::after {
  opacity: 1;
  transform: translateY(0);
}
.launcher:hover { transform: scale(1.1); }
.launcher-icon { width: 64px; height: 64px; border-radius: 4px; object-fit: cover; display: block; overflow: hidden; }
.launcher-badge {
  position: absolute; top: -3px; right: -3px;
  background: linear-gradient(transparent,transparent) padding-box,
    linear-gradient(90deg, #e23941, #d92e7a) border-box !important; color: white;
  font-size: .7rem; font-weight: 700;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── Chat Widget ── */
.chat-widget {
  position: fixed; bottom: 25px; right: 28px;
  width: 420px; height: 640px;
  background: var(--bg-glass);
  backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border: 1px solid #e5e5e5;
  border-radius: var(--radius);
  /*box-shadow: var(--shadow);*/
  display: flex; flex-direction: column;
  overflow: hidden; z-index: 999;
  animation: slideUp .4s cubic-bezier(0.23, 1, 0.32, 1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.hidden { display: none !important; }

/* Header */
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  /*background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(79,70,229,.2));*/
  background: #023575 !important ;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.bot-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.header-name  { font-weight: 700; font-size: .97rem; color: #fff; font-family: "poppins"}
.header-status { display: flex; align-items: center; gap: 5px; font-size: .75rem; color: #fff; }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #22c55e;
  /*box-shadow: 0 0 6px #22c55e; */
   animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; } 50% { opacity: .5; }
}
.header-right { display: flex; gap: 6px; }
.icon-btn {
  background: transparent; border: none; color: var(--text-dim);
  cursor: pointer; padding: 6px; border-radius: 8px;
  transition: all .2s; display: flex;
}
.icon-btn:hover { color: var(--text-main); background: var(--accent-dim); }

/* Messages */
.messages {
  flex: 1; overflow-y: auto; padding: 18px 16px 10px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: lightgrey; border-radius: 4px; }

/* ── Message enter animation ── */
@keyframes msgEnter {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.msg-enter {
  animation: msgEnter .28s cubic-bezier(0.23, 1, 0.32, 1) both;
}

/* Bubbles */
.msg-row { display: flex; align-items: flex-end; gap: 8px; }
.msg-row.bot { justify-content: flex-start; }
.msg-row.user { justify-content: flex-end; }

/* Bubble column wrapper (bubble + timestamp) */
.bubble-col {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  gap: 3px;
}
.msg-row.bot  .bubble-col { align-items: flex-start; }
.msg-row.user .bubble-col { align-items: flex-end; }

/* Sender name label above bot bubble */
.sender-name {
  font-size: .72rem;
  font-weight: 600;
  color: #999;
  padding: 0 4px 2px;
  letter-spacing: .01em;
  opacity: .9;
  display: none;
}

.msg-time {
  font-size: .68rem;
  color: var(--text-dim);
  opacity: .7;
  padding: 0 4px;
  margin-bottom: 2px;
}

.bubble {
  padding: 11px 15px;
  line-height: 1.5; font-size: 15px; word-break: break-word;
}
.bubble.bot {
  /*background: linear-gradient(135deg, var(--navy-card), var(--navy-card2));*/
  background: #f3f3f3;
  color: #758495;
  /*border: 1px solid var(--border-glass);*/
  border-radius: 4px 16px 16px 16px;
  /*box-shadow: 0 4px 16px rgba(0,153,218,.15);*/
}
.bubble.user {
  background: #0099da;
  color: #fff;
  border-radius: 16px 4px 16px 16px;
  /*box-shadow: 0 4px 14px rgba(0,153,218,.3);*/
}

.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px; align-self: flex-end;
}
.bot-avatar-icon {
  background: transparent;
  overflow: hidden;
  padding: 0;
}
.user-avatar-icon {
  background:#0099da;
  border: 2px solid rgba(167,139,250,.35);
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
}

/* Choice buttons */
.choices {
  display: flex; flex-direction: column; gap: 8px;
  padding: 2px 0;
  /*margin-left: auto;*/
}
.choice-btn {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: #0099da;
   padding: 10px 16px;
  border-radius: 12px; cursor: pointer;
  font-family: 'Lato', sans-serif; font-size: 15px; font-weight: 600;
  text-align: center; transition: all .2s;

}
.choice-btn:hover {
  background: transparent !important;
  color:  #023575 !important;
  transform: translateX(3px);
}

/* Inline form (name / email / textarea) */
.inline-form {
  display: flex; flex-direction: column; gap: 8px; margin-top: 4px;
}
.inline-form input,
.inline-form textarea {
  background: #fff; border: 1px solid lightgrey;
  color: #374151; padding: 10px 14px; border-radius: 10px;
  font-family: var(--font); font-size: .88rem;
  outline: none; transition: border-color .2s; resize: none;
}
.inline-form input::placeholder,
.inline-form textarea::placeholder { color: var(--text-dim); }
.inline-form input:focus,
.inline-form textarea:focus { border-color:  lightgrey; }
.inline-form button {
  background: #023575 !important;
  color: white; border: none; padding: 10px 18px; border-radius: 10px;
  font-family: var(--font); font-size: 16px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.inline-form button:hover { transform: translateY(-1px);
/*  box-shadow: 0 4px 16px var(--primary-glow);  */ 
}

.inline-form .err { color: #f87171; font-size: .8rem; margin-top: -4px; 
min-height: 1.1rem; line-height: 1.4;}

/* Summary card */
.summary-card {
  background: #f3f3f3;
  /*background: linear-gradient(135deg, #0f172a, var(--navy-card));*/
  border: 1px solid var(--border-glass); border-radius: 14px;
  padding: 16px 18px; margin: 4px 0;
  line-height: 1.85; font-size: .84rem; color: #758495;
}
.summary-card h4 {
  color: #758495; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 10px;
}

/* Calendly / action link */
.action-link {
  display: block;
  /*background: linear-gradient(135deg, var(--primary), var(--primary-dark));*/
  background: #0099da;
  color: white !important; text-decoration: none;
  padding: 12px 20px; border-radius: 12px;
  font-weight: 700; font-size: .9rem; text-align: center;
  margin: 6px 0;
 /*  box-shadow: 0 6px 20px var(--primary-glow);*/
  transition: all .2s;
}
.action-link:hover { transform: translateY(-1px); text-decoration:none; }

/* Persistent new-conv bar */
.new-conv-bar {
  border-top: 1px solid var(--border-glass);
  padding: 8px 14px;
  flex-shrink: 0;
  background: #eee;
}
.new-conv-bar button {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: #0099da; padding: 8px 16px; border-radius: 10px;
  font-family: var(--font); font-size: .82rem; font-weight: 600;
  cursor: pointer; width: 100%;
  transition: all .2s;
}
.new-conv-bar button:hover { background: #fff; }

/* Inline new-conversation btn (end of flow) */
.new-conv-btn {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: #023575; padding: 10px 18px; border-radius: 10px;
  font-family: var(--font); font-size: .85rem; font-weight: 600;
  cursor: pointer; width: 100%; margin-top: 6px;
  transition: all .2s;
}
/*.new-conv-btn:hover { background: var(--accent-dim); }*/

/* Typing indicator */
.typing-wrap { display: flex; align-items: flex-end; gap: 8px; }
.typing {
  background: #f3f3f3;
  border: 1px solid var(--border-glass);
  border-radius: 4px 16px 16px 16px;
  padding: 12px 16px; display: flex; gap: 5px; align-items: center;
}
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #758495; display: block;
  animation: bounce .9s infinite;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%,60%,100% { transform: translateY(0); }
  30% { transform: translateY(-7px); }
}

/* Footer input */
.chat-footer {
  border-top: 1px solid rgb(212 212 212);
  padding: 12px 14px; flex-shrink: 0;
  background: #fff;
}
#chat-form { display: flex; gap: 8px; align-items: center; }
#user-input {
  flex: 1; background: #fff;
  border: 1px solid lightgrey; outline: none;
  color: #374151; padding: 11px 18px; border-radius: 10px;
  font-family: var(--font);
   font-size: .88rem;
    transition: border-color .2s,  box-shadow .2s;
}
#user-input::placeholder { color: var(--text-dim); }
#user-input:focus {
  border-color: lightgrey !important;
  /*box-shadow: 0 0 0 3px rgba(0,153,218,.15);*/

}
.send-btn {
  background: #0099da !important;
  border: none; width: 42px; height: 42px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s;
  /*box-shadow: 0 3px 12px var(--primary-glow);*/
}
.send-btn:hover { transform: scale(1.1);
/* box-shadow: 0 6px 20px var(--primary-glow); */
 }

/* ── Markdown content inside bot bubble ── */
.bubble.bot p   { margin: 0 0 .55em; }
.bubble.bot p:last-child { margin-bottom: 0; }
.bubble.bot ul,
.bubble.bot ol  { padding-left: 1.3em; margin: .35em 0 .55em; }
.bubble.bot li  { margin-bottom: .25em; }
.bubble.bot strong { color: #758495; font-weight: 700; }
.bubble.bot em  { color: #c4b5fd; }
.bubble.bot h1,
.bubble.bot h2,
.bubble.bot h3  {
  font-family: var(--font-head); color: #fff;
  margin: .6em 0 .3em; line-height: 1.25;
}
.bubble.bot h1 { font-size: 1rem; }
.bubble.bot h2 { font-size: .95rem; }
.bubble.bot h3 { font-size: .9rem; }
.bubble.bot code {
  background: rgba(167,139,250,.2); color: var(--accent);
  padding: 1px 5px; border-radius: 4px; font-size: .85em;
}
.bubble.bot pre {
  background: rgba(0,0,0,.35); border: 1px solid var(--border-glass);
  border-radius: 8px; padding: 10px 12px; overflow-x: auto;
  margin: .5em 0;
}
.bubble.bot pre code {
  background: none; color: var(--text-main); padding: 0;
}
.bubble.bot a {
  color: var(--accent); text-decoration: underline;
}

/* ── Copy button inside bot bubble ── */
.bubble.bot {
  position: relative;
}
.copy-btn {
  display: none !important;
  position: absolute;
  top: 7px; right: 7px;
  opacity: 0;
  background: rgb(2 53 117);
  border: 1px solid var(--border-glass);
  color: #fff;
  width: 26px; height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700;
  transition: opacity .2s, background .2s;
  flex-shrink: 0;
}
.bubble.bot:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: #999999; }
.copy-btn.copied {
  background: rgba(34, 197, 94, .18);
  border-color: #22c55e;
  color: #22c55e;
}
/* give content slight padding-right so text doesn't overlap copy btn */
.msg-content { padding-right: 22px; }

/* ── Feedback row ── */
.feedback-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  animation: msgEnter .2s ease both;
}
.feedback-label {
  font-size: .75rem;
  color: var(--text-dim);
  margin-right: 2px;
}
.feedback-btn {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-dim);
  width: 32px; height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .85rem;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.feedback-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text-main); }
.feedback-btn:disabled { cursor: default; }
.feedback-btn.selected-up  { background: rgba(34,197,94,.15);  border-color: #22c55e; color: #22c55e; }
.feedback-btn.selected-down{ background: rgba(239,68,68,.15);  border-color: #ef4444; color: #ef4444; }
.feedback-thanks { font-size: .75rem; color: var(--text-dim); margin-left: 2px; }

/* ── Follow-up chips ── */
.followup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 2px 4px;
  animation: msgEnter .25s ease both;
}
.followup-label {
  width: 100%;
  font-size: .73rem;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.followup-chip {
  background: var(--accent-dim);
  border: 1px solid var(--border-glass);
  color: var(--accent);
  padding: 5px 13px;
  border-radius: 20px;
  font-family: var(--font);
  font-size: .77rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}
.followup-chip:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
  color: white;
  transform: translateY(-1px);
  /*box-shadow: 0 3px 10px var(--primary-glow);*/
}

/* ── Source chip expansion ── */
.src-chip.expandable { cursor: pointer; }
.src-chip.expandable:hover { background: rgba(167,139,250,.28); }
.src-chip.chip-active {
  background: rgba(124,58,237,.25);
  border-color: var(--accent);
  color: white;
}
.snippet-expand {
  display: none;
  background: rgba(0,0,0,.32);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 9px 12px;
  margin-top: 5px;
  font-size: .77rem;
  color: var(--text-dim);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  animation: msgEnter .2s ease both;
}
.snippet-expand[style*="block"],
.snippet-expand.open { display: block; }

/* ── Send button spinner ── */
.send-btn .spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.send-btn.busy .spinner { display: block; }
.send-btn.busy .send-icon { display: none; }
.send-btn.busy {
  opacity: .65;
  cursor: not-allowed;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* kb sources */
.sources { margin-top: 6px; }
.src-chip {
  display: inline-block; background: rgba(167,139,250,.15);
  color: var(--accent); border: 1px solid var(--accent-dim);
  padding: 2px 9px; border-radius: 6px; font-size: .74rem;
  margin: 2px 3px 2px 0;
}

/* ── Responsive ── */
@media (max-width: 500px) {
  .chat-widget { width: 100vw; height: 100dvh; bottom: 0; right: 0; border-radius: 0; }
  .launcher    { bottom: 20px; right: 20px; }
  .nav         { padding: 16px 20px; }
  .nav-links   { display: none; }
}



.choice-btn:focus{
  outline: none !important;
}

.kb-action-row{display: none;}

