/* LuxeTool + SmartAdmin coexistence */

html[data-bs-theme="dark"] {
  color-scheme: dark;
}

body.luxetool-sa {
  min-height: 100%;
  margin: 0;
}

/* Native scroll: slimscroll.js is not loaded; unlock .custom-scroll */
body.luxetool-sa.no-slimscroll .custom-scroll,
body.luxetool-sa .custom-scroll {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Pin app chrome to the viewport so panes scroll internally */
body.luxetool-sa:has(.app-wrap) {
  height: 100%;
  overflow: hidden;
}

body.luxetool-sa .app-wrap {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body.luxetool-sa .app-body {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.luxetool-sa .app-content {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Left sidebar: logo fixed, nav scrolls independently */
body.luxetool-sa .app-sidebar {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
}

body.luxetool-sa .app-sidebar > .app-logo {
  flex-shrink: 0;
}

body.luxetool-sa .app-sidebar .primary-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.app-sidebar .nav-menu img.luxetool-nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  flex-shrink: 0;
}

.app-sidebar .nav-menu img.luxetool-nav-icon-lg {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.55rem;
}

.app-sidebar .nav-menu a.luxetool-nav-model {
  align-items: flex-start;
  gap: 0.65rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.app-sidebar .nav-menu button.luxetool-nav-show-more {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0;
  border: none;
  background: transparent;
  color: var(--app-nav-link-color);
  font-size: 0.9375rem;
  font-weight: var(--app-nav-parent-fw, 600);
  line-height: 2;
  text-align: left;
  cursor: pointer;
}

.app-sidebar .nav-menu button.luxetool-nav-show-more:hover {
  color: var(--app-nav-link-hover-color);
}

.app-sidebar .nav-menu .luxetool-nav-model-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
  white-space: normal;
  line-height: 1.25;
}

.app-sidebar .nav-menu .luxetool-nav-model-name {
  display: block;
  font-weight: 600;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.app-sidebar .nav-menu .luxetool-nav-model-desc {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.72;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.35;
}

/* Minified sidebar: keep large icons visible; hide text as usual */
.set-nav-minified:not(.set-nav-collapsed) .app-sidebar:not(:hover)
  .primary-nav
  ul
  li
  a.luxetool-nav-model
  .luxetool-nav-model-text {
  opacity: 0;
}


.app-content.luxetool-workspace,
.app-content:has(.luxetool-chat) {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.app-content .luxetool-workspace,
.app-content .luxetool-chat {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.luxetool-chat.main-content,
.luxetool-chat .main-content.layout-trimmed {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.luxetool-chat .layout-trimmed > .d-flex {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

/* Conversation column + msgr height chain */
.luxetool-chat .luxetool-chat-column {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: 100%;
  max-height: 100%;
}

.luxetool-chat .luxetool-msgr-host {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.luxetool-chat .msgr {
  min-height: 0;
}

.luxetool-chat .luxetool-msgr-scroll {
  flex: 1 1 auto;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Message pane: body bg only — kill SmartAdmin primary/lavender wash */
.luxetool-chat .luxetool-msgr-scroll,
.luxetool-chat .luxetool-msgr-scroll.bg-subtlelight-fade {
  background-color: var(--bs-body-bg, #212529) !important;
  background-image: none !important;
}

/*
 * Composer / prompt strip — dedicated class (not fragile .msgr > .border).
 * Dark-theme neutral Bootstrap grays only (no primary purple / lavender).
 * Previous #e6e4eb / #e9ecef light bands still read as “light lavender”.
 */
.luxetool-chat .luxetool-composer-bar,
.luxetool-chat .msgr > .border.flex-shrink-0,
.luxetool-chat .msgr > .luxetool-composer-bar {
  background-color: #343a40 !important; /* bs-gray-800 / secondary-bg */
  background-image: none !important;
  border-color: #495057 !important; /* bs-gray-700 */
}

.luxetool-chat .luxetool-composer-bar .luxetool-composer-inner,
.luxetool-chat .luxetool-composer-bar > .p-3 {
  background-color: transparent !important;
  background-image: none !important;
}

.luxetool-chat .luxetool-chat-composer.form-control,
.luxetool-chat textarea.luxetool-chat-composer {
  background-color: #2b3035 !important; /* bs-tertiary-bg */
  background-image: none !important;
  border-color: #6c757d !important; /* bs-gray-600 — no #886ab5 */
  color: #f8f9fa !important; /* bs-gray-100 */
  caret-color: #f8f9fa;
}

.luxetool-chat .luxetool-chat-composer.form-control::placeholder,
.luxetool-chat textarea.luxetool-chat-composer::placeholder {
  color: #adb5bd !important; /* bs-gray-500 */
  opacity: 1;
}

.luxetool-chat .luxetool-chat-composer.form-control:focus,
.luxetool-chat textarea.luxetool-chat-composer:focus {
  background-color: #343a40 !important;
  background-image: none !important;
  border-color: #adb5bd !important; /* bs-gray-500 — never primary-500 */
  box-shadow: 0 0 0 0.25rem rgba(173, 181, 189, 0.22) !important;
  color: #f8f9fa !important;
}

.luxetool-chat .luxetool-msgr-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--bs-body-bg-rgb), 0.72);
  pointer-events: none;
}

body.app-landing .navbar-brand img,
body.luxetool-auth .navbar-brand img {
  height: 28px;
  width: auto;
}

.hero-section {
  min-height: 100vh;
}

.app-wrap a {
  text-decoration: none;
}

/* SmartAdmin messenger (messenger.html) — chat / generate workspace */
.luxetool-chat .luxetool-chat-fade {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

/* Keep content visible while loading — never flash to blank white */
.luxetool-chat .luxetool-chat-fade-hidden {
  opacity: 0.4;
  transform: translateY(4px);
  pointer-events: none;
}

.luxetool-chat .luxetool-chat-composer {
  min-height: 4.125rem;
  resize: vertical;
  max-height: min(50vh, 22rem);
}

/*
 * Shared prompt toolbar chips (translate / copy / clear).
 * Mirrors PromptComposer.module.css so chat theme + Bootstrap button
 * reboot cannot diverge from Split Test / templates.
 */
.luxetool-prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.luxetool-prompt-toolbar-btn {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  margin: 0 !important;
  border: 1px solid #6c757d !important;
  background: rgba(108, 117, 125, 0.18) !important;
  color: #dee2e6 !important;
  font-family: inherit !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-decoration: none !important;
  padding: 0.32rem 0.7rem !important;
  min-height: 1.9rem !important;
  border-radius: 0.35rem !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  vertical-align: middle !important;
}

.luxetool-prompt-toolbar-btn:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
}

.luxetool-prompt-toolbar-btn:hover:not(:disabled) {
  border-color: #adb5bd !important;
  color: #f8f9fa !important;
  background: rgba(173, 181, 189, 0.22) !important;
}

.luxetool-prompt-toolbar-translate {
  color: var(--bs-success, #198754) !important;
  border-color: var(--bs-success, #198754) !important;
  background: rgba(25, 135, 84, 0.16) !important;
}

.luxetool-prompt-toolbar-translate:hover:not(:disabled) {
  color: #75b798 !important;
  border-color: #75b798 !important;
  background: rgba(25, 135, 84, 0.28) !important;
}

.luxetool-prompt-toolbar-copy {
  color: #ced4da !important;
  border-color: #6c757d !important;
  background: rgba(108, 117, 125, 0.18) !important;
}

.luxetool-prompt-toolbar-copy:hover:not(:disabled) {
  color: #f8f9fa !important;
  border-color: #adb5bd !important;
  background: rgba(173, 181, 189, 0.22) !important;
}

.luxetool-prompt-toolbar-copy-done {
  color: var(--bs-success, #198754) !important;
  border-color: var(--bs-success, #198754) !important;
  background: rgba(25, 135, 84, 0.16) !important;
}

.luxetool-prompt-toolbar-clear {
  margin-left: auto !important;
  color: #dc3545 !important;
  border-color: #dc3545 !important;
  background: rgba(220, 53, 69, 0.14) !important;
}

.luxetool-prompt-toolbar-clear:hover:not(:disabled) {
  color: #ea868f !important;
  border-color: #ea868f !important;
  background: rgba(220, 53, 69, 0.26) !important;
}

.luxetool-chat .chat-segment-get .chat-message.luxetool-chat-message-rich {
  display: block;
  max-width: min(100%, 40rem);
  text-align: left;
}

.luxetool-msg-body {
  font-size: 0.925rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.luxetool-msg-body > .paragraph + .paragraph,
.luxetool-msg-body > * + * {
  margin-top: 0.5rem;
}

.luxetool-msg-user a {
  color: inherit;
  text-decoration: underline;
}

.luxetool-user-prompt-msg {
  padding-right: 1.75rem;
  /* Bubble unclipped; prompt text scrolls inside child blocks (not the whole bubble) */
  max-height: none;
  overflow: visible;
}

.luxetool-user-prompt-msg > .luxetool-msg-body,
.luxetool-user-prompt-msg > p {
  max-height: calc(1.4em * 10);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.luxetool-prompt-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1;
  text-decoration: none !important;
  color: rgba(255, 255, 255, 0.82) !important;
  border-radius: 0.25rem;
  transition:
    color 0.15s ease,
    background-color 0.15s ease;
}

.luxetool-prompt-copy .sa-icon {
  color: currentColor;
}

.luxetool-user-prompt-msg:hover .luxetool-prompt-copy,
.luxetool-prompt-copy:hover,
.luxetool-prompt-copy:focus-visible {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.14);
}

.luxetool-prompt-copy-done {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.18);
}

.luxetool-prompt-copy-float {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 1;
  margin: 0;
  padding: 0.15rem 0.25rem;
}

.luxetool-prompt-copy-label {
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
  color: currentColor;
}

.luxetool-prompt-copy-done .sa-icon {
  color: currentColor;
}

.luxetool-msg-code {
  margin: 0.5rem 0 0.25rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(var(--bs-body-color-rgb), 0.12);
  background: rgba(var(--bs-body-color-rgb), 0.04);
}

.luxetool-msg-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-bottom: 1px solid rgba(var(--bs-body-color-rgb), 0.1);
  font-size: 0.7rem;
}

.luxetool-msg-pre {
  margin: 0;
  padding: 0.75rem 0.85rem;
  overflow-x: auto;
  max-height: 26rem;
  font-size: 0.8rem;
  line-height: 1.55;
}

.luxetool-media-card {
  max-width: min(100%, 32rem);
  margin: 0.35rem 0;
}

.luxetool-media-stage {
  min-height: 8rem;
  background: rgba(var(--bs-body-color-rgb), 0.06);
}

.luxetool-media-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(62vh, 28rem);
  object-fit: contain;
  margin: 0 auto;
}

button.luxetool-media-stage {
  cursor: zoom-in;
}

button.luxetool-media-stage:focus-visible {
  outline: 2px solid rgba(var(--bs-primary-rgb), 0.55);
  outline-offset: 2px;
}

.luxetool-media-video {
  display: block;
  max-height: min(62vh, 26rem);
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

.luxetool-media-card:fullscreen,
.luxetool-media-card:-webkit-full-screen {
  max-width: none;
  width: 100%;
  height: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}

.luxetool-media-card:fullscreen .luxetool-media-stage,
.luxetool-media-card:-webkit-full-screen .luxetool-media-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.luxetool-media-card:fullscreen .luxetool-media-video,
.luxetool-media-card:-webkit-full-screen .luxetool-media-video {
  max-height: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.luxetool-media-card:fullscreen .card-body,
.luxetool-media-card:-webkit-full-screen .card-body {
  flex: 0 0 auto;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
}

.luxetool-media-play {
  width: 3.25rem;
  height: 3.25rem;
  z-index: 2;
}

.luxetool-media-skeleton {
  display: block;
  width: 100%;
  min-height: 10rem;
  height: min(40vh, 16rem);
  border-radius: 0;
  background: linear-gradient(
    110deg,
    rgba(var(--bs-body-color-rgb), 0.05) 25%,
    rgba(var(--bs-primary-rgb), 0.1) 37%,
    rgba(var(--bs-body-color-rgb), 0.05) 63%
  );
  background-size: 200% 100%;
  animation: luxetool-media-shimmer 1.2s ease-in-out infinite;
}

@keyframes luxetool-media-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}


/* Landing / marketing pages using SmartAdmin landing blocks */
.luxetool-landing.app-landing,
.app-landing.luxetool-landing {
  min-height: 100vh;
}

.luxetool-landing .feature-card,
.luxetool-landing .card {
  background: rgba(var(--bs-body-bg-rgb), 0.35);
}

.luxetool-auth .hero-section,
.luxetool-auth .hero-section {
  min-height: 100vh;
}

/* Admin tabs: keep tab strip above content cleanly */
.panel-content > .nav-tabs {
  margin-bottom: 0;
}

.panel-content > .tab-content.border {
  border-color: rgba(var(--bs-body-color-rgb), 0.12) !important;
}

.luxetool-chat .luxetool-chat-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.luxetool-chat .luxetool-chat-file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.luxetool-chat .luxetool-chat-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 16rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid #6c757d;
  border-radius: 0.35rem;
  background: #2b3035;
  color: #f8f9fa;
  font-size: 0.75rem;
  line-height: 1.2;
}

.luxetool-chat .luxetool-chat-file-chip img {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: cover;
  border-radius: 0.2rem;
  flex-shrink: 0;
}

.luxetool-chat .luxetool-chat-file-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.luxetool-chat .luxetool-chat-file-chip-remove {
  border: 0;
  background: transparent;
  color: #adb5bd;
  padding: 0 0.15rem;
  line-height: 1;
  font-size: 1rem;
  cursor: pointer;
}

.luxetool-chat .luxetool-chat-file-chip-remove:hover {
  color: #f8f9fa;
}

.luxetool-chat .luxetool-chat-attach-btn {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #6c757d;
  background: #2b3035;
  color: #adb5bd;
}

.luxetool-chat .luxetool-chat-attach-btn:hover:not(:disabled) {
  color: #f8f9fa;
  border-color: #adb5bd;
}

/* Category tabs in app header — horizontal scroll on narrow screens */
body.luxetool-sa .app-header-tabs {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

body.luxetool-sa .app-header-tabs::-webkit-scrollbar {
  height: 4px;
}

