/* ══════════════════════════════════════════
   IntelEdge HRM — Chatbot CSS v3.5
   Human Avatar Design — No conflicts
══════════════════════════════════════════ */

/* ── BUBBLE BUTTON ── */
#ie-chatbot-bubble {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, #e91e8c, #673ab7);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,.32);
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
}
#ie-chatbot-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0,0,0,.42);
}

/* Avatar inside bubble */
#ie-bubble-avatar {
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
}
#ie-bubble-avatar svg {
  width: 64px !important; height: 64px !important;
  display: block;
}

/* Badge */
#ie-chat-badge {
  position: absolute; top: -3px; right: -3px;
  background: #ff4444; color: #fff; border-radius: 50%;
  width: 19px; height: 19px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; z-index: 1;
}

/* ── CHAT WINDOW ── */
#ie-chatbot-window {
  position: fixed; bottom: 100px; right: 24px; z-index: 99998;
  width: 360px; max-height: 590px;
  background: #fff; border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: ie-slide-up .25s ease;
}
@keyframes ie-slide-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── HEADER ── */
#ie-chat-header {
  background: linear-gradient(135deg, #e91e8c, #673ab7);
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
#ie-chat-header-info {
  display: flex; align-items: center; gap: 10px;
}
#ie-chat-header-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
}
#ie-chat-header-avatar svg {
  width: 44px !important; height: 44px !important;
  display: block;
}
#ie-avatar-name {
  color: #fff; font-size: 15px; font-weight: 700;
  display: block; line-height: 1.2;
}
#ie-chat-status {
  color: rgba(255,255,255,.85); font-size: 11px; display: block;
}
#ie-chat-header small {
  color: rgba(255,255,255,.7); font-size: 10px; display: block;
}
#ie-chat-close {
  background: rgba(255,255,255,.2); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
#ie-chat-close:hover { background: rgba(255,255,255,.35); }

/* ── MODE BAR ── */
#ie-chat-mode-bar {
  display: flex; gap: 4px; padding: 8px 10px;
  background: #f8f4ff; border-bottom: 1px solid #ede7f6;
  flex-shrink: 0; overflow-x: auto;
}
.ie-mode-btn {
  flex: 1; padding: 5px 4px; border: 1px solid #d1c4e9;
  border-radius: 20px; background: #fff; font-size: 11px;
  cursor: pointer; color: #673ab7; transition: .2s; white-space: nowrap;
}
.ie-mode-btn.active {
  background: #673ab7; color: #fff; border-color: #673ab7;
}
.ie-mode-btn:hover:not(.active) { background: #ede7f6; }

/* ── MESSAGES ── */
#ie-chat-messages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: #fafafa;
}
.ie-chat-msg {
  max-width: 82%; padding: 10px 14px; border-radius: 18px;
  font-size: 13.5px; line-height: 1.55; word-break: break-word;
}
.ie-chat-msg.bot {
  background: #fff; border: 1px solid #e8d5f5; color: #333;
  border-bottom-left-radius: 4px; align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ie-chat-msg.bot strong { color: #673ab7; }
.ie-chat-msg.user {
  background: linear-gradient(135deg, #e91e8c, #673ab7); color: #fff;
  border-bottom-right-radius: 4px; align-self: flex-end;
}

/* Typing dots */
.ie-chat-typing {
  display: flex; gap: 5px; padding: 12px 16px;
  background: #fff; border: 1px solid #e8d5f5;
  border-radius: 18px; border-bottom-left-radius: 4px;
  align-self: flex-start; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ie-chat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #9c27b0;
  animation: ie-bounce .9s infinite;
}
.ie-chat-typing span:nth-child(2) { animation-delay: .15s; }
.ie-chat-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes ie-bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-7px); }
}

/* ── QUICK BUTTONS ── */
#ie-chat-quick-btns {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 6px 10px; background: #f8f4ff;
  border-top: 1px solid #ede7f6; flex-shrink: 0;
}
.ie-quick-btn {
  background: #fff; border: 1px solid #d1c4e9; border-radius: 15px;
  padding: 5px 11px; font-size: 12px; cursor: pointer; color: #673ab7;
  transition: .15s; white-space: nowrap;
}
.ie-quick-btn:hover { background: #673ab7; color: #fff; border-color: #673ab7; }

/* ── INPUT ROW ── */
#ie-chat-input-row {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px; border-top: 1px solid #eee;
  background: #fff; flex-shrink: 0;
}
#ie-chat-input {
  flex: 1; border: 1.5px solid #d1c4e9; border-radius: 20px;
  padding: 9px 14px; font-size: 13.5px; resize: none;
  outline: none; max-height: 90px; line-height: 1.4; font-family: inherit;
}
#ie-chat-input:focus { border-color: #9c27b0; box-shadow: 0 0 0 3px rgba(156,39,176,.1); }
#ie-chat-send {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #e91e8c, #673ab7);
  color: #fff; cursor: pointer; font-size: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s;
}
#ie-chat-send:hover { transform: scale(1.1); }

/* ── FOOTER ── */
#ie-chat-footer {
  text-align: center; padding: 7px; font-size: 11px; color: #999;
  background: #fafafa; border-top: 1px solid #f0e6ff; flex-shrink: 0;
}
#ie-chat-footer a { color: #9c27b0; text-decoration: none; }

/* Action button inside chat */
.ie-chat-action-btn {
  display: inline-block; margin-top: 8px; padding: 6px 14px;
  background: #673ab7; color: #fff; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer; border: none;
}

/* ── PULSE ANIMATION ON BUBBLE ── */
.ie-bubble-pulse {
  animation: ie-pulse 1s ease-in-out 3;
}
@keyframes ie-pulse {
  0%,100% { box-shadow: 0 4px 20px rgba(0,0,0,.32); }
  50%      { box-shadow: 0 0 0 10px rgba(233,30,140,.2), 0 4px 20px rgba(0,0,0,.3); }
}

/* ── RESPONSIVE ── */
@media (max-width: 440px) {
  #ie-chatbot-window { width: calc(100vw - 20px); right: 10px; bottom: 90px; }
  #ie-chatbot-bubble { bottom: 16px; right: 16px; }
}
