/* =============================================================================
 * Tipsoo branding — Metabase OSS visual override
 * -----------------------------------------------------------------------------
 * Official "Appearance" customization is Pro/Enterprise-only in Metabase.
 * This stylesheet is injected into every HTML response by Nginx's sub_filter
 * (see nginx/conf.d/metabase-ts.tipsoo.ai.conf) to brand the OSS edition.
 *
 * Fragility warning: relies on Metabase's `data-testid` attributes, which can
 * change between Metabase versions. After every Metabase upgrade, visit
 * https://metabase-ts.tipsoo.ai/auth/login and the main app, and confirm the
 * Tipsoo logo still shows. If not, inspect the page and update the selectors.
 * ===========================================================================*/

/* ---- Replace the Metabase logo wherever it appears -----------------------
 * The same component is used on the login page header and the top nav. */
[data-testid="main-logo"],
[data-testid="main-logo-link"] [data-testid="main-logo"] {
  /* Tipsoo logo (purple). We force light mode app-wide, so the purple variant
     is correct everywhere. A white variant ships as logo-dark.png if a dark
     surface ever needs it. Logo aspect ratio is ~3.875:1. */
  background-image: url('/static/tipsoo/logo.png') !important;
  background-repeat: no-repeat !important;
  background-position: left center !important;
  background-size: contain !important;
  width: 124px !important;
  height: 32px !important;
}

/* Hide the original Metabase SVG paths inside the logo container. */
[data-testid="main-logo"] > * {
  visibility: hidden !important;
}

/* ---- Login page polish ---------------------------------------------------
 * Give the login form a bit more breathing room above the logo. */
[data-testid="login-form"] [data-testid="main-logo"],
form [data-testid="main-logo"] {
  margin: 0 auto 1rem auto !important;
  display: block !important;
}

/* ---- Force light mode -----------------------------------------------------
 * Render UA-controlled chrome (form fields, scrollbars, autofill) in light
 * mode regardless of OS preference. Mantine's own theme switch is handled by
 * the inline <script> the Nginx sub_filter injects after this file's <link>. */
:root,
html,
html[data-mantine-color-scheme] {
  color-scheme: light !important;
}
