/* Mixpanel Brand Colors */
:root {
  /* Primary purple */
  --md-primary-fg-color: #7856ff;
  --md-primary-fg-color--light: #9b7fff;
  --md-primary-fg-color--dark: #5c3dd4;

  /* Accent (same purple family) */
  --md-accent-fg-color: #7856ff;
  --md-accent-fg-color--transparent: rgba(120, 86, 255, 0.1);

  /* Mixpanel purple palette */
  --mp-purple-darkest: #1b0b3b;
  --mp-purple-dark: #242133;
  --mp-purple-primary: #7856ff;
  --mp-purple-light: #9b7fff;
  --mp-purple-lightest: #e8ddff;

  /* Backgrounds */
  --mp-light-bg: #fbf9f9;
  --mp-dark-bg: #242133;
}

/* Light mode overrides - matches developer.mixpanel.com */
[data-md-color-scheme="default"] {
  /* Pure white background like official docs */
  --md-default-bg-color: #ffffff;
  --md-default-bg-color--light: #ffffff;
  --md-default-bg-color--lighter: #f6f6f6;
  --md-default-bg-color--lightest: #f6f6f6;

  /* Code blocks - Mixpanel uses #F6F6F6 */
  --md-code-bg-color: #f6f6f6;

  /* Typeset - use Mixpanel's blue for links */
  --md-typeset-a-color: #4f44e0;

  /* Text colors matching official docs */
  --md-typeset-color: #626266;

  /* Primary color - Mixpanel blue */
  --md-primary-fg-color: #4f44e0;
  --md-primary-fg-color--light: #6b5fd4;
  --md-primary-fg-color--dark: #463dbb;

  /* Accent */
  --md-accent-fg-color: #4f44e0;
  --md-accent-fg-color--transparent: rgba(79, 68, 224, 0.1);
}

/* Syntax highlighting - Mixpanel developer docs palette (light mode) */
/* Strings - green (Mixpanel: #219464) */
[data-md-color-scheme="default"] .highlight .s,
[data-md-color-scheme="default"] .highlight .s1,
[data-md-color-scheme="default"] .highlight .s2,
[data-md-color-scheme="default"] .highlight .sb,
[data-md-color-scheme="default"] .highlight .sc,
[data-md-color-scheme="default"] .highlight .sd,
[data-md-color-scheme="default"] .highlight .se,
[data-md-color-scheme="default"] .highlight .sh,
[data-md-color-scheme="default"] .highlight .si,
[data-md-color-scheme="default"] .highlight .sr,
[data-md-color-scheme="default"] .highlight .ss,
[data-md-color-scheme="default"] .highlight .sx {
  color: #219464;
}

/* Numbers - orange (Mixpanel: #DF7800) */
[data-md-color-scheme="default"] .highlight .m,
[data-md-color-scheme="default"] .highlight .mi,
[data-md-color-scheme="default"] .highlight .mo,
[data-md-color-scheme="default"] .highlight .mf,
[data-md-color-scheme="default"] .highlight .mh,
[data-md-color-scheme="default"] .highlight .mb,
[data-md-color-scheme="default"] .highlight .il {
  color: #df7800;
}

/* Keywords - red (Mixpanel: #E34F2F) */
[data-md-color-scheme="default"] .highlight .k,
[data-md-color-scheme="default"] .highlight .kn,
[data-md-color-scheme="default"] .highlight .kd,
[data-md-color-scheme="default"] .highlight .kc,
[data-md-color-scheme="default"] .highlight .kp,
[data-md-color-scheme="default"] .highlight .kr,
[data-md-color-scheme="default"] .highlight .kt {
  color: #e34f2f;
}

/* Names/identifiers - orange for property/attribute names */
[data-md-color-scheme="default"] .highlight .na,
[data-md-color-scheme="default"] .highlight .nl,
[data-md-color-scheme="default"] .highlight .nt {
  color: #df7800;
}

/* Function names - blue (Mixpanel: #4F44E0) */
[data-md-color-scheme="default"] .highlight .nf,
[data-md-color-scheme="default"] .highlight .fm {
  color: #4f44e0;
}

/* Built-in names - purple-blue (Mixpanel: #463DBB) */
[data-md-color-scheme="default"] .highlight .nb,
[data-md-color-scheme="default"] .highlight .bp {
  color: #463dbb;
}

/* Comments - gray (Mixpanel: #8F8F91) */
[data-md-color-scheme="default"] .highlight .c,
[data-md-color-scheme="default"] .highlight .c1,
[data-md-color-scheme="default"] .highlight .cm,
[data-md-color-scheme="default"] .highlight .cp,
[data-md-color-scheme="default"] .highlight .cs,
[data-md-color-scheme="default"] .highlight .ch {
  color: #8f8f91;
  font-style: italic;
}

/* Operators and punctuation */
[data-md-color-scheme="default"] .highlight .o,
[data-md-color-scheme="default"] .highlight .ow,
[data-md-color-scheme="default"] .highlight .p {
  color: #626266;
}

/* Class and type names - orange */
[data-md-color-scheme="default"] .highlight .nc,
[data-md-color-scheme="default"] .highlight .nn {
  color: #df7800;
}

/* Variables and general names - base text color (Mixpanel: #626266) */
[data-md-color-scheme="default"] .highlight .n,
[data-md-color-scheme="default"] .highlight .nv,
[data-md-color-scheme="default"] .highlight .vm,
[data-md-color-scheme="default"] .highlight .vi,
[data-md-color-scheme="default"] .highlight .vg {
  color: #626266;
}

/* Dark mode overrides */
[data-md-color-scheme="slate"] {
  --md-default-bg-color: #242133;
  --md-default-bg-color--light: #2d2942;
  --md-default-bg-color--lighter: #363252;
  --md-default-bg-color--lightest: #3f3b62;

  /* Code blocks - Mixpanel uses semi-transparent overlay */
  --md-code-bg-color: rgba(255, 255, 255, 0.08);

  /* Typeset */
  --md-typeset-a-color: #9b7fff;

  /* Header */
  --md-primary-fg-color: #7856ff;
}

/* Syntax highlighting - Mixpanel developer docs palette (dark mode) */
/* Strings - green (Mixpanel: #219464, brightened for dark mode) */
[data-md-color-scheme="slate"] .highlight .s,
[data-md-color-scheme="slate"] .highlight .s1,
[data-md-color-scheme="slate"] .highlight .s2,
[data-md-color-scheme="slate"] .highlight .sb,
[data-md-color-scheme="slate"] .highlight .sc,
[data-md-color-scheme="slate"] .highlight .sd,
[data-md-color-scheme="slate"] .highlight .se,
[data-md-color-scheme="slate"] .highlight .sh,
[data-md-color-scheme="slate"] .highlight .si,
[data-md-color-scheme="slate"] .highlight .sr,
[data-md-color-scheme="slate"] .highlight .ss,
[data-md-color-scheme="slate"] .highlight .sx {
  color: #2eb87d;
}

/* Numbers - orange (Mixpanel: #DF7800, brightened for dark mode) */
[data-md-color-scheme="slate"] .highlight .m,
[data-md-color-scheme="slate"] .highlight .mi,
[data-md-color-scheme="slate"] .highlight .mo,
[data-md-color-scheme="slate"] .highlight .mf,
[data-md-color-scheme="slate"] .highlight .mh,
[data-md-color-scheme="slate"] .highlight .mb,
[data-md-color-scheme="slate"] .highlight .il {
  color: #f08d1c;
}

/* Keywords - red (Mixpanel: #E34F2F, brightened for dark mode) */
[data-md-color-scheme="slate"] .highlight .k,
[data-md-color-scheme="slate"] .highlight .kn,
[data-md-color-scheme="slate"] .highlight .kd,
[data-md-color-scheme="slate"] .highlight .kc,
[data-md-color-scheme="slate"] .highlight .kp,
[data-md-color-scheme="slate"] .highlight .kr,
[data-md-color-scheme="slate"] .highlight .kt {
  color: #ef6347;
}

/* Names/identifiers - orange for property/attribute names */
[data-md-color-scheme="slate"] .highlight .na,
[data-md-color-scheme="slate"] .highlight .nl,
[data-md-color-scheme="slate"] .highlight .nt {
  color: #f08d1c;
}

/* Function names - blue (Mixpanel: #4F44E0, brightened) */
[data-md-color-scheme="slate"] .highlight .nf,
[data-md-color-scheme="slate"] .highlight .fm {
  color: #7169e8;
}

/* Built-in names - purple-blue (Mixpanel: #463DBB, brightened) */
[data-md-color-scheme="slate"] .highlight .nb,
[data-md-color-scheme="slate"] .highlight .bp {
  color: #6b5fd4;
}

/* Comments - gray (Mixpanel: #8F8F91) */
[data-md-color-scheme="slate"] .highlight .c,
[data-md-color-scheme="slate"] .highlight .c1,
[data-md-color-scheme="slate"] .highlight .cm,
[data-md-color-scheme="slate"] .highlight .cp,
[data-md-color-scheme="slate"] .highlight .cs,
[data-md-color-scheme="slate"] .highlight .ch {
  color: #9a9a9c;
  font-style: italic;
}

/* Operators and punctuation - light gray */
[data-md-color-scheme="slate"] .highlight .o,
[data-md-color-scheme="slate"] .highlight .ow,
[data-md-color-scheme="slate"] .highlight .p {
  color: #c0c0c0;
}

/* Class and type names - orange */
[data-md-color-scheme="slate"] .highlight .nc,
[data-md-color-scheme="slate"] .highlight .nn {
  color: #f08d1c;
}

/* Variables and general names - base text color */
[data-md-color-scheme="slate"] .highlight .n,
[data-md-color-scheme="slate"] .highlight .nv,
[data-md-color-scheme="slate"] .highlight .vm,
[data-md-color-scheme="slate"] .highlight .vi,
[data-md-color-scheme="slate"] .highlight .vg {
  color: #e0e0e0;
}

/* Header styling - light mode uses Mixpanel blue (#4f44e0), dark mode uses dark purple */
[data-md-color-scheme="default"] .md-header {
  background-color: #4f44e0;
}

[data-md-color-scheme="slate"] .md-header {
  background-color: #302c4c;
}

/* Tabs styling - match header colors per mode */
[data-md-color-scheme="default"] .md-tabs {
  background-color: #4f44e0;
}

[data-md-color-scheme="slate"] .md-tabs {
  background-color: #302c4c;
}

/* Navigation hover/active states */
.md-nav__link:hover,
.md-nav__link--active {
  color: var(--md-primary-fg-color);
}

/* Light mode sidebar styling */
[data-md-color-scheme="default"] .md-sidebar {
  background-color: #ffffff;
}

[data-md-color-scheme="default"] .md-nav__link {
  color: #626266;
}

[data-md-color-scheme="default"] .md-nav__link:hover,
[data-md-color-scheme="default"] .md-nav__link--active {
  color: #4f44e0;
}

/* Light mode search styling */
[data-md-color-scheme="default"] .md-search__input {
  background-color: #f6f6f6;
  color: #2a2a2f;
}

[data-md-color-scheme="default"] .md-search__input::placeholder {
  color: #8f8f91;
}

/* Code highlighting accent */
.md-typeset .highlight .hll {
  background-color: var(--md-accent-fg-color--transparent);
}

/* Admonition styling - light mode uses Mixpanel blue */
[data-md-color-scheme="default"] .md-typeset .admonition.note,
[data-md-color-scheme="default"] .md-typeset details.note {
  border-color: #4f44e0;
}

[data-md-color-scheme="default"] .md-typeset .note > .admonition-title,
[data-md-color-scheme="default"] .md-typeset .note > summary {
  background-color: rgba(79, 68, 224, 0.1);
}

[data-md-color-scheme="default"] .md-typeset .note > .admonition-title::before,
[data-md-color-scheme="default"] .md-typeset .note > summary::before {
  background-color: #4f44e0;
}

/* Admonition styling - dark mode uses purple */
[data-md-color-scheme="slate"] .md-typeset .admonition.note,
[data-md-color-scheme="slate"] .md-typeset details.note {
  border-color: #7856ff;
}

[data-md-color-scheme="slate"] .md-typeset .note > .admonition-title,
[data-md-color-scheme="slate"] .md-typeset .note > summary {
  background-color: rgba(120, 86, 255, 0.1);
}

[data-md-color-scheme="slate"] .md-typeset .note > .admonition-title::before,
[data-md-color-scheme="slate"] .md-typeset .note > summary::before {
  background-color: #7856ff;
}

/* Button styling - light mode uses Mixpanel blue */
[data-md-color-scheme="default"] .md-typeset .md-button--primary {
  background-color: #4f44e0;
  border-color: #4f44e0;
}

[data-md-color-scheme="default"] .md-typeset .md-button--primary:hover {
  background-color: #463dbb;
  border-color: #463dbb;
}

/* Button styling - dark mode uses purple */
[data-md-color-scheme="slate"] .md-typeset .md-button--primary {
  background-color: #7856ff;
  border-color: #7856ff;
}

[data-md-color-scheme="slate"] .md-typeset .md-button--primary:hover {
  background-color: #5c3dd4;
  border-color: #5c3dd4;
}

/* Search highlight */
.md-search__input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

/* Footer links */
.md-footer-meta__inner {
  color: rgba(255, 255, 255, 0.7);
}

/* Scrollbar styling for dark mode */
[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb {
  background-color: #7856ff;
}

/* Table styling - light mode uses subtle gray like official docs */
[data-md-color-scheme="default"] .md-typeset table:not([class]) th {
  background-color: #f6f6f6;
  color: #2a2a2f;
}

[data-md-color-scheme="default"] .md-typeset table:not([class]) {
  border: 1px solid #e9e9e9;
}

[data-md-color-scheme="default"] .md-typeset table:not([class]) td,
[data-md-color-scheme="default"] .md-typeset table:not([class]) th {
  border-color: #e9e9e9;
}

/* Table styling - dark mode uses purple tint */
[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background-color: rgba(120, 86, 255, 0.1);
}

/* Light mode heading colors - darker like official docs */
[data-md-color-scheme="default"] .md-typeset h1,
[data-md-color-scheme="default"] .md-typeset h2,
[data-md-color-scheme="default"] .md-typeset h3,
[data-md-color-scheme="default"] .md-typeset h4,
[data-md-color-scheme="default"] .md-typeset h5,
[data-md-color-scheme="default"] .md-typeset h6 {
  color: #2a2a2f;
}

/* Light mode code inline styling */
[data-md-color-scheme="default"] .md-typeset code {
  background-color: #f6f6f6;
  color: #626266;
  border-radius: 4px;
}

/* Light mode scrollbar */
[data-md-color-scheme="default"] ::-webkit-scrollbar-thumb {
  background-color: #e9e9e9;
}

[data-md-color-scheme="default"] ::-webkit-scrollbar-thumb:hover {
  background-color: #4f44e0;
}

/*
 * LLMs.txt copy button - Anthropic-style outlined button with icon
 * Note: !important is required throughout to override inline styles
 * injected by the mkdocs-llmstxt-md plugin
 */
#llms-copy-button {
  position: fixed !important;
  top: 85px !important;
  right: 24px !important;
}

#llms-copy-button button {
  display: inline-flex !important;
  align-items: center !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

#llms-copy-button button::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}

#llms-copy-button button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

#llms-copy-button button:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.9)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E");
}

/* Light mode adjustments */
[data-md-color-scheme="default"] #llms-copy-button button {
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: rgba(0, 0, 0, 0.6) !important;
}

[data-md-color-scheme="default"] #llms-copy-button button::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(0,0,0,0.6)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E");
}

[data-md-color-scheme="default"] #llms-copy-button button:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.25) !important;
  color: rgba(0, 0, 0, 0.8) !important;
}

[data-md-color-scheme="default"] #llms-copy-button button:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(0,0,0,0.8)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E");
}

/* Copy button success state (works in both light and dark modes) */
#llms-copy-button button.success {
  border-color: #219464 !important;
  color: #219464 !important;
}

#llms-copy-button button.success::before {
  display: none;
}

/* Copy button error state (works in both light and dark modes) */
#llms-copy-button button.error {
  border-color: #e34f2f !important;
  color: #e34f2f !important;
}

#llms-copy-button button.error::before {
  display: none;
}

/* Keyboard focus styles for accessibility */
#llms-copy-button button:focus-visible {
  outline: 2px solid var(--md-primary-fg-color) !important;
  outline-offset: 2px !important;
}
