/* ===========================================================================
   Launchup chat widget
   Floating support chat. Reuses the site's theme variables (--orange, --card,
   --border, --text, --muted, --ghost-bg) so it follows dark/light mode for free.
   Everything is prefixed with .lu- so it can't clash with the rest of the site.
   =========================================================================== */

/* ---------- launcher bubble (bottom-right) ---------- */
.lu-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 1500;
  display: grid;
  place-items: center;
  color: #000;
  background: linear-gradient(135deg, var(--orange), var(--orange-soft));
  box-shadow: 0 8px 24px rgba(255, 122, 24, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.lu-launcher:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 30px rgba(255, 122, 24, 0.45); }
.lu-launcher svg { width: 28px; height: 28px; }
.lu-launcher .lu-icon-close { display: none; }
.lu-launcher.lu-open .lu-icon-open { display: none; }
.lu-launcher.lu-open .lu-icon-close { display: block; }

/* ---------- panel ---------- */
.lu-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius, 20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  /* hidden state */
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}
.lu-panel.lu-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ---------- header ---------- */
.lu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  color: #000;
  background: linear-gradient(135deg, var(--orange), var(--orange-soft));
}
.lu-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.85);
  flex-shrink: 0;
}
.lu-avatar img { width: 24px; height: 24px; object-fit: contain; }
.lu-htext { flex: 1; min-width: 0; }
.lu-htext h3 { font-family: 'Space Grotesk', sans-serif; font-size: 0.98rem; font-weight: 700; line-height: 1.2; margin: 0; }
.lu-status { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; opacity: 0.8; margin-top: 2px; }
.lu-status::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
  animation: lu-pulse 2s infinite;
}
@keyframes lu-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.lu-close {
  background: rgba(0, 0, 0, 0.15);
  border: none;
  color: #000;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.lu-close:hover { background: rgba(0, 0, 0, 0.3); }

/* ---------- messages ---------- */
.lu-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-soft);
}
.lu-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.lu-msg.lu-bot {
  align-self: flex-start;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.lu-msg.lu-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--orange), var(--orange-soft));
  color: #000;
  border-bottom-right-radius: 4px;
}

/* typing dots */
.lu-typing { display: flex; gap: 4px; align-items: center; }
.lu-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: lu-bounce 1.2s infinite ease-in-out;
}
.lu-typing span:nth-child(2) { animation-delay: 0.15s; }
.lu-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes lu-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ---------- input ---------- */
.lu-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.lu-input input {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--ghost-bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.lu-input input::placeholder { color: var(--muted); }
.lu-input input:focus { border-color: var(--orange); }
.lu-send {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #000;
  background: linear-gradient(135deg, var(--orange), var(--orange-soft));
  transition: transform 0.2s, opacity 0.2s;
}
.lu-send:hover { transform: scale(1.08); }
.lu-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.lu-send svg { width: 18px; height: 18px; }

/* mobile: full-width panel */
@media (max-width: 480px) {
  .lu-panel {
    right: 12px;
    left: 12px;
    bottom: 90px;
    width: auto;
    height: 70vh;
  }
  .lu-launcher { bottom: 16px; right: 16px; }
}
