/* ============================================================
   chatbot.css  –  Mindset-Kompass FAQ-Chatbot Widget
   Namespace: #mk-chat-* / .mk-chat-* / .mk-msg-* / .mk-chip
   ============================================================ */

/* ── Toggle Button ─────────────────────────────────────────── */
#mk-chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 10001;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.55);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
  outline: none;
  font-family: 'Inter', sans-serif;
}
#mk-chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 32px rgba(59, 130, 246, 0.7);
}
#mk-chat-toggle:active {
  transform: scale(0.96);
}

#mk-chat-close-label {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  font-family: 'Inter', sans-serif;
  font-style: normal;
}

/* Notification dot */
#mk-chat-notif {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 11px;
  height: 11px;
  background: #22d3ee;
  border: 2px solid #050810;
  border-radius: 50%;
  animation: mkChatNotifPulse 2.5s ease-in-out infinite;
}
@keyframes mkChatNotifPulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.6; }
}

/* ── Chat Window ───────────────────────────────────────────── */
#mk-chat-window {
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 10000;
  width: 360px;
  height: 500px;
  background: #090d1e;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(59, 130, 246, 0.08);
  transform: scale(0.88) translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.3, 0.64, 1),
              opacity 0.3s ease;
  transform-origin: bottom right;
}
#mk-chat-window.mk-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* ── Header ────────────────────────────────────────────────── */
#mk-chat-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px;
  background: rgba(59, 130, 246, 0.07);
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  flex-shrink: 0;
}
.mk-chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.mk-chat-header-info { flex: 1; min-width: 0; }
.mk-chat-title {
  font-size: 13px;
  font-weight: 700;
  color: #f0f4ff;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mk-chat-status {
  font-size: 11px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter', sans-serif;
  margin-top: 1px;
}
.mk-chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  display: inline-block;
  animation: mkDotPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes mkDotPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}
.mk-chat-header-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #475569;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1;
}
.mk-chat-header-close:hover { background: rgba(255,255,255,0.1); color: #94a3b8; }

/* ── Messages Area ─────────────────────────────────────────── */
#mk-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
#mk-chat-messages::-webkit-scrollbar { width: 3px; }
#mk-chat-messages::-webkit-scrollbar-track { background: transparent; }
#mk-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.2);
  border-radius: 2px;
}

.mk-msg {
  max-width: 87%;
  font-size: 12.5px;
  line-height: 1.65;
  font-family: 'Inter', sans-serif;
  word-break: break-word;
  white-space: pre-wrap;
  animation: mkMsgIn 0.2s ease;
}
@keyframes mkMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mk-msg-bot {
  align-self: flex-start;
  background: rgba(59, 130, 246, 0.09);
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 14px 14px 14px 3px;
  padding: 10px 13px;
  color: #cbd5e1;
}
.mk-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg,
    rgba(29, 78, 216, 0.65),
    rgba(59, 130, 246, 0.55));
  border-radius: 14px 14px 3px 14px;
  padding: 10px 13px;
  color: #f0f4ff;
}

/* Typing indicator */
.mk-typing {
  align-self: flex-start;
  padding: 11px 14px;
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 14px 14px 14px 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: mkMsgIn 0.2s ease;
}
.mk-typing span {
  width: 6px;
  height: 6px;
  background: #60a5fa;
  border-radius: 50%;
  display: inline-block;
  animation: mkTypingBounce 1.3s ease-in-out infinite;
}
.mk-typing span:nth-child(2) { animation-delay: 0.18s; }
.mk-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes mkTypingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-7px); }
}

/* ── Quick-Reply Chips ─────────────────────────────────────── */
#mk-chat-chips {
  padding: 4px 12px 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
  min-height: 0;
}
.mk-chip {
  background: rgba(59, 130, 246, 0.07);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  color: #60a5fa;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1.4;
}
.mk-chip:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

/* ── Input Area ────────────────────────────────────────────── */
#mk-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
#mk-chat-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 12.5px;
  color: #f0f4ff;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
#mk-chat-input::placeholder { color: #2d3748; }
#mk-chat-input:focus { border-color: rgba(59, 130, 246, 0.4); }

#mk-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
}
#mk-chat-send:hover {
  transform: scale(1.06);
  box-shadow: 0 5px 16px rgba(59, 130, 246, 0.55);
}
#mk-chat-send:active { transform: scale(0.95); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
  #mk-chat-window {
    width: calc(100vw - 20px);
    right: 10px;
    bottom: 86px;
    height: 68vh;
    max-height: 520px;
    border-radius: 16px;
  }
  #mk-chat-toggle {
    right: 16px;
    bottom: 16px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}
