/* =========================================
   EVOLVE TRAINING CHATBOT WIDGET STYLES
   evolve-chatbot-widget.css
   ========================================= */

/* ---------- LAUNCHER BUTTON ---------- */
#evolve-chat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  background: #1a3a2a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99999;
  color: #fff;
  box-shadow: 0 4px 20px rgba(26,58,42,0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#evolve-chat-launcher:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 28px rgba(26,58,42,0.55);
}
#evolve-unread-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #e05c3a;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}

/* ---------- CHAT WINDOW ---------- */
#evolve-chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 360px;
  height: 520px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.18);
  display: none;
  flex-direction: column;
  z-index: 99998;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  animation: evolveSlideUp 0.25s ease;
}
#evolve-chat-window.evolve-open {
  display: flex;
}
@keyframes evolveSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- HEADER ---------- */
#evolve-chat-header {
  background: #1a3a2a;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.evolve-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #4a9e70;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.evolve-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.evolve-header-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1;
}
.evolve-header-status {
  font-size: 11px;
  color: #a0d4b5;
  display: flex;
  align-items: center;
  gap: 4px;
}
.evolve-dot {
  width: 6px;
  height: 6px;
  background: #5fd68a;
  border-radius: 50%;
  display: inline-block;
  animation: evolvePulse 2s infinite;
}
@keyframes evolvePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.evolve-close-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.evolve-close-btn:hover { color: #fff; }

/* ---------- MESSAGES ---------- */
#evolve-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#evolve-messages::-webkit-scrollbar { width: 4px; }
#evolve-messages::-webkit-scrollbar-thumb {
  background: #d0d8d4;
  border-radius: 4px;
}
.evolve-msg {
  display: flex;
  gap: 7px;
  align-items: flex-end;
}
.evolve-msg.evolve-user { flex-direction: row-reverse; }
.evolve-bubble {
  max-width: 78%;
  padding: 9px 13px;
  font-size: 13.5px;
  line-height: 1.55;
  border-radius: 16px;
  word-break: break-word;
}
.evolve-msg.evolve-bot .evolve-bubble {
  background: #f0f4f2;
  color: #1a2a22;
  border-radius: 4px 16px 16px 16px;
}
.evolve-msg.evolve-user .evolve-bubble {
  background: #1a3a2a;
  color: #ffffff;
  border-radius: 16px 4px 16px 16px;
}
.evolve-msg-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #4a9e70;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.3px;
}

/* ---------- TYPING INDICATOR ---------- */
.evolve-typing {
  display: flex;
  gap: 4px;
  padding: 10px 13px;
  background: #f0f4f2;
  border-radius: 4px 16px 16px 16px;
  width: fit-content;
  align-items: center;
}
.evolve-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8aaa98;
  animation: evolveTypeBounce 1.1s infinite;
}
.evolve-typing span:nth-child(2) { animation-delay: 0.15s; }
.evolve-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes evolveTypeBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* ---------- QUICK CHIPS ---------- */
#evolve-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 14px 10px;
  flex-shrink: 0;
}
.evolve-chip {
  border: 1px solid #c5d8cd;
  background: #f5f9f7;
  color: #2a5c3f;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.evolve-chip:hover {
  background: #dff0e8;
  border-color: #4a9e70;
}

/* ---------- INPUT AREA ---------- */
#evolve-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid #eaeeec;
  background: #fff;
  flex-shrink: 0;
}
#evolve-user-input {
  flex: 1;
  border: 1px solid #d0dcd6;
  border-radius: 22px;
  padding: 9px 15px;
  font-size: 13.5px;
  font-family: inherit;
  background: #f7faf8;
  color: #1a2a22;
  outline: none;
  transition: border-color 0.15s;
}
#evolve-user-input:focus {
  border-color: #4a9e70;
  background: #fff;
}
#evolve-send-btn {
  background: #1a3a2a;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
#evolve-send-btn:hover { background: #2a5c3f; }
#evolve-send-btn:active { transform: scale(0.94); }

/* ---------- LINK STYLES IN BUBBLES ---------- */
.evolve-bubble a {
  color: #2a7a50;
  text-decoration: underline;
}
.evolve-msg.evolve-user .evolve-bubble a {
  color: #a0d4b5;
}

/* ---------- MOBILE RESPONSIVE ---------- */
@media (max-width: 480px) {
  #evolve-chat-window {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 90px;
    height: 70vh;
    max-height: 500px;
  }
  #evolve-chat-launcher {
    right: 16px;
    bottom: 16px;
  }
}
