:root {
  --wcx-bg: #0a0a0a;
  --wcx-bg-popup: #111111;
  --wcx-text: #f5f5f5;
  --wcx-text-muted: #999;
  --wcx-accent: #f5d300;
  --wcx-user-bg: #f5d300;
  --wcx-user-text: #0a0a0a;
  --wcx-bot-bg: #1a1a1a;
  --wcx-bot-text: #f5f5f5;
  --wcx-border: #222;
  --wcx-radius: 12px;
}

.wcx-chat {
  position: fixed;
  bottom: 28px;
  right: 100px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wcx-fab {
  width: 60px;
  height: 60px;
  background: var(--wcx-accent);
  border: none;
  border-radius: 50%;
  color: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245, 211, 0, 0.25);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
  position: relative;
}

.wcx-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(245, 211, 0, 0.4);
}

.wcx-fab-icon {
  font-size: 24px;
  line-height: 1;
}

.wcx-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--wcx-accent);
  color: var(--wcx-user-text);
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wcx-popup {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  max-height: 520px;
  background: var(--wcx-bg-popup);
  border: 1px solid var(--wcx-border);
  border-radius: var(--wcx-radius);
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: wcx-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wcx-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wcx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--wcx-bg);
  border-bottom: 1px solid var(--wcx-border);
}

.wcx-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wcx-avatar {
  width: 36px;
  height: 36px;
  background: var(--wcx-accent);
  color: var(--wcx-user-text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
}

.wcx-header-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--wcx-text);
}

.wcx-header-sub {
  font-size: 11px;
  color: var(--wcx-text-muted);
}

.wcx-close {
  background: none;
  border: none;
  color: var(--wcx-text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
}

.wcx-close:hover {
  color: var(--wcx-text);
}

.wcx-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
  max-height: 340px;
}

.wcx-body::-webkit-scrollbar {
  width: 4px;
}

.wcx-body::-webkit-scrollbar-track {
  background: transparent;
}

.wcx-body::-webkit-scrollbar-thumb {
  background: var(--wcx-border);
  border-radius: 4px;
}

.wcx-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--wcx-radius);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  animation: wcx-fade-in 0.25s ease;
}

@keyframes wcx-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wcx-msg-bot {
  align-self: flex-start;
  background: var(--wcx-bot-bg);
  color: var(--wcx-bot-text);
  border-bottom-left-radius: 4px;
}

.wcx-msg-user {
  align-self: flex-end;
  background: var(--wcx-user-bg);
  color: var(--wcx-user-text);
  border-bottom-right-radius: 4px;
}

.wcx-msg-time {
  font-size: 10px;
  color: var(--wcx-text-muted);
  margin-top: 4px;
}

.wcx-msg-user .wcx-msg-time {
  text-align: right;
  color: rgba(10, 10, 10, 0.5);
}

.wcx-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
}

.wcx-typing span {
  width: 6px;
  height: 6px;
  background: var(--wcx-text-muted);
  border-radius: 50%;
  animation: wcx-bounce 1.4s infinite ease-in-out;
}

.wcx-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.wcx-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes wcx-bounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.wcx-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--wcx-border);
  background: var(--wcx-bg);
}

.wcx-input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid var(--wcx-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--wcx-text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.wcx-input::placeholder {
  color: var(--wcx-text-muted);
}

.wcx-input:focus {
  border-color: var(--wcx-accent);
}

.wcx-send {
  width: 40px;
  height: 40px;
  background: var(--wcx-accent);
  color: var(--wcx-user-text);
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.wcx-send:hover {
  opacity: 0.9;
  transform: scale(1.04);
}

.wcx-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.wcx-send svg {
  width: 18px;
  height: 18px;
}

.wcx-powered {
  text-align: center;
  padding: 6px;
  font-size: 10px;
  color: var(--wcx-text-muted);
  background: var(--wcx-bg);
}

.wcx-powered a {
  color: var(--wcx-accent);
  text-decoration: none;
}

@media (max-width: 480px) {
  .wcx-chat {
    bottom: 84px;
    right: 20px;
  }

  .wcx-popup {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    top: 0;
    width: 100%;
    max-height: 100%;
    border-radius: 0;
    animation: none;
  }

  .wcx-body {
    max-height: none;
    min-height: 0;
    flex: 1;
  }

  .wcx-fab {
    width: 52px;
    height: 52px;
  }

  .wcx-fab-icon {
    font-size: 20px;
  }
}
