/* LiteBot (@n8n/chat) overrides, in LiteMind navy + orange. Loaded after the widget's own stylesheet. */

:root {
  --chat--color--primary: #ee6c2a !important;
  --chat--color--secondary: #22225a !important;
  --chat--window--border-radius: 16px !important;
  --chat--window--background: #0b0b24 !important;
}

/* Window */
.chat-window {
  background-color: #0b0b24 !important;
  border: 1px solid rgba(238, 108, 42, 0.3) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45) !important;
  animation: litebot-window-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}

@keyframes litebot-window-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.chat-body {
  background-color: #0b0b24 !important;
}

.chat-header {
  background-color: #13133a !important;
  border-bottom: 1px solid rgba(238, 108, 42, 0.3) !important;
  padding: 12px 20px !important;
}

.chat-header h1 {
  color: #ffffff !important;
  margin-bottom: 2px !important;
}

.chat-header p {
  color: #f7a06f !important;
  margin: 0 !important;
  line-height: 1.2 !important;
  font-size: 0.85em !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

/* Online indicator */
.chat-header p::before {
  content: "" !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: #4ade80 !important;
  flex-shrink: 0 !important;
}

/* Messages */
.chat-message.chat-message-from-user:not(.chat-message-transparent) {
  background: #ee6c2a !important;
  color: #16163f !important;
  border: none !important;
}

.chat-message.chat-message-from-user .chat-message-markdown p {
  color: #16163f !important;
}

.chat-message.chat-message-from-bot:not(.chat-message-transparent) {
  background-color: #1c1c48 !important;
  color: #f1f2fa !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.chat-message.chat-message-from-bot .chat-message-markdown p {
  color: #f1f2fa !important;
}

/* Footer and input */
.chat-footer {
  background-color: #13133a !important;
  border-top: 1px solid rgba(238, 108, 42, 0.3) !important;
  padding-top: 8px !important;
  padding-bottom: 10px !important;
}

/* n8n's "Powered by n8n" notice stays readable and our own line sits above it.
   The @n8n/chat licence (Sustainable Use Licence v1.0) says: "You may not alter,
   remove, or obscure any licensing, copyright, or other notices of the licensor
   in the software." Do not hide this. */
.chat-get-started-footer {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
}

.chat-get-started-footer::before {
  content: "Powered by LiteMind Studio";
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #f7a06f;
}

.chat-powered-by {
  color: #9a9dbb !important;
  font-size: 11px !important;
}

.chat-powered-by a {
  color: #c3c5dc !important;
  text-decoration: underline !important;
}

.chat-input,
.chat-inputs {
  background-color: transparent !important;
  align-items: center !important;
  gap: 8px !important;
}

.chat-input textarea {
  background-color: #1c1c48 !important;
  color: #ffffff !important;
  border: 1px solid rgba(238, 108, 42, 0.3) !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  height: 45px !important;
  min-height: 45px !important;
  margin: 0 !important;
  scrollbar-width: none !important;
}

.chat-input textarea::-webkit-scrollbar {
  display: none !important;
}

.chat-input textarea::placeholder {
  color: #9a9dbb !important;
}

button.chat-input-send-button {
  background-color: #ee6c2a !important;
  color: #16163f !important;
  border-radius: 8px !important;
  height: 45px !important;
  width: 45px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
}

button.chat-input-send-button:disabled {
  background-color: #2a2a58 !important;
  color: #9a9dbb !important;
}

/* Launcher: "Ask LiteBot" pill */
.chat-window-toggle,
.n8n-chat-widget-toggle {
  position: relative !important;
  width: auto !important;
  min-width: 128px !important;
  height: 50px !important;
  padding: 0 16px 0 10px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  border-radius: 16px !important;
  background: #16163f !important;
  border: 1px solid rgba(238, 108, 42, 0.5) !important;
  box-shadow: 0 10px 24px rgba(11, 11, 36, 0.35) !important;
  overflow: hidden !important;
  transition: transform 0.2s ease, border-color 0.2s ease !important;
}

.chat-window-toggle:hover,
.n8n-chat-widget-toggle:hover {
  transform: translateY(-2px) !important;
  border-color: #ee6c2a !important;
}

.chat-window-toggle svg,
.chat-window-toggle img,
.n8n-chat-widget-toggle svg,
.n8n-chat-widget-toggle img {
  display: none !important;
}

.chat-window-toggle::before,
.n8n-chat-widget-toggle::before {
  content: "" !important;
  width: 22px !important;
  height: 22px !important;
  flex-shrink: 0 !important;
  background-color: #ee6c2a !important;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/></svg>") no-repeat center / contain !important;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/></svg>") no-repeat center / contain !important;
}

.chat-window-toggle::after,
.n8n-chat-widget-toggle::after {
  content: "Ask LiteBot" !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

@media (max-width: 480px) {
  .chat-window-toggle,
  .n8n-chat-widget-toggle {
    min-width: 112px !important;
    height: 46px !important;
    padding: 0 12px 0 9px !important;
  }

  .chat-window-toggle::after,
  .n8n-chat-widget-toggle::after {
    font-size: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-window,
  .chat-window-toggle,
  .n8n-chat-widget-toggle {
    animation: none !important;
    transition: none !important;
  }
}

/* --- Placeholder launcher -------------------------------------------------
   The @n8n/chat bundle is ~436 KB and calls the n8n webhook as soon as it runs,
   so js/site.js only fetches it when someone asks for the chat. Until then this
   button stands in for it, styled to match .chat-window-toggle above so the
   swap isn't visible. It starts hidden and site.js reveals it, so it is never
   a dead control when JavaScript is off. */
/* The launcher is pinned to the bottom-right corner, where it covered the last
   lines of the footer. This file only loads on pages that have the launcher, so
   the extra space only appears there. */
footer {
  padding-bottom: 4rem;
}

.litebot-launcher-wrapper {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
}

.litebot-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 128px;
  height: 50px;
  padding: 0 16px 0 10px;
  border-radius: 16px;
  border: 1px solid rgba(238, 108, 42, 0.5);
  background: #16163f;
  box-shadow: 0 10px 24px rgba(11, 11, 36, 0.35);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.litebot-launcher::before {
  content: "";
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  background-color: #ee6c2a;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/></svg>") no-repeat center / contain;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/></svg>") no-repeat center / contain;
}

.litebot-launcher:hover {
  transform: translateY(-2px);
  border-color: #ee6c2a;
}

.litebot-launcher[data-loading] {
  cursor: progress;
  opacity: 0.75;
}

@media (max-width: 480px) {
  .litebot-launcher {
    min-width: 112px;
    height: 46px;
    padding: 0 12px 0 9px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .litebot-launcher {
    transition: none;
  }

  .litebot-launcher:hover {
    transform: none;
  }
}
