/* LoonCart website chat widget styles.
   Site identity: navy #101827, lime #B9F36A.
   All selectors are scoped under .lc-chat-root so nothing leaks into the host page. */

.lc-chat-root {
  --lc-navy: #101827;
  --lc-lime: #B9F36A;
  --lc-ink: #1c2733;
  --lc-paper: #ffffff;
  --lc-soft: #f2f5f0;
  --lc-line: #d8dee4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--lc-ink);
}

.lc-chat-root *,
.lc-chat-root *::before,
.lc-chat-root *::after {
  box-sizing: border-box;
}

/* Floating bubble button */
.lc-chat-bubble {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--lc-navy);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 22px rgba(16, 24, 39, 0.35);
}

.lc-chat-bubble:hover,
.lc-chat-bubble:focus-visible {
  outline: 2px solid var(--lc-lime);
  outline-offset: 2px;
}

.lc-chat-bubble svg {
  display: block;
}

.lc-chat-bubble .lc-chat-bubble-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--lc-lime);
  border: 2px solid var(--lc-navy);
}

/* Panel */
.lc-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 99991;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(580px, calc(100vh - 120px));
  background: var(--lc-paper);
  border: 1px solid var(--lc-line);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(16, 24, 39, 0.30);
  overflow: hidden;
}

.lc-chat-panel[hidden] {
  display: none;
}

.lc-chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--lc-navy);
  color: #ffffff;
}

.lc-chat-title {
  font-size: 16px;
  font-weight: 700;
}

.lc-chat-title .lc-chat-ai-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--lc-lime);
  color: var(--lc-navy);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.lc-chat-subtitle {
  margin-top: 2px;
  font-size: 12.5px;
  color: #c9d4e2;
}

.lc-chat-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.lc-chat-close:hover,
.lc-chat-close:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

/* Messages */
.lc-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 14px 8px;
  background: var(--lc-soft);
}

.lc-chat-msg {
  max-width: 86%;
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 14px;
  white-space: normal;
  overflow-wrap: break-word;
}

.lc-chat-msg a {
  color: #0b5cad;
  text-decoration: underline;
}

.lc-chat-msg-assistant {
  margin-right: auto;
  background: #ffffff;
  border: 1px solid var(--lc-line);
  border-bottom-left-radius: 4px;
}

.lc-chat-msg-user {
  margin-left: auto;
  background: var(--lc-lime);
  color: var(--lc-navy);
  border-bottom-right-radius: 4px;
}

.lc-chat-msg-user a {
  color: var(--lc-navy);
}

.lc-chat-msg-error {
  background: #fdeeee;
  border: 1px solid #efc3c3;
}

.lc-chat-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 12px;
}

.lc-chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #93a3b5;
  animation: lc-chat-blink 1.2s infinite ease-in-out;
}

.lc-chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.lc-chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes lc-chat-blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

/* Team messages and system lines inside the message list */
.lc-chat-msg-team {
  margin-right: auto;
  background: #eef4e4;
  border: 1px solid var(--lc-lime);
  border-bottom-left-radius: 4px;
}

.lc-chat-team-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--lc-navy);
  margin-bottom: 2px;
}

.lc-chat-msg-system {
  max-width: 92%;
  margin: 0 auto 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #e6ebef;
  color: #42536a;
  font-size: 12.5px;
  text-align: center;
}

/* Actions row: Ask the team, copy conversation link */
.lc-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px 0;
  background: #ffffff;
}

.lc-chat-action {
  padding: 7px 12px;
  border: 1px solid var(--lc-navy);
  border-radius: 999px;
  background: #ffffff;
  color: var(--lc-navy);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.lc-chat-action:hover,
.lc-chat-action:focus-visible {
  background: var(--lc-lime);
  outline: none;
}

.lc-chat-action:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Note under the messages */
.lc-chat-note {
  padding: 8px 14px;
  border-top: 1px solid var(--lc-line);
  background: #ffffff;
  font-size: 12px;
  color: #5a6a7a;
}

.lc-chat-note a {
  color: #0b5cad;
}

/* Composer */
.lc-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--lc-line);
  background: #ffffff;
}

.lc-chat-input {
  flex: 1 1 auto;
  min-height: 42px;
  max-height: 110px;
  padding: 10px 12px;
  border: 1px solid var(--lc-line);
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}

.lc-chat-input:focus {
  outline: 2px solid var(--lc-lime);
  outline-offset: 0;
  border-color: var(--lc-navy);
}

.lc-chat-send {
  flex: 0 0 auto;
  align-self: flex-end;
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  background: var(--lc-navy);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lc-chat-send:hover,
.lc-chat-send:focus-visible {
  outline: 2px solid var(--lc-lime);
  outline-offset: 1px;
}

.lc-chat-send:disabled,
.lc-chat-input:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 480px) {
  .lc-chat-panel {
    right: 8px;
    bottom: 76px;
    width: calc(100vw - 16px);
    height: calc(100vh - 140px);
  }

  .lc-chat-bubble {
    right: 12px;
    bottom: 12px;
  }
}
