/*
 * Novata help-docs styles.
 *
 * Tokens here mirror the Novakit design system. Source of truth:
 *   novata-platform/packages/novakit/src/theme/utils/palette.ts
 *   novata-platform/packages/novakit/src/theme/utils/typography.ts
 *   novata-platform/packages/novakit/src/theme/utils/radii.ts
 *   novata-platform/packages/novakit/src/theme/utils/spacing.ts
 *   novata-platform/packages/novakit/src/theme/utils/shadows.ts
 *
 * If you change a value here, sync it with Novakit (or, better, leave Novakit
 * as the source of truth and update only the variable mapping below).
 */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* --- Colors (light palette) --- */
  --nv-text-primary: #1c2530;
  --nv-text-dark-teal: #00344D;
  --nv-text-secondary: #4e6179;
  --nv-text-tertiary: #5d7a92;
  --nv-text-brand: #067cc1;
  --nv-text-brand-dark: #056ca8;
  --nv-text-success: #0c792c;
  --nv-text-on-dark: #ffffff;

  --nv-bg-page: #f9fafb;
  --nv-bg-surface: #ffffff;
  --nv-bg-neutral-light: #f3f5f7;
  --nv-bg-info: #f5fafd;
  --nv-bg-info-strong: #e1f1fd;
  --nv-bg-success: #f2fbf5;

  --nv-border-weak: #a8b5c766;
  --nv-border-strong: #94a2b8;
  --nv-border-brand: #067cc1;
  --nv-border-brand-light: #6ab0da;

  --nv-corporate-prussian: #00344d;
  --nv-corporate-cyan: #00f6f4;
  --nv-icon-success: #00a83e;

  /* --- Radii (Novakit) --- */
  --nv-radius-xs: 4px;
  --nv-radius-sm: 8px;
  --nv-radius-md: 16px;
  --nv-radius-lg: 24px;
  --nv-radius-xl: 32px;

  /* --- Spacing (Novakit scale) --- */
  --nv-space-1: 2px;
  --nv-space-2: 4px;
  --nv-space-3: 8px;
  --nv-space-4: 12px;
  --nv-space-5: 16px;
  --nv-space-6: 24px;
  --nv-space-7: 32px;
  --nv-space-8: 40px;
  --nv-space-9: 48px;

  /* --- Type --- */
  --nv-font-body: "Poppins", "Helvetica", "Arial", sans-serif;
  --nv-font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, "Courier New", monospace;

  /* --- Elevation (Novakit shadows) --- */
  --nv-shadow-sm: 0 4px 10px 0 rgba(11, 15, 20, 0.16);
  --nv-shadow-md: 0 8px 24px -4px rgba(11, 15, 20, 0.28);
  --nv-shadow-lg: 0 22px 40px -10px rgba(11, 15, 20, 0.28);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--nv-font-body);
  font-size: 16px;
  line-height: 24px;
  color: var(--nv-text-primary);
  background: var(--nv-bg-page);
  min-height: 100vh;
  padding: var(--nv-space-7) var(--nv-space-5);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: var(--nv-space-6);
}

/* ==========================================================================
   Hero / page header
   ========================================================================== */

.hero,
.header {
  position: relative;
  background: var(--nv-corporate-prussian);
  color: var(--nv-text-on-dark);
  padding: var(--nv-space-9);
  overflow: hidden;
  border-radius: var(--nv-radius-lg);
}

.hero::before,
.header::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 60%;
  height: 180%;
  background: radial-gradient(
    circle at center,
    rgba(0, 245, 243, 0.22) 0%,
    rgba(0, 245, 243, 0.08) 35%,
    transparent 70%
  );
  pointer-events: none;
}

.hero > *,
.header > * {
  position: relative;
}
.hero {
  display: flex;
  align-items: center;
}
.hero h1,
.header h1 {
  font-size: 40px;
  line-height: 48px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hero-title {
  flex: 2;
  gap: var(--nv-space-8);
}
.hero-content {
  flex: 1;
  background: rgb(0, 246, 244) url(assets/dots.svg) no-repeat right bottom;
  border-radius: 16px;
  color: var(--nv-text-dark-teal);
  padding: var(--nv-space-6);
}
.hero p {
  font-size: 16px;
  line-height: 24px;
  max-width: 720px;

}

.header h1 {
  font-size: 32px;
  line-height: 40px;
}

.header .function-name {
  font-family: var(--nv-font-mono);
  background: rgba(0, 245, 243, 0.14);
  border: 1px solid rgba(0, 245, 243, 0.4);
  color: var(--nv-corporate-cyan);
  padding: var(--nv-space-2) var(--nv-space-4);
  border-radius: 999px;
  display: inline-block;
  margin-top: var(--nv-space-4);
  font-size: 14px;
  font-weight: 500;
}

/* ==========================================================================
   Content layout
   ========================================================================== */

.content {
  padding: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: var(--nv-space-6);
}

/* Every section is a self-contained card — title, description and content
   all live inside the same rounded white box, matching the platform pattern
   where there is no free-floating text between cards. */
.section {
  background: var(--nv-bg-surface);
  border: 1px solid var(--nv-border-weak);
  border-radius: var(--nv-radius-lg);
  padding: var(--nv-space-7);
}

.section h2 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  color: var(--nv-text-primary);
  margin: 0 0 var(--nv-space-3);
  letter-spacing: -0.01em;
}

.section h3 {
  font-size: 18px;
  line-height: 26px;
  font-weight: 600;
  color: var(--nv-text-primary);
  margin: var(--nv-space-6) 0 var(--nv-space-3);
}

.section > h2 + .description,
.section > h2 + p {
  margin-top: 0;
}

.section p,
.description {
  color: var(--nv-text-secondary);
  font-size: 16px;
  line-height: 24px;
}

.description {
  margin: 0 0 var(--nv-space-5);
  max-width: 760px;
}

/* ==========================================================================
   Icons (SVG sprite — see assets/icons.svg)
   ========================================================================== */

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

.icon--lg {
  width: 24px;
  height: 24px;
}

/* Section/subsection headings get a flexbox layout so the icon and text
   line up neatly without manual vertical-align tweaking. */
.section h2,
.section h3,
.tabs-header h2,
.hero h1,
.header h1 {
  display: flex;
  align-items: center;
  gap: var(--nv-space-3);
}

/* Round avatar-style chip for landing-page section headings, mirroring
   the platform's "icon-in-circle" treatment seen on the dashboard cards. */
.icon-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--nv-bg-info-strong);
  color: var(--nv-text-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-chip .icon {
  width: 18px;
  height: 18px;
}

.icon-chip--success {
  background: var(--nv-bg-success);
  color: var(--nv-text-success);
}

.icon-chip--warning {
  background: rgba(245, 196, 0, 0.15);
  color: #a26702;
}

/* ==========================================================================
   Supporting tools (Novakit pattern — see novakit Storybook
   "data-display/supportingtools" story)
   ========================================================================== */

.supporting-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--nv-space-6);
}

.supporting-tool {
  display: flex;
  align-items: flex-start;
  gap: var(--nv-space-4);
}

.supporting-tool__body {
  display: flex;
  flex-direction: column;
  gap: var(--nv-space-2);
  min-width: 0;
}

.supporting-tool__title {
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  color: var(--nv-text-primary);
}

.supporting-tool__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--nv-space-2);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--nv-text-brand);
  text-decoration: none;
}

.supporting-tool__cta:hover {
  text-decoration: underline;
}

.supporting-tool__cta:hover .icon {
  transform: translateX(2px);
  transition: transform 0.15s ease;
}

/* ==========================================================================
   Ribbon actions (index page — describes the three Novata-tab buttons)
   ========================================================================== */

.ribbon-actions {
  display: flex;
  flex-direction: column;
  gap: var(--nv-space-5);
  margin-top: var(--nv-space-5);
}

.ribbon-action {
  display: flex;
  align-items: flex-start;
  gap: var(--nv-space-4);
  padding: var(--nv-space-5);
  background: var(--nv-bg-info);
  border-radius: var(--nv-radius-md);
}

.ribbon-action__body {
  display: flex;
  flex-direction: column;
  gap: var(--nv-space-2);
  flex: 1;
  min-width: 0;
}

.ribbon-action__title {
  display: block;
  margin: 0;
  color: var(--nv-text-primary);
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
}

.ribbon-action__description,
.ribbon-action__hint {
  margin: 0;
  color: var(--nv-text-secondary);
  font-size: 14px;
  line-height: 20px;
}

.ribbon-action__hint {
  color: var(--nv-text-tertiary);
}

.ribbon-action__hint strong {
  color: var(--nv-text-primary);
}

/* ==========================================================================
   Tabbed section (index page — Available functions)
   ========================================================================== */

/* Tabbed sections drop the standard section padding so tabs can sit flush
   with the card edge, with a single divider line beneath them. */
.section--tabbed {
  padding: 0;
  overflow: hidden;
}

/* Header block above the tabs — explains how to use the functions so the
   tabs make sense before the user clicks one. */
.tabs-header {
  padding: var(--nv-space-7) var(--nv-space-7) var(--nv-space-5);
}

.tabs-header h2 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  color: var(--nv-text-primary);
  margin: 0 0 var(--nv-space-3);
  letter-spacing: -0.01em;
}

.tabs-header .description {
  margin: 0;
  max-width: 760px;
}

.tablist {
  display: flex;
  gap: var(--nv-space-6);
  padding: 0 var(--nv-space-7);
  border-bottom: 1px solid var(--nv-border-weak);
  overflow-x: auto;
}

.tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: var(--nv-space-5) 0 var(--nv-space-4);
  margin-bottom: -1px;
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  color: var(--nv-text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--nv-space-3);
}

.tab:hover {
  color: var(--nv-text-primary);
}

.tab.is-active,
.tab[aria-selected="true"] {
  color: var(--nv-text-primary);
  font-weight: 600;
  border-bottom-color: var(--nv-border-brand);
}

.tab:focus-visible {
  outline: 2px solid var(--nv-border-brand);
  outline-offset: 4px;
  border-radius: var(--nv-radius-xs);
}

.tabpanels {
  padding: var(--nv-space-7);
}

.tabpanel {
  display: flex;
  flex-direction: column;
  gap: var(--nv-space-4);
}

.tabpanel[hidden] {
  display: none;
}

.tabpanel h2 {
  font-family: var(--nv-font-mono);
  font-size: 22px;
  line-height: 30px;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--nv-text-primary);
  display: block;
}

.tabpanel .description {
  margin: 0;
  max-width: 760px;
}

.tabpanel .syntax {
  margin: 0;
}

.card-cta {
  align-self: flex-start;
  font-weight: 600;
  color: var(--nv-text-brand);
  text-decoration: none;
  margin-top: var(--nv-space-2);
  display: inline-flex;
  align-items: center;
  gap: var(--nv-space-2);
}

.card-cta:hover {
  text-decoration: underline;
}

.card-cta:hover .icon {
  transform: translateX(2px);
  transition: transform 0.15s ease;
}

/* ==========================================================================
   Code & inline tokens
   ========================================================================== */

code {
  background: var(--nv-bg-neutral-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--nv-font-mono);
  font-size: 13px;
  color: var(--nv-text-brand);
  font-weight: 500;
}

.syntax {
  background: var(--nv-bg-info);
  border: 1px solid var(--nv-border-weak);
  border-left: 3px solid var(--nv-border-brand);
  padding: var(--nv-space-5);
  margin: var(--nv-space-5) 0;
  border-radius: var(--nv-radius-sm);
  font-family: var(--nv-font-mono);
  font-size: 14px;
  line-height: 22px;
  color: var(--nv-text-primary);
  overflow-x: auto;
}

/* ==========================================================================
   Section list/body content
   ========================================================================== */

.section ol,
.section ul {
  margin: 0 0 0 var(--nv-space-6);
  padding: 0;
  color: var(--nv-text-secondary);
}

.section li {
  margin-bottom: var(--nv-space-3);
  line-height: 26px;
  font-size: 16px;
}

.section li:last-child {
  margin-bottom: 0;
}

.section strong {
  color: var(--nv-text-primary);
  font-weight: 600;
}

.section.tips strong {
  color: var(--nv-text-success);
}

/* ==========================================================================
   Examples
   ========================================================================== */

/* Examples sit directly inside their parent section card. The .example-box
   and .note wrappers (used by per-function pages) are transparent — they
   stack their children with consistent spacing but don't draw their own
   box, so we never end up with a box-inside-a-box. */
.example-box,
.note {
  display: flex;
  flex-direction: column;
  gap: var(--nv-space-4);
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
}

.example-item {
  padding: var(--nv-space-5);
  background: var(--nv-bg-info);
  border-radius: var(--nv-radius-md);
  border: 1px solid var(--nv-border-weak);
}

.example-item + .example-item {
  margin-top: var(--nv-space-4);
}

.example-item h4 {
  color: var(--nv-text-primary);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: var(--nv-space-3);
}

.example-item p {
  color: var(--nv-text-secondary);
  font-size: 14px;
  line-height: 20px;
}

.example-item .formula {
  background: var(--nv-text-primary);
  color: var(--nv-corporate-cyan);
  padding: var(--nv-space-3) var(--nv-space-5);
  border-radius: var(--nv-radius-sm);
  font-family: var(--nv-font-mono);
  font-size: 13px;
  line-height: 20px;
  margin: var(--nv-space-3) 0;
  overflow-x: auto;
}

.example-item .result {
  background: var(--nv-bg-success);
  padding: var(--nv-space-3) var(--nv-space-4);
  border-radius: var(--nv-radius-sm);
  margin-top: var(--nv-space-3);
  border-left: 3px solid var(--nv-icon-success);
  font-size: 14px;
  color: var(--nv-text-primary);
}

.example-item .result strong {
  color: var(--nv-text-success);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.parameters-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: var(--nv-space-5) 0;
  border: 1px solid var(--nv-border-weak);
  border-radius: var(--nv-radius-md);
  overflow: hidden;
  font-size: 14px;
}

.parameters-table th {
  background: var(--nv-bg-info);
  color: var(--nv-text-primary);
  padding: var(--nv-space-4) var(--nv-space-5);
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--nv-border-weak);
}

.parameters-table td {
  padding: var(--nv-space-4) var(--nv-space-5);
  border-bottom: 1px solid var(--nv-border-weak);
  color: var(--nv-text-secondary);
}

.parameters-table tr:last-child td {
  border-bottom: none;
}

.parameters-table tr:hover td {
  background: var(--nv-bg-info);
}

.parameters-table code {
  background: rgba(6, 124, 193, 0.08);
  color: var(--nv-text-brand);
  padding: 2px 8px;
  font-weight: 500;
}

/* ==========================================================================
   Field list (per-function pages)
   ========================================================================== */

.field-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--nv-space-4);
  margin: var(--nv-space-5) 0;
}

.field-item {
  background: var(--nv-bg-surface);
  padding: var(--nv-space-4) var(--nv-space-5);
  border-radius: var(--nv-radius-sm);
  border: 1px solid var(--nv-border-weak);
  border-left: 3px solid var(--nv-border-brand);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.field-item:hover {
  box-shadow: var(--nv-shadow-sm);
  transform: translateX(2px);
}

.field-item code {
  display: block;
  font-weight: 600;
  color: var(--nv-text-brand);
  margin-bottom: var(--nv-space-2);
  font-size: 13px;
  background: none;
  padding: 0;
}

.field-item .field-desc {
  font-size: 13px;
  color: var(--nv-text-secondary);
  line-height: 18px;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  margin-left: var(--nv-space-3);
  vertical-align: middle;
}

.badge.required {
  background: #fde7ec;
  color: #b6244f;
}

.badge.optional {
  background: var(--nv-bg-neutral-light);
  color: var(--nv-text-secondary);
}

/* ==========================================================================
   Links & footer
   ========================================================================== */

a {
  color: var(--nv-text-brand);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

a:hover {
  color: #045a8d;
  text-decoration: underline;
}

.footer {
  text-align: center;
  color: var(--nv-text-tertiary);
  font-size: 14px;
  padding: var(--nv-space-5) 0;
}

.footer p + p {
  margin-top: var(--nv-space-2);
}

.footer a {
  color: var(--nv-text-brand);
  font-weight: 500;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
  body {
    padding: var(--nv-space-4) var(--nv-space-3);
  }
  .hero,
  .header {
    padding: var(--nv-space-7) var(--nv-space-6);
  }
  .hero h1 {
    font-size: 28px;
    line-height: 36px;
  }
  .header h1 {
    font-size: 24px;
    line-height: 32px;
  }
  .section {
    padding: var(--nv-space-6);
  }
  .field-list {
    grid-template-columns: 1fr;
  }
  .tabs-header {
    padding: var(--nv-space-6) var(--nv-space-5) var(--nv-space-4);
  }
  .tablist {
    padding-left: var(--nv-space-5);
    padding-right: var(--nv-space-5);
    gap: var(--nv-space-5);
  }
  .tabpanels {
    padding: var(--nv-space-6);
  }
  .parameters-table {
    font-size: 13px;
  }
}
