@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&display=swap");

:root {
  --wcc-primary: #0d9488;
  --wcc-primary-strong: #0f766e;
  --wcc-launcher-size: 64px;
  --wcc-launcher-ring-text: #0f172a;
  --wcc-launcher-ring-spacing: 8px;
  --wcc-launcher-ring-size: calc(var(--wcc-launcher-size) + 68px + (var(--wcc-launcher-ring-spacing) * 2));
  --wcc-bg-soft: #eef2ff;
  --wcc-surface: #ffffff;
  --wcc-surface-glass: rgba(255, 255, 255, 0.78);
  --wcc-text: #0f172a;
  --wcc-muted: #475569;
  --wcc-border: rgba(15, 23, 42, 0.14);
  --wcc-shadow: 0 24px 56px rgba(2, 6, 23, 0.22);
  --wcc-shadow-soft: 0 10px 22px rgba(15, 23, 42, 0.1);
}

.wcc-chatbot-root {
  font-family: "Sora", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--wcc-text);
}

.wcc-floating-mode {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
}

.wcc-floating-mode.wcc-has-launcher-ring {
  right: calc(20px + ((var(--wcc-launcher-ring-size) - var(--wcc-launcher-size)) / 2));
  bottom: calc(20px + ((var(--wcc-launcher-ring-size) - var(--wcc-launcher-size)) / 2));
}

.wcc-launcher-wrap {
  position: relative;
  width: var(--wcc-launcher-size);
  height: var(--wcc-launcher-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wcc-launcher-helper-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--wcc-launcher-ring-size);
  height: var(--wcc-launcher-ring-size);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  animation: wccRingSpin 16s linear infinite;
}

.wcc-launcher-helper-guide {
  fill: none;
  stroke: rgba(148, 163, 184, 0.26);
  stroke-width: 1;
}

.wcc-launcher-helper-text {
  fill: var(--wcc-launcher-ring-text);
  font-size: 8.2px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.wcc-launcher {
  width: var(--wcc-launcher-size);
  height: var(--wcc-launcher-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  box-shadow: var(--wcc-shadow);
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.3), transparent 45%),
    linear-gradient(140deg, var(--wcc-primary), var(--wcc-primary-strong));
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.wcc-launcher::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.wcc-launcher-label {
  line-height: 1;
  letter-spacing: 0.02em;
}

.wcc-launcher-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.wcc-launcher-dot {
  position: absolute;
  top: max(3px, calc(var(--wcc-launcher-size) * 0.11));
  right: max(3px, calc(var(--wcc-launcher-size) * 0.11));
  width: clamp(7px, calc(var(--wcc-launcher-size) * 0.14), 12px);
  height: clamp(7px, calc(var(--wcc-launcher-size) * 0.14), 12px);
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.22);
}

.wcc-window {
  width: min(400px, calc(100vw - 28px));
  height: 620px;
  border-radius: 24px;
  margin-top: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background:
    radial-gradient(circle at -5% 2%, rgba(34, 197, 94, 0.12), transparent 34%),
    radial-gradient(circle at 105% 0%, rgba(20, 184, 166, 0.12), transparent 35%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.96));
  box-shadow: var(--wcc-shadow);
  display: none;
  overflow: hidden;
  position: relative;
}

.wcc-window.is-open {
  display: flex;
  flex-direction: column;
  animation: wccWindowIn 220ms ease-out;
}

.wcc-inline-mode {
  position: relative;
  width: 100%;
}

.wcc-inline-mode .wcc-launcher-wrap {
  display: none;
}

.wcc-inline-mode .wcc-window {
  width: 100%;
  max-width: 760px;
  height: 640px;
  margin: 0;
}

.wcc-header {
  padding: 17px 16px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  background: var(--wcc-surface-glass);
  backdrop-filter: blur(12px);
}

.wcc-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.wcc-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--wcc-muted);
}

.wcc-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 9px;
  background: #fff;
  color: #475569;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.wcc-quick-prompts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: min(100%, 560px);
  margin-left: auto;
  padding: 2px 0 4px;
  border: 0;
  background: transparent;
}

.wcc-prompt-heading {
  display: none;
}

.wcc-prompt-chip-list {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.wcc-prompt {
  width: fit-content;
  max-width: 92%;
  border: 1.5px solid rgba(22, 163, 74, 0.9);
  color: #13964d;
  background: #ffffff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  padding: 8px 13px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.05);
  cursor: pointer;
  text-align: center;
}

.wcc-prompt:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(22, 163, 74, 0.16);
}

.wcc-prompt.is-entering {
  animation: wccPromptIn 280ms ease both;
}

.wcc-quick-prompts.is-hidden {
  display: none;
}

.wcc-quick-prompts:empty {
  display: none;
}

.wcc-messages {
  flex: 1;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.38) 0%, rgba(255, 255, 255, 0.46) 100%);
}

.wcc-messages::-webkit-scrollbar {
  width: 8px;
}

.wcc-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.wcc-message-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 92%;
  animation: wccMessageIn 180ms ease-out;
}

.wcc-message-inner {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.wcc-message-row.is-user {
  margin-left: auto;
  align-items: flex-end;
}

.wcc-message-row.is-user .wcc-message-inner {
  flex-direction: row-reverse;
}

.wcc-message-row.is-bot {
  margin-right: auto;
  align-items: flex-start;
}

.wcc-message-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wcc-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.16);
}

.wcc-avatar.is-bot {
  background: linear-gradient(140deg, var(--wcc-primary), var(--wcc-primary-strong));
}

.wcc-avatar.is-user {
  background: #334155;
}

.wcc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
}

.wcc-bubble {
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #fff;
  box-shadow: var(--wcc-shadow-soft);
}

.wcc-bubble.is-streaming {
  position: relative;
}

.wcc-bubble.is-streaming::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 14px;
  margin-left: 5px;
  vertical-align: -2px;
  background: var(--wcc-primary);
  animation: wccCaretBlink 0.9s steps(1, end) infinite;
}

.wcc-bubble a {
  color: #0f766e;
}

.wcc-message-row.is-user .wcc-bubble {
  color: #fff;
  border: 0;
  background: linear-gradient(140deg, var(--wcc-primary), var(--wcc-primary-strong));
}

.wcc-typing {
  color: var(--wcc-muted);
}

.wcc-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wcc-feedback-btn {
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: #fff;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  cursor: pointer;
}

.wcc-feedback-btn.is-selected {
  border-color: var(--wcc-primary);
  color: #fff;
  background: var(--wcc-primary);
}

.wcc-learning-badge {
  font-size: 11px;
  color: #0f766e;
  font-weight: 600;
}

.wcc-post-lead-actions {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
  box-shadow: var(--wcc-shadow-soft);
}

.wcc-post-lead-copy {
  margin: 0 0 8px;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
}

.wcc-post-lead-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wcc-post-lead-btn {
  border: 1px solid rgba(13, 148, 136, 0.3);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  color: #0f766e;
  background: rgba(13, 148, 136, 0.08);
  cursor: pointer;
}

.wcc-post-lead-btn.is-end {
  border-color: rgba(239, 68, 68, 0.3);
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.08);
}

.wcc-post-lead-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wcc-feedback-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.wcc-feedback-modal {
  width: min(100%, 340px);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  box-shadow: var(--wcc-shadow);
  padding: 14px;
}

.wcc-feedback-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.wcc-feedback-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.wcc-feedback-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #fff;
  color: #334155;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.wcc-feedback-stars {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.wcc-feedback-star {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.wcc-feedback-star.is-selected {
  color: #f59e0b;
}

.wcc-feedback-comment {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13px;
  resize: vertical;
  min-height: 86px;
}

.wcc-feedback-error {
  min-height: 16px;
  margin: 7px 0 0;
  color: #b91c1c;
  font-size: 12px;
}

.wcc-feedback-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.wcc-feedback-cancel,
.wcc-feedback-submit {
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 12px;
  cursor: pointer;
}

.wcc-feedback-cancel {
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  color: #334155;
}

.wcc-feedback-submit {
  border: 0;
  color: #fff;
  background: linear-gradient(140deg, var(--wcc-primary), var(--wcc-primary-strong));
}

.wcc-lead-box {
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  padding: 10px 12px;
  background: linear-gradient(160deg, rgba(236, 253, 245, 0.95), rgba(240, 249, 255, 0.95));
}

.wcc-lead-copy {
  margin: 0 0 8px;
  font-size: 12px;
  color: #0f766e;
  font-weight: 600;
}

.wcc-lead-form {
  display: block;
  max-width: 340px;
}

.wcc-lead-step-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.wcc-lead-step-row input {
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 11px;
  padding: 10px 11px;
  font-size: 13px;
  background: #fff;
}

.wcc-lead-step-row input:focus {
  outline: 2px solid rgba(13, 148, 136, 0.24);
  border-color: var(--wcc-primary);
}

.wcc-lead-next,
.wcc-lead-step-row button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 42px;
  border: 0;
  border-radius: 11px;
  padding: 0 10px;
  font-size: 19px;
  line-height: 1;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--wcc-primary), var(--wcc-primary-strong));
  box-shadow: 0 10px 18px rgba(13, 148, 136, 0.24);
  cursor: pointer;
}

.wcc-lead-step-row button[type="submit"] {
  min-width: 78px;
  font-size: 13px;
}

.wcc-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.94);
}

.wcc-input-row input {
  flex: 1;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  background: #fff;
}

.wcc-input-row input:focus {
  outline: 2px solid rgba(13, 148, 136, 0.24);
  border-color: var(--wcc-primary);
}

.wcc-input-row button {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--wcc-primary), var(--wcc-primary-strong));
  cursor: pointer;
}

.wcc-input-row .wcc-input-tool {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 11px;
  background: #fff;
  color: #0f172a;
  font-size: 17px;
  line-height: 1;
  box-shadow: none;
}

.wcc-input-row .wcc-input-tool:hover {
  border-color: rgba(13, 148, 136, 0.42);
  color: var(--wcc-primary);
}

.wcc-input-row .wcc-input-tool.is-active {
  border-color: rgba(13, 148, 136, 0.5);
  color: var(--wcc-primary);
  background: rgba(13, 148, 136, 0.08);
}

.wcc-input-row .wcc-input-tool.is-uploading {
  opacity: 0.6;
  cursor: progress;
}

.wcc-emoji-panel {
  --wcc-emoji-size: 32px;
  --wcc-emoji-gap: 6px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--wcc-emoji-size), 1fr));
  align-content: start;
  gap: var(--wcc-emoji-gap);
  height: calc((var(--wcc-emoji-size) * 3) + (var(--wcc-emoji-gap) * 2) + 18px);
  max-height: calc((var(--wcc-emoji-size) * 3) + (var(--wcc-emoji-gap) * 2) + 18px);
  overflow-y: auto;
  padding: 10px 12px 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.95);
}

.wcc-emoji-panel[hidden] {
  display: none !important;
}

.wcc-emoji-panel::-webkit-scrollbar {
  width: 8px;
}

.wcc-emoji-panel::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.44);
  border-radius: 999px;
}

.wcc-emoji-btn {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 9px;
  width: var(--wcc-emoji-size);
  height: var(--wcc-emoji-size);
  padding: 0;
  font-size: 18px;
  line-height: 1;
  background: #fff;
  cursor: pointer;
}

.wcc-emoji-btn:hover {
  border-color: rgba(13, 148, 136, 0.4);
  transform: translateY(-1px);
}

.wcc-attachment-preview {
  padding: 8px 12px 0;
}

.wcc-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 11px;
  border: 1px solid rgba(13, 148, 136, 0.22);
  background: rgba(13, 148, 136, 0.1);
  color: #0f172a;
}

.wcc-attachment-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
}

.wcc-attachment-remove {
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.wcc-input-row.is-lead-mode input {
  min-width: 0;
}

.wcc-input-row.is-lead-mode .wcc-input-tool {
  display: none;
}

.wcc-input-row.is-lead-mode button {
  min-width: 44px;
  height: 42px;
  padding: 0 12px;
  font-size: 22px;
  line-height: 1;
}

.wcc-input-row.is-lead-mode button.is-lead-final {
  min-width: 86px;
  font-size: 13px;
  font-weight: 700;
}

.wcc-anim-pulse .wcc-launcher {
  animation: wccLauncherPulse 2.4s ease-in-out infinite;
}

.wcc-anim-float .wcc-launcher {
  animation: wccLauncherFloat 2.6s ease-in-out infinite;
}

.wcc-anim-bounce .wcc-launcher {
  animation: wccLauncherBounce 2.2s ease-in-out infinite;
}

.wcc-anim-swing .wcc-launcher {
  transform-origin: center top;
  animation: wccLauncherSwing 2.6s ease-in-out infinite;
}

.wcc-anim-glow .wcc-launcher {
  animation: wccLauncherGlow 2.4s ease-in-out infinite;
}

.wcc-anim-wobble .wcc-launcher {
  animation: wccLauncherWobble 2.1s ease-in-out infinite;
}

@keyframes wccLauncherPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes wccLauncherFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes wccLauncherBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-6px);
  }
  50% {
    transform: translateY(0);
  }
  75% {
    transform: translateY(-3px);
  }
}

@keyframes wccLauncherSwing {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(7deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(-7deg);
  }
}

@keyframes wccLauncherGlow {
  0%,
  100% {
    box-shadow: var(--wcc-shadow);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(13, 148, 136, 0.18), 0 24px 56px rgba(2, 6, 23, 0.24);
  }
}

@keyframes wccLauncherWobble {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  20% {
    transform: translateX(-2px) rotate(-5deg);
  }
  40% {
    transform: translateX(2px) rotate(5deg);
  }
  60% {
    transform: translateX(-1px) rotate(-3deg);
  }
  80% {
    transform: translateX(1px) rotate(3deg);
  }
}

@keyframes wccWindowIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes wccMessageIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wccPromptIn {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes wccCaretBlink {
  0%,
  45% {
    opacity: 1;
  }
  46%,
  100% {
    opacity: 0;
  }
}

@keyframes wccRingSpin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (max-width: 768px) {
  .wcc-floating-mode {
    right: 12px;
    bottom: 12px;
  }

  .wcc-floating-mode.wcc-has-launcher-ring {
    right: calc(12px + ((var(--wcc-launcher-ring-size) - var(--wcc-launcher-size)) / 2));
    bottom: calc(12px + ((var(--wcc-launcher-ring-size) - var(--wcc-launcher-size)) / 2));
  }

  .wcc-launcher-helper-text {
    font-size: 7.4px;
    letter-spacing: 0.9px;
  }

  .wcc-window {
    height: min(78vh, 620px);
    border-radius: 20px;
  }

  .wcc-inline-mode .wcc-window {
    height: min(82vh, 640px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wcc-launcher,
  .wcc-launcher-helper-ring,
  .wcc-window.is-open,
  .wcc-message-row,
  .wcc-prompt,
  .wcc-bubble.is-streaming::after {
    animation: none !important;
  }
}
