/* Balius Partners — BRAGAI
   All colors/theming live in public/theme.json (Chainlit 2.x, HSL format).
   This file only holds the few things theme.json can't express. */

/* ── Gold accent for inline code ─────────────────────────────────────────── */
code:not(pre code) {
  color: #c9a96e !important;
}

/* ── Subtle message fade-in ──────────────────────────────────────────────── */
@keyframes bragai-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
[data-testid="user-message"],
[data-testid="assistant-message"] {
  animation: bragai-fadein 0.18s ease-out both;
}

/* ── Footer spacer line ──────────────────────────────────────────────────────
   The "---" divider above the Sources / diagnostics footer renders as a shadcn
   Separator (role="none" div), NOT an <hr>. Give it equal top/bottom margin so the
   response-to-divider gap matches the divider-to-footer-text gap, with a bit more
   room. Scoped to message content (a container that also holds the markdown
   "article" blocks) so separators elsewhere in the UI aren't affected. ── */
:has(> [role="article"]) > [data-orientation="horizontal"][role="none"] {
  margin-top: 1.75rem !important;
  margin-bottom: 1.75rem !important;
}

/* ── Login page ──────────────────────────────────────────────────────────── */
/* Chainlit's login is a shadcn two-column block: left = logo-on-top + centered
   form, right = a decorative cover image (reusing the favicon, with classes
   object-cover + grayscale + brightness).

   CRITICAL: every rule is anchored on body:has(input[name="password"]) — the
   password field exists ONLY on the login page. The earlier version anchored on
   img[alt="Image"], but UPLOADED images in the chat also carry alt="Image", so
   those rules leaked onto the chat page and hid file-upload previews. Never use
   alt="Image" as a login anchor.                                              */

/* 1. Remove the decorative cover image + its panel. The image's src points at
      /favicon — a unique, stable signature (no other <img> on the page uses it),
      so we match on that AND its grayscale class, hiding both the image and its
      containing panel via several fallbacks so it can't slip through. */
/* Hide the cover image (matched by its unique /favicon src + grayscale class) and
   its DIRECT-parent panel only. Do NOT use a grandparent (> div > img) selector —
   that matches the grid container that also holds the form, blanking the page. */
body:has(input[name="password"]) img[src*="/favicon"],
body:has(input[name="password"]) img[class*="grayscale"],
body:has(input[name="password"]) div:has(> img[src*="/favicon"]),
body:has(input[name="password"]) div:has(> img[class*="grayscale"]) {
  display: none !important;
}

/* 2. Collapse the 2-column split so the form centers across the full page. */
body:has(input[name="password"]) [class*="grid-cols-2"] {
  grid-template-columns: 1fr !important;
}

/* 3. Center the logo + form vertically as one group (logo just above form). */
body:has(input[name="password"]) .flex.flex-col:has(> .flex.flex-1.items-center) {
  justify-content: center !important;
}
body:has(input[name="password"]) .flex.flex-1.items-center.justify-center {
  flex-grow: 0 !important;
}

/* 4. Center the logo horizontally (overrides Tailwind's md:justify-start).
      Scoped to login, so the chat-page header logo keeps its default position. */
body:has(input[name="password"]) img.logo {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Settings gear left at its default position (next to the attachments icon) —
   absolute-positioning attempts kept breaking the composer/home-page layout. */

/* ── "/" command popup ───────────────────────────────────────────────────────
   Left at Chainlit's default. Earlier attempts to resize/reposition it (cap the
   list height, measure the space above the composer) caused the popup to clip at
   the TOP of the screen on the home page, which is worse than the default's
   bottom-clipping. Reverted to default per request — if revisited, the home-page
   composer position is the crux. ── */

/* ── Hide Chainlit watermark ─────────────────────────────────────────────── */
a[href*="chainlit.io"],
a[href*="github.com/Chainlit"] {
  display: none !important;
}
