/* JackCash AI Chat Widget — Claude Sonnet 4.5 */
:root {
  --jc-chat-purple: #7C6AED;
  --jc-chat-purple-dark: #6B5BD8;
  --jc-chat-bg: #0E0F1A;
  --jc-chat-panel: #14162A;
  --jc-chat-border: rgba(255, 255, 255, 0.08);
  --jc-chat-text: #F5F5FA;
  --jc-chat-muted: rgba(245, 245, 250, 0.55);
}

#jc-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--jc-chat-purple);
  border: none;
  cursor: pointer;
  z-index: 999999;
  box-shadow: 0 14px 36px rgba(124, 106, 237, 0.45), 0 4px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
#jc-chat-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  background: var(--jc-chat-purple-dark);
  box-shadow: 0 18px 44px rgba(124, 106, 237, 0.55), 0 6px 14px rgba(0, 0, 0, 0.4);
}
#jc-chat-launcher svg { width: 26px; height: 26px; }

#jc-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 96px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 130px);
  background: var(--jc-chat-panel);
  border: 1px solid var(--jc-chat-border);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 4px 16px rgba(0, 0, 0, 0.35);
  z-index: 999999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--jc-chat-text);
  animation: jc-chat-in 0.22s ease-out;
}
#jc-chat-panel.open { display: flex; }

@keyframes jc-chat-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#jc-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #7C6AED 0%, #5A4ACE 100%);
  border-bottom: 1px solid var(--jc-chat-border);
}
#jc-chat-header .jc-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
}
#jc-chat-header .jc-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
#jc-chat-header .jc-status {
  font-size: 11px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 5px;
}
#jc-chat-header .jc-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22C55E;
  display: inline-block;
}
#jc-chat-close {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
#jc-chat-close:hover { background: rgba(255, 255, 255, 0.22); }

#jc-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--jc-chat-bg);
  scroll-behavior: smooth;
}
#jc-chat-messages::-webkit-scrollbar { width: 6px; }
#jc-chat-messages::-webkit-scrollbar-track { background: transparent; }
#jc-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

.jc-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.jc-msg.user {
  align-self: flex-end;
  background: var(--jc-chat-purple);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.jc-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  color: var(--jc-chat-text);
  border: 1px solid var(--jc-chat-border);
  border-bottom-left-radius: 4px;
}
.jc-msg.bot.typing {
  color: var(--jc-chat-muted);
  font-style: italic;
}
.jc-typing-dots {
  display: inline-flex;
  gap: 4px;
  vertical-align: middle;
}
.jc-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jc-chat-muted);
  animation: jc-bounce 1.2s infinite ease-in-out;
}
.jc-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.jc-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes jc-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

#jc-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 8px;
  background: var(--jc-chat-bg);
}
#jc-chat-suggestions button {
  background: rgba(124, 106, 237, 0.12);
  color: var(--jc-chat-purple);
  border: 1px solid rgba(124, 106, 237, 0.3);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}
#jc-chat-suggestions button:hover { background: rgba(124, 106, 237, 0.22); }

#jc-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--jc-chat-panel);
  border-top: 1px solid var(--jc-chat-border);
}
#jc-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--jc-chat-border);
  color: var(--jc-chat-text);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  min-height: 40px;
}
#jc-chat-input:focus { border-color: var(--jc-chat-purple); }
#jc-chat-input::placeholder { color: var(--jc-chat-muted); }
#jc-chat-send {
  background: var(--jc-chat-purple);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, opacity 0.15s ease;
}
#jc-chat-send:hover:not(:disabled) { background: var(--jc-chat-purple-dark); }
#jc-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }
#jc-chat-send svg { width: 18px; height: 18px; }

#jc-chat-footer-note {
  padding: 6px 12px 10px;
  font-size: 10px;
  color: var(--jc-chat-muted);
  text-align: center;
  background: var(--jc-chat-panel);
}

@media (max-width: 480px) {
  #jc-chat-panel {
    right: 12px;
    left: 12px;
    bottom: 86px;
    width: auto;
  }
  #jc-chat-launcher {
    right: 16px;
    bottom: 16px;
  }
}
