/* GEN.PRO Help Center — Docmost overrides
 *
 * Tokens are pulled directly from the GEN design system (/gen-design skill).
 * Every value here exists in production gen.pro / limitless-fe CSS — no
 * approximations. Surface is deep navy, text is white/gray, the only
 * chromatic moments are the brand gradient CTAs and the lavender link color.
 */

:root {
  /* ---- Brand accents (the gradient duo + actions) ---- */
  --g-light-yellow: #FFDBBB;        /* peach — start of brand gradient */
  --g-purple-secondary: #A29CFF;    /* lavender — end of brand gradient */
  --g-purple-primary: #524CAF;      /* deeper purple — primary container start */
  --g-action: #DAA6FF;              /* pink-purple action accent */
  --g-purple-hover-start: #4D48AD;
  --g-purple-hover-end: #D79CFF;

  /* ---- Surfaces ---- */
  --g-surface-primary: #0C1520;     /* deepest app background */
  --g-surface-secondary: #161D2F;   /* cards, dialogs, drawer headers */
  --g-surface-tertiary: #263049;    /* hover state, elevated surfaces */
  --g-card: #1F2536;                /* most common card surface */
  --g-popover-hover: #23293A;       /* dropdown / menu hover */

  /* ---- Text ---- */
  --g-text-primary: #FFFFFF;
  --g-text-secondary: #B9BCC1;
  --g-text-muted: #818A95;
  --g-text-disabled: #484E54;

  /* ---- Borders ---- */
  --g-border: #31394F;
  --g-border-input: #363D4D;

  /* ---- Status ---- */
  --g-success: #55D68E;
  --g-error: #FF7C7A;
  --g-warning: #FEB56C;

  /* ---- Gradients (the brand moment) ---- */
  --g-cta-gradient: linear-gradient(90deg, #FFDBBB 0%, #A29CFF 100%);
  --g-cta-gradient-hover: linear-gradient(90deg, #4D48AD 0%, #D79CFF 100%);
  --g-primary-gradient: linear-gradient(90deg, #524CAF 0%, #A29CFF 100%);

  /* ---- Radii ---- */
  --g-radius: 0.625rem;             /* 10px — default GEN button */
  --g-radius-card: 0.75rem;         /* 12px */
  --g-radius-modal: 1rem;           /* 16px */

  /* ---- Typography ---- */
  --g-font:
    "Inter",
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  --g-font-mono:
    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ---- Mantine token bridge ---- */
  --mantine-font-family: var(--g-font);
  --mantine-font-family-headings: var(--g-font);
  --mantine-font-family-monospace: var(--g-font-mono);
}

/* Mantine palette — point its tokens at the flat #222 theme */
:root[data-mantine-color-scheme="light"],
:root[data-mantine-color-scheme="dark"] {
  --mantine-color-body: #FFFFFF;
  --mantine-color-text: var(--g-text-primary);
  --mantine-color-dimmed: var(--g-text-secondary);
  --mantine-color-anchor: var(--g-purple-secondary);
  --mantine-color-default: #FFFFFF;
  --mantine-color-default-hover: #2a2a2a;
  --mantine-color-default-color: var(--g-text-primary);
  --mantine-color-default-border: #333333;
}

/* NUKE every Mantine surface below the header — flat #222 wins */
.mantine-AppShell-main,
.mantine-AppShell-main *:not(.gen-help-cta):not(.gen-help-cta *),
.mantine-AppShell-aside,
.mantine-AppShell-aside *,
.mantine-AppShell-navbar,
.mantine-AppShell-navbar * {
  background-color: transparent !important;
  background-image: none !important;
}

.mantine-AppShell-main,
.mantine-AppShell-aside,
.mantine-AppShell-navbar,
body,
html,
body > #root,
.mantine-AppShell-root {
  background: #FFFFFF !important;
}

/* Restore the brand-gradient CTA buttons (we just nuked their bg) */
.mantine-AppShell-main a.gen-help-cta,
a.gen-help-cta,
.gen-help-cta {
  background-image: linear-gradient(
    to right, #524CAF 0%, #A29CFF 50%, #524CAF 100%
  ) !important;
  background-color: transparent !important;
  background-size: 200% 100% !important;
  background-position: 0 50% !important;
}

/* ---------- Global font + base surface ---------- */
html,
body,
button,
input,
textarea,
select {
  font-family: var(--g-font) !important;
  letter-spacing: -0.01em;
}

html,
body {
  background: #FFFFFF !important;
  color: var(--g-text-primary) !important;
}

body > #root,
.mantine-AppShell-root,
.mantine-AppShell-main,
.mantine-AppShell-aside,
.mantine-AppShell-navbar {
  background: #FFFFFF !important;
  color: var(--g-text-primary) !important;
}

/* ---------- Header (kept deep navy as the brand chrome) ---------- */
.mantine-AppShell-header {
  background: var(--g-surface-primary) !important;
  border-bottom: 1px solid var(--g-border) !important;
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.25) !important;
  color: var(--g-text-primary) !important;
}

.mantine-AppShell-header * {
  color: inherit;
}

.mantine-AppShell-header a,
.mantine-AppShell-header button {
  color: var(--g-text-primary) !important;
}

.mantine-AppShell-header .mantine-ActionIcon-root,
.mantine-AppShell-header [role="button"] {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--g-text-primary) !important;
}

.mantine-AppShell-header .mantine-ActionIcon-root:hover {
  background: var(--g-surface-tertiary) !important;
}

/* ---------- Article reading surface ----------
 * Flat #222 below the header, light text on top. No white cards, no
 * navy panels — just one unified dark surface.
 */
.mantine-AppShell-main {
  background: #FFFFFF !important;
  padding-top: 2.5rem !important;
}

.mantine-Container-root {
  background: #FFFFFF !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #222222 !important;
  padding: 2.5rem 2.75rem 3rem !important;
  margin: 0 auto 2rem !important;
}

/* Wipe any nested Mantine paper/card backgrounds inside the article body */
.mantine-AppShell-main .mantine-Paper-root,
.mantine-AppShell-main [class*="mantine-Card"],
.mantine-AppShell-main [class*="mantine-Box"] {
  background: transparent !important;
  box-shadow: none !important;
}

.mantine-AppShell-main p,
.mantine-AppShell-main li,
.mantine-AppShell-main span,
.mantine-AppShell-main strong,
.mantine-AppShell-main em,
.mantine-AppShell-main td,
.mantine-AppShell-main th,
.mantine-AppShell-main blockquote {
  color: #222222 !important;
}

.mantine-AppShell-main p,
.mantine-AppShell-main li {
  font-size: 1rem;
  line-height: 1.7;
  color: #222222 !important;
}

.mantine-AppShell-main p strong,
.mantine-AppShell-main li strong {
  color: #222222 !important;
  font-weight: 700;
}

/* Headings — black on white */
.mantine-AppShell-main h1,
.mantine-AppShell-main h2,
.mantine-AppShell-main h3,
.mantine-AppShell-main h4,
.mantine-AppShell-main h5,
.mantine-AppShell-main h6,
[class*="mantine-Title-root"] {
  font-family: var(--g-font) !important;
  color: #222222 !important;
  background: none !important;
  -webkit-text-fill-color: #222222 !important;
  font-weight: 700;
}

.mantine-AppShell-main h1 {
  font-size: 2.25rem !important;
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin: 0.4em 0 0.6em !important;
}

.mantine-AppShell-main h2 {
  font-size: 1.5rem !important;
  line-height: 1.3;
  letter-spacing: -0.03em;
  margin: 1.6em 0 0.5em !important;
}

.mantine-AppShell-main h3 {
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 1.6em 0 0.5em !important;
  color: #222222 !important;
}

/* Links — dark purple, semibold, underlined (readable on white) */
.mantine-AppShell-main a {
  color: #524CAF !important;
  text-decoration: underline;
  text-decoration-color: rgba(82, 76, 175, 0.4);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  font-weight: 600;
  border-bottom: none !important;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.mantine-AppShell-main a:hover {
  color: #4D48AD !important;
  text-decoration-color: #524CAF;
}

.mantine-AppShell-main a strong,
.mantine-AppShell-main a b {
  color: #524CAF !important;
}

/* Inline code — soft accent on tertiary surface */
.mantine-AppShell-main code {
  background: #F4F1FF !important;
  color: #524CAF !important;
  border: 1px solid #E2DCFF !important;
  border-radius: 6px;
  padding: 0.1em 0.4em;
  font-family: var(--g-font-mono);
  font-size: 0.9em;
}

/* Code blocks */
.mantine-AppShell-main pre,
.mantine-AppShell-main pre code {
  background: var(--g-surface-tertiary) !important;
  color: var(--g-text-primary) !important;
  border: 1px solid var(--g-border) !important;
  border-radius: var(--g-radius-card);
  padding: 1rem 1.25rem;
  font-family: var(--g-font-mono);
  font-size: 0.92em;
  line-height: 1.55;
  overflow-x: auto;
}

.mantine-AppShell-main pre code {
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Blockquotes — lavender accent bar */
.mantine-AppShell-main blockquote {
  border-left: 3px solid var(--g-purple-secondary) !important;
  background: linear-gradient(
    180deg,
    rgba(162, 156, 255, 0.06),
    transparent
  ) !important;
  padding: 0.9em 1.2em !important;
  border-radius: 0 var(--g-radius) var(--g-radius) 0;
  margin: 1.5em 0;
  color: var(--g-text-primary) !important;
}

.mantine-AppShell-main hr {
  border: none !important;
  height: 1px !important;
  background: var(--g-border) !important;
  margin: 2em 0 !important;
}

.mantine-AppShell-main img {
  border-radius: var(--g-radius-card);
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.25);
  max-width: 100%;
  height: auto;
}

/* Tables */
.mantine-AppShell-main table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  border: 1px solid var(--g-border);
  border-radius: var(--g-radius);
  overflow: hidden;
}

.mantine-AppShell-main th {
  background: var(--g-surface-tertiary) !important;
  color: var(--g-text-primary) !important;
  font-weight: 600;
  text-align: left;
  padding: 0.7em 1em;
  border-bottom: 1px solid var(--g-border);
}

.mantine-AppShell-main td {
  padding: 0.7em 1em;
  border-bottom: 1px solid var(--g-border);
  color: var(--g-text-secondary) !important;
}

.mantine-AppShell-main tr:last-child td {
  border-bottom: none;
}

/* ---------- Sidebar (Table of Contents) ---------- */
.mantine-AppShell-aside {
  background: #FFFFFF !important;
  border-left: none !important;
  color: #222222 !important;
  backdrop-filter: none !important;
}

.mantine-AppShell-aside *,
.mantine-AppShell-aside p,
.mantine-AppShell-aside button,
.mantine-AppShell-aside span,
.mantine-AppShell-aside h1,
.mantine-AppShell-aside h2,
.mantine-AppShell-aside h3,
.mantine-AppShell-aside h4 {
  color: #222222 !important;
}

.mantine-AppShell-aside a,
.mantine-AppShell-aside [class*="link"] {
  color: #666666 !important;
  border-bottom: none !important;
  transition: color 0.15s ease;
}

.mantine-AppShell-aside a:hover,
.mantine-AppShell-aside [class*="link"]:hover,
.mantine-AppShell-aside [class*="link"][data-active] {
  color: var(--g-purple-secondary) !important;
}

.mantine-AppShell-aside [data-active="true"] {
  color: var(--g-purple-secondary) !important;
  font-weight: 600;
}

/* Navbar (left side, if present) */
.mantine-AppShell-navbar {
  background: var(--g-surface-primary) !important;
  border-right: 1px solid var(--g-border) !important;
}

.mantine-AppShell-navbar a,
.mantine-AppShell-navbar button {
  color: var(--g-text-secondary) !important;
}

/* ---------- Inline CTA buttons (canonical .button-primary from gen.pro) ----------
 * Verbatim port of gen-landing-page/src/styles/button.css → .button + .button-primary.
 *   - pill (rounded-full)
 *   - px-8 py-3, white text, -0.28px tracking
 *   - 0.5px white/26% inner shadow rim + 0.5px #ffffff42 border
 *   - 300% bg-size lavender gradient, slides left → right on hover
 *   - 700ms transition
 */
.mantine-AppShell-main a.gen-help-cta,
a.gen-help-cta,
.gen-help-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 0.5rem;
  width: fit-content;
  padding: 0.75rem 2rem;                /* py-3 px-8 */
  margin: 1.25rem 0 1.75rem;
  border-radius: 9999px;                /* rounded-full */
  border: 0.5px solid #ffffff42 !important;
  /* indigo → lavender → pink. Slides into pink on hover (vidsheets accent). */
  background-image: linear-gradient(
    to right, #524CAF 0%, #A29CFF 50%, #DAA6FF 100%
  ) !important;
  background-color: transparent !important;
  background-size: 200% auto !important;
  background-position: left !important;
  background-repeat: no-repeat;
  color: #FFFFFF !important;
  font-family: var(--g-font);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.28px;
  text-decoration: none !important;
  box-shadow:
    inset -0.6px 0 0 rgba(255, 255, 255, 0.04),
    inset 0.6px 0 0 rgba(255, 255, 255, 0.04),
    0 4px 24px rgba(162, 156, 255, 0.3);
  backdrop-filter: blur(6px);
  transition: all 700ms;
  cursor: pointer;
}

.mantine-AppShell-main a.gen-help-cta,
.mantine-AppShell-main a.gen-help-cta:visited,
.mantine-AppShell-main a.gen-help-cta *,
a.gen-help-cta,
a.gen-help-cta:visited,
a.gen-help-cta *,
.gen-help-cta,
.gen-help-cta * {
  color: #FFFFFF !important;
  -webkit-text-fill-color: #FFFFFF !important;
}

.mantine-AppShell-main a.gen-help-cta:hover,
a.gen-help-cta:hover,
.gen-help-cta:hover {
  background-position: right !important;
  box-shadow:
    inset -0.6px 0 0 rgba(255, 255, 255, 0.04),
    inset 0.6px 0 0 rgba(255, 255, 255, 0.04),
    0 6px 30px rgba(218, 166, 255, 0.55);     /* pink glow on hover */
  text-decoration: none !important;
}

.mantine-AppShell-main a.gen-help-cta:active,
a.gen-help-cta:active,
.gen-help-cta:active {
  background-position: center !important;
  box-shadow:
    inset -0.6px 0 0 rgba(255, 255, 255, 0.04),
    inset 0.6px 0 0 rgba(255, 255, 255, 0.04),
    0 2px 12px rgba(162, 156, 255, 0.3);
  transition-duration: 150ms;
}

.gen-help-cta__arrow {
  display: inline-block;
  font-size: 1em;
  font-weight: 700;
  transition: transform 0.15s ease;
}

.gen-help-cta:hover .gen-help-cta__arrow {
  transform: translateX(3px);
}

/* ---------- Buttons + Action icons OUTSIDE header ---------- */
.mantine-AppShell-main .mantine-ActionIcon-root,
.mantine-AppShell-main .mantine-Button-root,
.mantine-AppShell-aside .mantine-ActionIcon-root,
.mantine-AppShell-aside .mantine-Button-root {
  background: var(--g-card) !important;
  border: 1px solid var(--g-border-input) !important;
  color: var(--g-text-primary) !important;
  border-radius: var(--g-radius) !important;
  backdrop-filter: none !important;
}

.mantine-AppShell-main .mantine-ActionIcon-root:hover,
.mantine-AppShell-main .mantine-Button-root:hover,
.mantine-AppShell-aside .mantine-ActionIcon-root:hover,
.mantine-AppShell-aside .mantine-Button-root:hover {
  background: var(--g-surface-tertiary) !important;
  border-color: var(--g-purple-secondary) !important;
}

/* ---------- Header brand (logo + title) ---------- */
.gen-help-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.gen-help-header-logo {
  display: block;
  width: 72px;
  height: auto;
  object-fit: contain;
}

.gen-help-brand-text {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--g-text-primary) !important;
}

/* Favicon img tweak */
img[src="/favicon.png"] {
  border-radius: 6px;
}

/* ---------- Selection ---------- */
::selection {
  background: var(--g-purple-secondary);
  color: var(--g-surface-primary);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
