/* ============================================
   WORKCONNECT CHATBOT WIDGET
   ============================================ */

.wc-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #000;
  box-shadow: 0 8px 28px rgba(201,168,76,0.4);
  z-index: 999;
  transition: transform 0.2s, box-shadow 0.2s;
}
.wc-chat-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 32px rgba(201,168,76,0.5);
}
.wc-chat-toggle .wc-close-icon { display: none; }
.wc-chat-toggle.open .wc-chat-icon { display: none; }
.wc-chat-toggle.open .wc-close-icon { display: block; }

.wc-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f87171;
  border: 2px solid var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Inter', sans-serif;
}

.wc-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 998;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
}
.wc-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.wc-chat-header {
  background: linear-gradient(135deg, var(--surface2), var(--surface3));
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.wc-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-d), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #000;
  flex-shrink: 0;
}
.wc-chat-header-info { flex: 1; }
.wc-chat-header-info strong {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: 0.92rem;
  color: var(--text);
}
.wc-chat-header-info span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  color: var(--text-sub);
}
.wc-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}

.wc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wc-chat-messages::-webkit-scrollbar { width: 5px; }
.wc-chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

.wc-msg {
  max-width: 84%;
  font-size: 0.86rem;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 14px;
  animation: wcFadeIn 0.25s ease;
}
@keyframes wcFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.wc-msg.bot {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.wc-msg.user {
  background: var(--gold);
  color: #000;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.wc-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 18px 14px;
  flex-shrink: 0;
}
.wc-suggestion-chip {
  background: rgba(201,168,76,0.08);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 12px;
  font-size: 0.76rem;
  color: var(--gold);
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.wc-suggestion-chip:hover { background: rgba(201,168,76,0.18); }

.wc-typing {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  align-self: flex-start;
  width: fit-content;
}
.wc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: wcTyping 1.2s infinite ease-in-out;
}
.wc-typing span:nth-child(2) { animation-delay: 0.15s; }
.wc-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes wcTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.wc-chat-input-bar {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: var(--surface);
}
.wc-chat-input-bar input {
  flex: 1;
  background: var(--bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}
.wc-chat-input-bar input:focus { border-color: var(--gold); }
.wc-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  color: #000;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.wc-chat-send:hover { background: var(--gold-l); }
.wc-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  .wc-chat-window {
    bottom: 90px;
    right: 16px;
    left: 16px;
    width: auto;
  }
  .wc-chat-toggle { bottom: 18px; right: 18px; }
}