:root {
  --numexa-bg: linear-gradient(135deg, #5b7cfa 0%, #7c4dff 100%);
  --numexa-panel-bg: rgba(255, 255, 255, 0.88);
  --numexa-panel-border: rgba(255, 255, 255, 0.45);
  --numexa-text: #1e293b;
  --numexa-muted: #64748b;
  --numexa-user-bubble: linear-gradient(135deg, #6d8bff 0%, #6c5ce7 100%);
  --numexa-bot-bubble: #f2f5ff;
  --numexa-shadow: 0 16px 40px rgba(69, 84, 184, 0.25);
  --numexa-radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --numexa-panel-bg: rgba(18, 24, 46, 0.82);
    --numexa-panel-border: rgba(139, 158, 255, 0.22);
    --numexa-text: #e5ecff;
    --numexa-muted: #a8b3d9;
    --numexa-bot-bubble: rgba(105, 124, 224, 0.2);
    --numexa-shadow: 0 22px 48px rgba(3, 8, 29, 0.6);
  }
}

* {
  box-sizing: border-box;
}

.demo-shell {
  min-height: 100vh;
  padding: 2rem;
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  color: #1e293b;
  background: radial-gradient(circle at top, #f3f6ff 0%, #ebf0ff 45%, #dde7ff 100%);
}

.demo-shell code {
  background: rgba(30, 41, 59, 0.08);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
}

.numexa-chatbot-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--numexa-text);
}

.numexa-toggle-btn {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 0;
  background: var(--numexa-bg);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--numexa-shadow);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.3s ease, filter 0.3s ease;
  position: relative;
  isolation: isolate;
}

.numexa-toggle-btn::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(141, 164, 255, 0.45), rgba(197, 156, 255, 0.45));
  z-index: -1;
  animation: numexaOrbit 2.8s ease-in-out infinite;
}

.numexa-toggle-btn::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  right: 12px;
  top: 10px;
  border-radius: 50%;
  background: #9dffcb;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 5px rgba(118, 255, 190, 0.2);
}

.numexa-toggle-btn:hover {
  transform: translateY(-3px) scale(1.02);
  filter: saturate(1.08);
}

.numexa-toggle-btn:active {
  transform: scale(0.96);
}

.numexa-toggle-icon {
  font-size: 1.52rem;
}

.numexa-toggle-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.24);
}

.numexa-launch-tip {
  position: absolute;
  right: 78px;
  bottom: 16px;
  background: rgba(14, 22, 47, 0.92);
  color: #fff;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 14px 24px rgba(6, 10, 30, 0.32);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  white-space: nowrap;
}

.numexa-launch-tip::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  background: rgba(14, 22, 47, 0.92);
  transform: translateY(-50%) rotate(45deg);
}

.numexa-launch-tip.show {
  opacity: 1;
  transform: translateY(0);
}

.numexa-chat-window {
  position: absolute;
  right: 0;
  bottom: 84px;
  width: min(360px, calc(100vw - 24px));
  height: min(540px, calc(100vh - 120px));
  min-height: 440px;
  border-radius: 24px;
  background: var(--numexa-panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--numexa-panel-border);
  box-shadow: var(--numexa-shadow);
  overflow: hidden;
  transform-origin: bottom right;
  transform: translateY(20px) scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.26s ease, opacity 0.26s ease;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.numexa-chat-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.numexa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(145deg, rgba(96, 117, 250, 0.92), rgba(123, 83, 243, 0.9));
  color: #fff;
}

.numexa-header-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.numexa-name {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.numexa-status {
  font-size: 0.78rem;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 6px;
}

.numexa-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3cff95;
  box-shadow: 0 0 0 6px rgba(60, 255, 149, 0.15);
}

.numexa-control-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1.15rem;
}

.numexa-messages {
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
}

.numexa-msg {
  max-width: 85%;
  border-radius: var(--numexa-radius);
  padding: 10px 13px;
  line-height: 1.4;
  font-size: 0.92rem;
  word-break: break-word;
}

.numexa-msg.bot {
  background: var(--numexa-bot-bubble);
  color: var(--numexa-text);
  align-self: flex-start;
  border-top-left-radius: 6px;
}

.numexa-msg.user {
  background: var(--numexa-user-bubble);
  color: #fff;
  align-self: flex-end;
  border-top-right-radius: 6px;
}

.numexa-msg a {
  color: inherit;
  text-decoration: none;
}

.numexa-rich-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.numexa-rich-card {
  border: 1px solid rgba(109, 129, 255, 0.34);
  background: linear-gradient(135deg, rgba(117, 137, 255, 0.16), rgba(144, 112, 255, 0.14));
  border-radius: 16px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  box-shadow: 0 10px 20px rgba(77, 91, 186, 0.16);
}

.numexa-rich-card strong {
  font-size: 0.88rem;
  letter-spacing: 0.1px;
  width: 100%;
}

.numexa-rich-card-link {
  text-decoration: none;
  color: var(--numexa-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.numexa-rich-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(77, 92, 189, 0.28);
  border-color: rgba(124, 143, 255, 0.62);
}

.numexa-show-more {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  text-decoration: none;
}

.numexa-social-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
}

.numexa-social-card {
  text-decoration: none;
  color: var(--numexa-text);
  border: 1px solid rgba(120, 136, 225, 0.28);
  background: rgba(112, 132, 245, 0.09);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.numexa-social-card,
.numexa-social-card:hover,
.numexa-social-card:focus,
.numexa-rich-card-link,
.numexa-rich-card-link:hover,
.numexa-rich-card-link:focus {
  text-decoration: none !important;
}

.numexa-social-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
}

.numexa-social-icon.whatsapp { background: #25d366; }
.numexa-social-icon.telegram { background: #27a7e7; }
.numexa-social-icon.instagram { background: linear-gradient(140deg, #f58529, #dd2a7b, #8134af); }
.numexa-social-icon.website { background: #4f6bff; }
.numexa-social-icon.youtube { background: #ff2222; }

.numexa-social-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.numexa-social-meta strong {
  font-size: 0.81rem;
}

.numexa-social-meta span {
  font-size: 0.7rem;
  color: var(--numexa-muted);
}

.numexa-social-card.icon-only {
  justify-content: center;
  padding: 12px;
}

.numexa-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px;
}

.numexa-quick-btn {
  border: 1px solid rgba(103, 122, 241, 0.35);
  background: rgba(109, 139, 255, 0.14);
  color: var(--numexa-text);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.77rem;
  cursor: pointer;
}

.numexa-input-wrap {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.numexa-input {
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.6);
  color: var(--numexa-text);
}

.numexa-send-btn {
  border: 0;
  border-radius: 12px;
  background: var(--numexa-bg);
  color: #fff;
  font-weight: 600;
  padding: 0 14px;
  cursor: pointer;
}

.numexa-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.numexa-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8ca1ff;
  animation: numexaPulse 1.1s infinite ease-in-out;
}

.numexa-typing span:nth-child(2) { animation-delay: 0.12s; }
.numexa-typing span:nth-child(3) { animation-delay: 0.24s; }

@keyframes numexaPulse {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@keyframes numexaOrbit {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 0.45; }
}

@media (max-width: 600px) {
  .numexa-chatbot-root {
    right: 12px;
    bottom: 12px;
  }

  .numexa-chat-window {
    width: min(100vw - 16px, 390px);
    height: min(72vh, 540px);
    min-height: 400px;
    right: -2px;
    bottom: 72px;
    border-radius: 18px;
  }

  .numexa-toggle-btn {
    width: 58px;
    height: 58px;
  }

  .numexa-launch-tip {
    right: 68px;
    bottom: 10px;
    font-size: 0.75rem;
    padding: 8px 10px;
  }
}
