/* ================================================
   ASK BJ — CHATBOT WIDGET
   ================================================ */

#wc-chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}

/* --- Toggle Button --- */
#wc-chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e8003d;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(232,0,61,0.45), 0 2px 8px rgba(0,0,0,0.25);
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  position: relative;
  z-index: 1;
}
#wc-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(232,0,61,0.55), 0 2px 8px rgba(0,0,0,0.25);
}
#wc-chat-toggle:active { transform: scale(0.95); }
#wc-chat-toggle:focus-visible { outline: 2px solid #e8003d; outline-offset: 3px; }
#wc-chat-toggle svg { width: 22px; height: 22px; fill: white; pointer-events: none; }
#wc-chat-toggle.is-open .icon-chat  { display: none; }
#wc-chat-toggle:not(.is-open) .icon-close { display: none; }

/* Pulse ring */
#wc-chat-toggle::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(232,0,61,0.45);
  animation: wc-pulse 2.5s ease-out infinite;
}
@keyframes wc-pulse {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* --- Chat Window --- */
#wc-chat-window {
  position: absolute;
  bottom: calc(100% + 0.875rem);
  right: 0;
  width: 360px;
  background: #08090d;
  border-radius: 14px;
  box-shadow:
    0 24px 64px rgba(0,0,0,0.55),
    0 8px 24px rgba(0,0,0,0.3),
    0 0 0 1px rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s;
}
#wc-chat-window.is-hidden {
  transform: scale(0.82) translateY(16px);
  opacity: 0;
  pointer-events: none;
}

/* --- Header --- */
#wc-chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 1rem 1.125rem;
  background: #111116;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.wc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e8003d;
  color: white;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Barlow Condensed', sans-serif;
  box-shadow: 0 2px 8px rgba(232,0,61,0.35);
}
.wc-header-info { flex: 1; min-width: 0; }
.wc-header-info strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.01em;
}
.wc-header-info span {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.03em;
}
.wc-online {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00c87a;
  margin-right: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
#wc-chat-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.375rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
#wc-chat-close:hover { color: white; background: rgba(255,255,255,0.07); }

/* --- Messages --- */
#wc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 320px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
#wc-chat-messages::-webkit-scrollbar { width: 3px; }
#wc-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.wc-msg {
  display: flex;
  max-width: 88%;
  animation: wc-msg-in 0.3s cubic-bezier(0.22,1,0.36,1);
}
@keyframes wc-msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wc-msg--bot  { align-self: flex-start; }
.wc-msg--user { align-self: flex-end; }

.wc-msg__bubble {
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.65;
}
.wc-msg--bot .wc-msg__bubble {
  background: #1c1c26;
  color: rgba(255,255,255,0.82);
  border-radius: 4px 12px 12px 12px;
}
.wc-msg--user .wc-msg__bubble {
  background: #e8003d;
  color: white;
  border-radius: 12px 4px 12px 12px;
}
.wc-msg__bubble a {
  color: #ff6699;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s;
}
.wc-msg--user .wc-msg__bubble a { color: rgba(255,255,255,0.85); }
.wc-msg__bubble a:hover { color: white; }

/* Typing indicator */
.wc-typing .wc-msg__bubble { padding: 0.75rem 1rem; }
.wc-dots { display: flex; gap: 4px; align-items: center; height: 14px; }
.wc-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  animation: wc-dot 1.3s ease-in-out infinite;
}
.wc-dots span:nth-child(2) { animation-delay: 0.18s; }
.wc-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes wc-dot {
  0%,80%,100% { transform: scale(1);   opacity: 0.35; }
  40%         { transform: scale(1.25); opacity: 1; }
}

/* --- Input Area --- */
#wc-chat-input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: #111116;
  flex-shrink: 0;
}
#wc-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.6rem 0.875rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: white;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}
#wc-chat-input::placeholder { color: rgba(255,255,255,0.28); }
#wc-chat-input:focus { border-color: rgba(232,0,61,0.55); }

#wc-chat-send {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #e8003d;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
}
#wc-chat-send:hover  { background: #ff3366; transform: scale(1.06); }
#wc-chat-send:active { transform: scale(0.94); }
#wc-chat-send svg { pointer-events: none; }

/* --- Mobile --- */
@media (max-width: 480px) {
  #wc-chat-widget { bottom: 1rem; right: 1rem; left: 1rem; }
  #wc-chat-window { width: 100%; right: 0; left: 0; }
}
