/* ============================================================
   HELIXAI CHATBOT — Helix Bio
   ============================================================ */

:root {
  --helix-navy: #0A2540;
  --helix-teal: #1A8C8C;
  --helix-gold: #C9A84C;
  --helix-white: #FFFFFF;
  --helix-bg-dark: rgba(10, 37, 64, 0.92);
  --helix-panel: rgba(11, 28, 48, 0.88);
  --helix-panel-2: rgba(17, 41, 66, 0.82);
  --helix-border: rgba(201, 168, 76, 0.24);
  --helix-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --helix-radius-xl: 22px;
  --helix-radius-lg: 18px;
  --helix-radius-md: 14px;
}

/* ── TEMPORARILY DISABLED — developer to re-enable by removing display:none ── */
#helixai-root,
#helixai-bubble,
#helixai-panel {
  display: none !important;
}

#helixai-root,
#helixai-root * {
  box-sizing: border-box;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
}

#helixai-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99998;
}

/* ---- Bubble ---- */
.helixai-bubble {
  width: 68px;
  height: 68px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: var(--helix-white);
  background: linear-gradient(145deg, rgba(26,140,140,0.95), rgba(10,37,64,0.98));
  box-shadow:
    0 12px 30px rgba(10,37,64,0.35),
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 0 0 3px rgba(201,168,76,0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
  position: relative;
  overflow: hidden;
}

.helixai-bubble::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.18), transparent 40%);
  pointer-events: none;
}

.helixai-bubble:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 18px 36px rgba(10,37,64,0.42),
    0 0 0 1px rgba(255,255,255,0.10) inset,
    0 0 0 4px rgba(201,168,76,0.20);
}

.helixai-bubble svg {
  width: 28px;
  height: 28px;
  position: relative;
  z-index: 2;
}

.helixai-pulse {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(201,168,76,0.45);
  animation: helixPulse 2.2s infinite;
  pointer-events: none;
}

@keyframes helixPulse {
  0%   { transform: scale(1);    opacity: 0.9; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* ---- Unread badge ---- */
.helixai-unread {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e53e3e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  z-index: 3;
}

/* ---- Panel ---- */
.helixai-panel {
  position: absolute;
  right: 0;
  bottom: 84px;
  width: min(420px, calc(100vw - 24px));
  height: min(680px, calc(100vh - 110px));
  background: linear-gradient(180deg, rgba(17,41,66,0.96), rgba(8,23,40,0.96));
  border: 1px solid var(--helix-border);
  border-radius: var(--helix-radius-xl);
  box-shadow: var(--helix-shadow);
  overflow: hidden;
  transform-origin: bottom right;
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.24s ease, opacity 0.24s ease;
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
}

.helixai-panel.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* ---- Header ---- */
.helixai-header {
  position: relative;
  padding: 18px 18px 16px;
  background:
    radial-gradient(circle at top left, rgba(26,140,140,0.24), transparent 35%),
    linear-gradient(135deg, rgba(10,37,64,0.98), rgba(26,140,140,0.70));
  border-bottom: 1px solid rgba(201,168,76,0.16);
  flex-shrink: 0;
}

.helixai-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.helixai-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.helixai-brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--helix-white);
  background: linear-gradient(145deg, rgba(26,140,140,0.95), rgba(10,37,64,1));
  box-shadow: 0 8px 20px rgba(0,0,0,0.20), inset 0 1px 0 rgba(255,255,255,0.10);
  flex-shrink: 0;
}

.helixai-brand-badge img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.helixai-title {
  color: var(--helix-white);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

.helixai-subtitle {
  color: rgba(255,255,255,0.78);
  font-size: 0.82rem;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.helixai-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #48bb78;
  display: inline-block;
  box-shadow: 0 0 6px rgba(72,187,120,0.6);
}

.helixai-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--helix-white);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.helixai-close:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.helixai-disclaimer {
  margin-top: 14px;
  padding: 10px 13px;
  border-radius: 12px;
  color: rgba(255,255,255,0.88);
  font-size: 0.78rem;
  line-height: 1.45;
  background: rgba(201,168,76,0.10);
  border: 1px solid rgba(201,168,76,0.22);
}

/* ---- Body ---- */
.helixai-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 0%, rgba(26,140,140,0.08), transparent 28%),
    linear-gradient(180deg, rgba(8,23,40,0.70), rgba(5,14,28,0.90));
}

/* ---- Messages ---- */
.helixai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.helixai-messages::-webkit-scrollbar { width: 4px; }
.helixai-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.10);
  border-radius: 999px;
}

.helixai-row {
  display: flex;
  width: 100%;
  align-items: flex-end;
  gap: 8px;
}

.helixai-row.user      { justify-content: flex-end; }
.helixai-row.assistant,
.helixai-row.system    { justify-content: flex-start; }

.helixai-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--helix-teal), var(--helix-navy));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}

.helixai-message {
  max-width: 80%;
  padding: 12px 15px;
  border-radius: 18px;
  line-height: 1.55;
  font-size: 0.9rem;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.helixai-row.assistant .helixai-message,
.helixai-row.system    .helixai-message {
  color: rgba(255,255,255,0.94);
  background: linear-gradient(180deg, rgba(17,41,66,0.92), rgba(10,28,46,0.95));
  border: 1px solid rgba(255,255,255,0.06);
  border-bottom-left-radius: 6px;
}

.helixai-row.user .helixai-message {
  color: var(--helix-white);
  background: linear-gradient(180deg, rgba(26,140,140,0.95), rgba(16,105,105,0.96));
  border: 1px solid rgba(255,255,255,0.10);
  border-bottom-right-radius: 6px;
  box-shadow: 0 6px 18px rgba(26,140,140,0.18);
}

.helixai-row.system .helixai-message {
  background: linear-gradient(180deg, rgba(201,168,76,0.16), rgba(201,168,76,0.10));
  border-color: rgba(201,168,76,0.20);
  color: rgba(255,255,255,0.92);
  font-size: 0.82rem;
}

/* ---- Typing indicator ---- */
.helixai-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
}

.helixai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  animation: helixBounce 1.2s infinite ease-in-out;
}

.helixai-dot:nth-child(2) { animation-delay: 0.15s; }
.helixai-dot:nth-child(3) { animation-delay: 0.30s; }

@keyframes helixBounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
  40%            { transform: scale(1.2); opacity: 1;   }
}

/* ---- Input area ---- */
.helixai-input-wrap {
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(7,18,31,0.86);
  flex-shrink: 0;
}

.helixai-input-shell {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(201,168,76,0.18);
  background: rgba(255,255,255,0.04);
  transition: border-color 0.2s;
}

.helixai-input-shell:focus-within {
  border-color: rgba(26,140,140,0.5);
}

.helixai-textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--helix-white);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 6px 8px;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
}

.helixai-textarea::placeholder { color: rgba(255,255,255,0.38); }

.helixai-send {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: var(--helix-white);
  background: linear-gradient(145deg, var(--helix-teal), var(--helix-navy));
  box-shadow: 0 6px 18px rgba(10,37,64,0.24);
  transition: transform 0.2s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.helixai-send:hover:not(:disabled) { transform: translateY(-1px); }
.helixai-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.helixai-footnote {
  margin-top: 8px;
  color: rgba(255,255,255,0.38);
  font-size: 0.68rem;
  text-align: center;
}

/* ---- Contact capture form ---- */
.helixai-lead {
  margin: 0 16px 16px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17,41,66,0.94), rgba(10,28,46,0.96));
  border: 1px solid rgba(201,168,76,0.18);
  flex-shrink: 0;
}

.helixai-lead-title {
  color: var(--helix-white);
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.helixai-lead-text {
  color: rgba(255,255,255,0.65);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.helixai-field {
  width: 100%;
  margin-bottom: 8px;
}

.helixai-field input,
.helixai-field textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: var(--helix-white);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  font-size: 0.86rem;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  transition: border-color 0.2s;
}

.helixai-field input:focus,
.helixai-field textarea:focus {
  border-color: rgba(26,140,140,0.5);
}

.helixai-field textarea { resize: vertical; min-height: 72px; }

.helixai-field input::placeholder,
.helixai-field textarea::placeholder { color: rgba(255,255,255,0.35); }

.helixai-submit {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  color: #1a1a1a;
  background: linear-gradient(145deg, var(--helix-gold), #af8f3c);
  transition: transform 0.2s ease, opacity 0.2s ease;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
}

.helixai-submit:hover:not(:disabled) { transform: translateY(-1px); }
.helixai-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.helixai-status {
  margin-top: 8px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  text-align: center;
}

.helixai-hidden { display: none !important; }

/* ---- Quick reply chips ---- */
.helixai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 18px 14px;
}

.helixai-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(26,140,140,0.35);
  background: rgba(26,140,140,0.08);
  color: rgba(255,255,255,0.82);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
}

.helixai-chip:hover {
  background: rgba(26,140,140,0.22);
  border-color: rgba(26,140,140,0.6);
  color: #fff;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  #helixai-root { right: 14px; bottom: 14px; }

  .helixai-bubble { width: 60px; height: 60px; }

  .helixai-panel {
    right: -2px;
    bottom: 76px;
    width: calc(100vw - 20px);
    height: min(80vh, 680px);
    border-radius: 20px;
  }

  .helixai-message { max-width: 88%; }
}
