/* AKT Immigration — Chatbot Widget */

/* ── FAB (floating action button) ─────────────────────── */
.chatbot-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #C9A962;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
.chatbot-fab:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .24);
}
.chatbot-fab svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

/* ── Chat panel ───────────────────────────────────────── */
.chatbot-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #E8E8E8;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .14);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.chatbot-panel.open {
  display: flex;
}

/* ── Header ───────────────────────────────────────────── */
.chatbot-header {
  background: #1B2A4A;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chatbot-header-title {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.chatbot-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: .8;
  transition: opacity .15s;
}
.chatbot-close:hover { opacity: 1; }

/* ── Disclaimer bar ───────────────────────────────────── */
.chatbot-disclaimer {
  background: #FEF3CD;
  color: #664D03;
  font-size: .7rem;
  line-height: 1.35;
  padding: 8px 14px;
  text-align: center;
  flex-shrink: 0;
  border-bottom: 1px solid #E8E8E8;
}

/* ── Messages area ────────────────────────────────────── */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chatbot-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: .85rem;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.chatbot-msg a {
  color: inherit;
  text-decoration: underline;
}
.chatbot-msg-user {
  background: #C9A962;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chatbot-msg-bot {
  background: #F1F3F5;
  color: #1A1A1A;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
.chatbot-typing {
  display: none;
  align-self: flex-start;
  padding: 10px 18px;
  background: #F1F3F5;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}
.chatbot-typing.visible { display: block; }
.chatbot-typing span {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #999;
  border-radius: 50%;
  margin: 0 2px;
  animation: chatbot-bounce .6s infinite alternate;
}
.chatbot-typing span:nth-child(2) { animation-delay: .2s; }
.chatbot-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatbot-bounce {
  to { transform: translateY(-5px); opacity: .5; }
}

/* ── Input area ───────────────────────────────────────── */
.chatbot-input-area {
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
  border-top: 1px solid #E8E8E8;
  gap: 8px;
  flex-shrink: 0;
  background: #fff;
}
.chatbot-textarea {
  flex: 1;
  border: 1px solid #E8E8E8;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .85rem;
  font-family: inherit;
  line-height: 1.4;
  resize: none;
  max-height: 80px;
  overflow-y: auto;
  outline: none;
  transition: border-color .15s;
}
.chatbot-textarea:focus {
  border-color: #C9A962;
}
.chatbot-textarea::placeholder {
  color: #999;
}
.chatbot-send {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #C9A962;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.chatbot-send:hover { background: #B89A55; }
.chatbot-send:disabled {
  background: #ddd;
  cursor: not-allowed;
}
.chatbot-send svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* ── Mobile (≤600px): full-screen panel ───────────────── */
@media (max-width: 600px) {
  .chatbot-panel {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  .chatbot-fab {
    bottom: 16px;
    right: 16px;
  }
}

/* ── Limit badge (conversation counter) ───────────────── */
.chatbot-limit {
  font-size: .65rem;
  color: #999;
  text-align: center;
  padding: 2px 0 0;
  flex-shrink: 0;
}
