/* ═══════════════════════════════════════════════════════════
   Talent Advisor — Chatbot Widget
   ═══════════════════════════════════════════════════════════ */

/* ─── Floating button ─────────────────────────────────────── */
#ta-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #0a1e50;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(10, 30, 80, 0.4);
  z-index: 9998;
  transition: transform 0.2s, box-shadow 0.2s;
}
#ta-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 32px rgba(10, 30, 80, 0.5);
}
#ta-chat-btn svg {
  width: 26px;
  height: 26px;
  pointer-events: none;
}

#ta-chat-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 20px;
  height: 20px;
  background: #FFCD00;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 900;
  color: #0a1e50;
  display: none;
  align-items: center;
  justify-content: center;
  animation: ta-badge-pulse 1.6s infinite;
  border: 2px solid white;
}
@keyframes ta-badge-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.25); }
}

/* ─── Chat panel ──────────────────────────────────────────── */
#ta-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  height: 520px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 48px rgba(10, 30, 80, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 9997;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.88) translateY(24px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Segoe UI', Arial, sans-serif;
}
#ta-chat-panel.ta-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

/* ─── Header ──────────────────────────────────────────────── */
.ta-chat-header {
  background: linear-gradient(135deg, #0a1e50 0%, #1a3a8f 100%);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.ta-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #FFCD00;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.ta-chat-hinfo { flex: 1; min-width: 0; }
.ta-chat-hname  { color: #ffffff; font-weight: 700; font-size: 14px; line-height: 1.3; }
.ta-chat-hstatus { color: #a5b4fc; font-size: 11px; }
.ta-chat-hstatus::before {
  content: '●';
  color: #6ee7b7;
  margin-right: 4px;
  font-size: 9px;
}
.ta-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.ta-close-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }

/* ─── Messages area ───────────────────────────────────────── */
.ta-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.ta-chat-body::-webkit-scrollbar { width: 4px; }
.ta-chat-body::-webkit-scrollbar-track { background: transparent; }
.ta-chat-body::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 2px; }

/* ─── Message bubbles ─────────────────────────────────────── */
.ta-msg {
  display: flex;
  max-width: 86%;
  animation: ta-msg-appear 0.2s ease;
}
@keyframes ta-msg-appear {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ta-msg.ta-bot  { align-self: flex-start; }
.ta-msg.ta-user { align-self: flex-end; }

.ta-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.ta-msg.ta-bot  .ta-bubble {
  background: #f0f4ff;
  color: #1f2937;
  border-bottom-left-radius: 4px;
}
.ta-msg.ta-user .ta-bubble {
  background: #0a1e50;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* ─── Typing dots ─────────────────────────────────────────── */
.ta-typing .ta-bubble { padding: 13px 16px; }
.ta-dots { display: flex; gap: 5px; align-items: center; }
.ta-dots span {
  width: 7px; height: 7px;
  background: #9ca3af;
  border-radius: 50%;
  animation: ta-dot-bounce 0.9s infinite ease-in-out;
}
.ta-dots span:nth-child(2) { animation-delay: 0.15s; }
.ta-dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes ta-dot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-7px); }
}

/* ─── Contact card (inside chat) ──────────────────────────── */
.ta-cc-card {
  background: #f8faff;
  border: 1.5px solid #dbe4f7;
  border-radius: 14px;
  padding: 18px;
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
}
.ta-cc-card h4 {
  margin: 0 0 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0a1e50;
}
.ta-cc-card input,
.ta-cc-card textarea {
  width: 100%;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  margin-bottom: 8px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
  background: #ffffff;
}
.ta-cc-card input:focus,
.ta-cc-card textarea:focus { border-color: #0a1e50; }
.ta-cc-card textarea { resize: none; height: 62px; }
.ta-cc-card .ta-cc-submit {
  width: 100%;
  background: #0a1e50;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.ta-cc-card .ta-cc-submit:hover { background: #1a3a8f; }
.ta-cc-card .ta-cc-submit:disabled { opacity: 0.55; cursor: default; }
.ta-cc-success {
  text-align: center;
  padding: 10px 0 4px;
  font-size: 13.5px;
  color: #065f46;
  font-weight: 600;
  line-height: 1.5;
}

/* ─── Footer ──────────────────────────────────────────────── */
.ta-chat-footer {
  border-top: 1px solid #f3f4f6;
  padding: 10px 14px 14px;
  flex-shrink: 0;
}
.ta-contact-trigger {
  width: 100%;
  background: transparent;
  border: 1.5px solid #0a1e50;
  color: #0a1e50;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.ta-contact-trigger:hover { background: #0a1e50; color: #ffffff; }
.ta-input-row { display: flex; gap: 8px; align-items: flex-end; }
.ta-chat-input {
  flex: 1;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  resize: none;
  max-height: 88px;
  overflow-y: auto;
  line-height: 1.45;
  transition: border-color 0.15s;
  background: #ffffff;
}
.ta-chat-input:focus { border-color: #0a1e50; }
.ta-send-btn {
  width: 42px;
  height: 42px;
  background: #0a1e50;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.ta-send-btn:hover   { background: #1a3a8f; }
.ta-send-btn:disabled { opacity: 0.45; cursor: default; }
.ta-send-btn svg { width: 18px; height: 18px; pointer-events: none; }

/* ─── Responsive — full screen on mobile ─────────────────── */
@media (max-width: 500px) {
  #ta-chat-panel {
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    border-radius: 0;
    position: fixed;
  }
  #ta-chat-btn {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
  .ta-cc-card { max-width: 100%; }
}
