/* ── NexDam Chatbot ──────────────────────────────────────────────────────── */

#nd-chat-bubble{
  position:fixed;
  bottom:72px;right:16px;
  z-index:99000;
  width:56px;height:56px;
  border-radius:50%;
  background:linear-gradient(135deg,#0077ff,#00a2ff);
  border:none;cursor:pointer;
  box-shadow:0 6px 28px rgba(0,119,255,.45);
  display:flex;align-items:center;justify-content:center;
  transition:transform .25s,box-shadow .25s;
  color:#fff;font-size:24px;
}
#nd-chat-bubble:hover{
  transform:translateY(-3px) scale(1.06);
  box-shadow:0 10px 36px rgba(0,119,255,.6);
}
#nd-chat-bubble .nd-bubble-badge{
  position:absolute;top:-4px;right:-4px;
  width:18px;height:18px;
  background:#ff4d63;
  border-radius:50%;
  border:2px solid #050b16;
  font-size:10px;font-weight:700;
  display:flex;align-items:center;justify-content:center;
}

/* Window */
#nd-chat-window{
  position:fixed;
  bottom:140px;right:16px;
  z-index:99000;
  width:min(370px, calc(100vw - 32px));
  max-height:min(560px, calc(100vh - 120px));
  display:flex;flex-direction:column;
  border:1px solid rgba(0,162,255,.28);
  border-radius:20px;
  background:linear-gradient(160deg,#0b1323,#070f1c);
  box-shadow:0 24px 80px rgba(0,0,0,.7), 0 0 0 1px rgba(0,162,255,.1);
  overflow:hidden;
  transition:opacity .22s, transform .22s;
  opacity:0;transform:translateY(18px) scale(.96);
  pointer-events:none;
}
#nd-chat-window.nd-open{
  opacity:1;transform:translateY(0) scale(1);
  pointer-events:all;
}

/* Header */
.nd-chat-header{
  display:flex;align-items:center;gap:12px;
  padding:16px 18px;
  background:rgba(0,119,255,.12);
  border-bottom:1px solid rgba(0,162,255,.18);
  flex-shrink:0;
}
.nd-chat-avatar{
  width:38px;height:38px;border-radius:12px;
  background:linear-gradient(135deg,#0055cc,#00a2ff);
  display:grid;place-items:center;
  font-size:16px;font-weight:700;color:#fff;
  flex-shrink:0;
}
.nd-chat-header-info{flex:1;min-width:0}
.nd-chat-header-info strong{
  display:block;font-size:14px;color:#f7fbff;font-weight:600;
}
.nd-chat-header-info small{
  font-size:11px;color:#a8b7ca;
}
.nd-online-dot{
  display:inline-block;width:7px;height:7px;
  border-radius:50%;background:#3cdc78;
  box-shadow:0 0 6px #3cdc78;margin-right:5px;
}
.nd-chat-close{
  background:none;border:none;color:#a8b7ca;
  font-size:20px;cursor:pointer;padding:4px;
  border-radius:8px;transition:color .18s,background .18s;
  line-height:1;
}
.nd-chat-close:hover{color:#f7fbff;background:rgba(255,255,255,.08)}

/* Messages */
.nd-chat-messages{
  flex:1;overflow-y:auto;
  padding:16px;
  display:flex;flex-direction:column;gap:10px;
  scroll-behavior:smooth;
}
.nd-chat-messages::-webkit-scrollbar{width:4px}
.nd-chat-messages::-webkit-scrollbar-track{background:transparent}
.nd-chat-messages::-webkit-scrollbar-thumb{background:rgba(0,162,255,.25);border-radius:4px}

.nd-msg{
  max-width:86%;
  padding:10px 14px;
  border-radius:14px;
  font-size:13px;line-height:1.65;
  animation:nd-pop .2s ease;
}
@keyframes nd-pop{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

.nd-msg-bot{
  align-self:flex-start;
  background:rgba(0,162,255,.1);
  border:1px solid rgba(0,162,255,.18);
  color:#ddeeff;
  border-bottom-left-radius:4px;
}
.nd-msg-user{
  align-self:flex-end;
  background:linear-gradient(135deg,rgba(0,100,220,.5),rgba(0,162,255,.35));
  border:1px solid rgba(0,162,255,.3);
  color:#f7fbff;
  border-bottom-right-radius:4px;
}

/* Typing indicator */
.nd-typing{
  display:flex;gap:5px;align-items:center;
  padding:12px 16px;
  align-self:flex-start;
  background:rgba(0,162,255,.08);
  border:1px solid rgba(0,162,255,.15);
  border-radius:14px;border-bottom-left-radius:4px;
}
.nd-typing span{
  width:7px;height:7px;border-radius:50%;
  background:#00a2ff;
  animation:nd-bounce .9s infinite ease-in-out;
}
.nd-typing span:nth-child(2){animation-delay:.18s}
.nd-typing span:nth-child(3){animation-delay:.36s}
@keyframes nd-bounce{0%,80%,100%{transform:translateY(0)}40%{transform:translateY(-6px)}}

/* Quick replies */
.nd-quick-replies{
  display:flex;flex-wrap:wrap;gap:7px;
  padding:0 16px 12px;
  flex-shrink:0;
}
.nd-qr{
  padding:7px 13px;
  border:1px solid rgba(0,162,255,.3);
  border-radius:999px;
  background:rgba(0,162,255,.07);
  color:#a8d8ff;
  font-size:12px;font-family:inherit;
  cursor:pointer;transition:all .18s;
  white-space:nowrap;
}
.nd-qr:hover{
  background:rgba(0,162,255,.2);
  border-color:rgba(0,162,255,.6);
  color:#fff;
}

/* Input bar */
.nd-chat-input-row{
  display:flex;gap:8px;align-items:center;
  padding:12px 14px;
  border-top:1px solid rgba(0,162,255,.14);
  flex-shrink:0;
}
#nd-chat-input{
  flex:1;
  background:rgba(0,162,255,.06);
  border:1px solid rgba(0,162,255,.22);
  border-radius:10px;
  color:#f7fbff;
  font:inherit;font-size:13px;
  padding:9px 13px;
  outline:none;
  transition:border-color .18s;
}
#nd-chat-input::placeholder{color:#5a7a9a}
#nd-chat-input:focus{border-color:rgba(0,162,255,.55)}
#nd-chat-send{
  width:38px;height:38px;border-radius:10px;
  background:linear-gradient(135deg,#0055cc,#00a2ff);
  border:none;cursor:pointer;
  display:grid;place-items:center;
  font-size:16px;color:#fff;
  transition:transform .18s,box-shadow .18s;
  flex-shrink:0;
}
#nd-chat-send:hover{transform:scale(1.08);box-shadow:0 4px 16px rgba(0,119,255,.45)}
