/**
 * Knowledge Base Stylesheet
 * Separate CSS file for knowledge base/help center section
 * Uses .kb- prefix namespace to avoid conflicts with main site styles
 */

/* Smooth scroll when navigating to hash targets (e.g. marketplace section) */
html {
  scroll-behavior: smooth;
}

/* ========================================
   BASE VARIABLES
   ======================================== */
/* Edit these variables to change global styling */

:root {
  /* Colors */
  --kb-primary: #00B899;
  --kb-primary-dark: #764ba2;
  --kb-text-dark: #001B1B;
  --kb-text-medium: #3B5450;
  --kb-text-light: #00B899;
  --kb-text-teal-dark: #007269;
  --kb-bg-main: #f9fafb;
  --kb-bg-white: #ffffff;
  --kb-bg-light-teal: #E5FFFB;
  --kb-border-light: #e2e8f0;
  --kb-hover-bg: #f0f4ff;
  --kb-mark-bg: #fef3c7;
  --kb-code-bg: #f1f5f9;
  --kb-pre-bg: #1e293b;
  --kb-pre-text: #e2e8f0;
  --kb-table-stripe: #f8fafc;
  --kb-strong-color: var(--kb-text-light);
  --kb-italic-color: var(--kb-text-medium);

  /* Spacing */
  --kb-container-max-width: 900px;
  --kb-section-spacing: 30px;
  --kb-article-padding: 30px;
  --kb-article-margin-bottom: 25px;

  /* Typography */
  --kb-line-height: 1.7;
  --kb-h1-size: 2.5em;
  --kb-h2-size: 1.5em;
}

/* ========================================
   KB DOT GRID BACKGROUND (light version of contact page animation)
   ======================================== */
/* Animated circle positions for mask – namespaced to avoid conflicts with style.css */
@property --kb-circle-x { syntax: "<percentage>"; inherits: false; initial-value: 80%; }
@property --kb-circle-y { syntax: "<percentage>"; inherits: false; initial-value: 50%; }
@property --kb-circle2-x { syntax: "<percentage>"; inherits: false; initial-value: 25%; }
@property --kb-circle2-y { syntax: "<percentage>"; inherits: false; initial-value: 75%; }
@property --kb-circle3-x { syntax: "<percentage>"; inherits: false; initial-value: 70%; }
@property --kb-circle3-y { syntax: "<percentage>"; inherits: false; initial-value: 25%; }

/* Only apply dot grid when KB main is present (all knowledge base pages) */
body:has(.kb-main) {
  position: relative;
  background: #F9FAFB;
}

body:has(.kb-main)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #F9FAFB;
  /* Animated gradient (like kb-header) – gradient applies to all dots simultaneously */
  background-image: linear-gradient(135deg, #002C2C 0%, #00B899 50%, #1E2739 100%);
  background-size: 200% 200%;
  background-position: 0% 50%;
  background-repeat: repeat;
  --kb-circle-radius: 37.5%;
  /* Mask: dot pattern (gradient shows through dots) + three circles (visible only outside circles) */
  -webkit-mask-image:
    radial-gradient(circle at center, black 1px, transparent 1px),
    radial-gradient(
      circle at var(--kb-circle-x) var(--kb-circle-y),
      transparent 0%,
      transparent 8%,
      rgba(0, 0, 0, 0.4) 16%,
      black var(--kb-circle-radius)
    ),
    radial-gradient(
      circle at var(--kb-circle2-x) var(--kb-circle2-y),
      transparent 0%,
      transparent 8%,
      rgba(0, 0, 0, 0.4) 16%,
      black var(--kb-circle-radius)
    ),
    radial-gradient(
      circle at var(--kb-circle3-x) var(--kb-circle3-y),
      transparent 0%,
      transparent 8%,
      rgba(0, 0, 0, 0.4) 16%,
      black var(--kb-circle-radius)
    );
  mask-image:
    radial-gradient(circle at center, black 1px, transparent 1px),
    radial-gradient(
      circle at var(--kb-circle-x) var(--kb-circle-y),
      transparent 0%,
      transparent 8%,
      rgba(0, 0, 0, 0.4) 16%,
      black var(--kb-circle-radius)
    ),
    radial-gradient(
      circle at var(--kb-circle2-x) var(--kb-circle2-y),
      transparent 0%,
      transparent 8%,
      rgba(0, 0, 0, 0.4) 16%,
      black var(--kb-circle-radius)
    ),
    radial-gradient(
      circle at var(--kb-circle3-x) var(--kb-circle3-y),
      transparent 0%,
      transparent 8%,
      rgba(0, 0, 0, 0.4) 16%,
      black var(--kb-circle-radius)
    );
  mask-composite: intersect;
  -webkit-mask-size: 28px 28px, 100% 100%, 100% 100%, 100% 100%;
  mask-size: 28px 28px, 100% 100%, 100% 100%, 100% 100%;
  -webkit-mask-position: 0 0, 0 0, 0 0, 0 0;
  mask-position: 0 0, 0 0, 0 0, 0 0;
  -webkit-mask-repeat: repeat, no-repeat, no-repeat, no-repeat;
  mask-repeat: repeat, no-repeat, no-repeat, no-repeat;
  animation: kbDotGridCircleMove 26s linear infinite, kbDotGridGradientShift 16s ease infinite;
}

/* Gradient moves across the dots (like header) */
@keyframes kbDotGridGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes kbDotGridCircleMove {
  0%   { --kb-circle-x: 80%; --kb-circle-y: 50%; --kb-circle2-x: 25%; --kb-circle2-y: 75%; --kb-circle3-x: 70%; --kb-circle3-y: 25%; }
  25%  { --kb-circle-x: 50%; --kb-circle-y: 20%; --kb-circle2-x: 15%; --kb-circle2-y: 50%; --kb-circle3-x: 85%; --kb-circle3-y: 50%; }
  50%  { --kb-circle-x: 20%; --kb-circle-y: 50%; --kb-circle2-x: 35%; --kb-circle2-y: 25%; --kb-circle3-x: 55%; --kb-circle3-y: 75%; }
  75%  { --kb-circle-x: 50%; --kb-circle-y: 80%; --kb-circle2-x: 50%; --kb-circle2-y: 15%; --kb-circle3-x: 25%; --kb-circle3-y: 55%; }
  100% { --kb-circle-x: 80%; --kb-circle-y: 50%; --kb-circle2-x: 25%; --kb-circle2-y: 75%; --kb-circle3-x: 70%; --kb-circle3-y: 25%; }
}

@media (prefers-reduced-motion: reduce) {
  body:has(.kb-main)::before {
    animation: none;
  }
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: var(--kb-line-height);
  color: var(--kb-text-dark);
  margin: 0;
  padding: 0;
  padding-top: calc(84px + 20px); /* Header height + original padding */
  background: var(--kb-bg-main);
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 100vh;
}

/* Main content wrapper: grows to push footer down, maintains consistent width for children */
.kb-main {
  flex: 1 0 auto;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Sticky footer: push footer to bottom when content is short */
#footer-placeholder {
  margin-top: auto;
}

/* Header and footer extend to full width */
#header-placeholder,
.site-header,
#footer-placeholder,
.site-footer {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Content wrapper to constrain width - target both body and kb-main for backward compatibility */
body > .kb-header,
body > .kb-nav-categories,
body > .kb-toc,
body > .kb-button-section,
body > .kb-article,
body > .article,
body > #articles-container,
.kb-main > .kb-header,
.kb-main > .kb-nav-categories,
.kb-main > .kb-toc,
.kb-main > .kb-button-section,
.kb-main > .kb-article,
.kb-main > .article,
.kb-main > #articles-container {
  max-width: var(--kb-container-max-width);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}

/* Adjust top padding on mobile for smaller header */
@media (max-width: 880px) {
  body {
    padding-top: calc(72px + 20px); /* Mobile header height + original padding */
  }
}

/* Adjust for height-constrained screens */
@media (min-width: 881px) and (max-height: 900px) {
  body {
    padding-top: calc(72px + 20px); /* Height-constrained header height + original padding */
  }
}

@media (min-width: 881px) and (max-height: 800px) {
  body {
    padding-top: calc(52px + 20px); /* Very short screen header height + original padding */
  }
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

/* Knowledge Base Header Banner */
.kb-header {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #002C2C 0%, #00B899 50%, #1E2739 100%);
  background-size: 200% 200%;
  animation: gradientShift 16s ease infinite;
  color: white;
  border-radius: 12px;
  margin-bottom: var(--kb-section-spacing);
}

/* Smooth gradient animation that shifts the background position */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.kb-header h1 {
  margin: 0 0 10px 0;
  font-size: var(--kb-h1-size);
  color: white;
}

.kb-header p {
  margin: 0;
  opacity: 0.9;
}

/* Clickable header link – returns to KB home on all KB pages */
.kb-header-link,
.kb-header-link:hover,
.kb-header-link:focus,
.kb-header-link:active,
.kb-header-link:visited {
  text-decoration: none;
  color: inherit;
}

.kb-header-link {
  display: block;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.kb-header-link:hover {
  opacity: 0.92;
}

.kb-header-link h1,
.kb-header-link p,
.kb-header-link:hover h1,
.kb-header-link:hover p,
.kb-header-link:focus h1,
.kb-header-link:focus p,
.kb-header-link:active h1,
.kb-header-link:active p,
.kb-header-link:visited h1,
.kb-header-link:visited p {
  text-decoration: none;
  color: inherit;
}

/* Navigation Categories (Knowledge Base, Help Center, FAQ) */
.kb-nav-categories {
  background: transparent;
  padding: 0;
  margin-bottom: var(--kb-section-spacing);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.kb-nav-item {
  min-width: 0;
}

.kb-nav-item a {
  display: block;
  padding: 18px 24px;
  background: var(--kb-bg-white);
  border: 2px solid var(--kb-border-light);
  border-radius: 8px;
  color: var(--kb-text-medium);
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kb-nav-item a:hover {
  background: var(--kb-hover-bg);
  border-color: var(--kb-primary);
  color: var(--kb-primary);
  box-shadow: 0 2px 8px rgba(0, 184, 153, 0.15);
  transform: translateY(-1px);
}

.kb-nav-item a:active {
  transform: translateY(0);
}

/* Mobile / Desktop User Guide items: subtle cyan tint so they stand out */
.kb-nav-item a[href*="user-guide-mobile"],
.kb-nav-item a[href*="user-guide-desktop"] {
  background: #E8F5F3;
  border-color: #7DD4C8;
}

/* User Guide items with image below (like users.html category boxes) - whole card is clickable */
.kb-nav-item--with-image {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  border: 2px solid var(--kb-border-light);
  border-radius: 8px;
  overflow: hidden;
  background: var(--kb-bg-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

.kb-nav-item--with-image:hover,
.kb-nav-item--with-image:focus {
  border-color: var(--kb-primary);
  color: var(--kb-primary);
  box-shadow: 0 2px 8px rgba(0, 184, 153, 0.15);
  transform: translateY(-1px);
}

.kb-nav-item--with-image:active {
  transform: translateY(0);
}

.kb-nav-item-label {
  flex-shrink: 0;
  display: block;
  padding: 18px 24px;
  background: #E8F5F3;
  border-color: #7DD4C8;
  color: var(--kb-text-medium);
  text-align: center;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.kb-nav-item--with-image:hover .kb-nav-item-label,
.kb-nav-item--with-image:focus .kb-nav-item-label {
  background: var(--kb-hover-bg);
  color: var(--kb-primary);
}

.kb-nav-item--with-image.active .kb-nav-item-label {
  background: var(--kb-primary);
  border-color: var(--kb-primary);
  color: white;
}

.kb-nav-item--with-image.active {
  border-color: var(--kb-primary);
  box-shadow: 0 2px 8px rgba(0, 184, 153, 0.25);
}

.kb-nav-item--with-image.active:hover {
  box-shadow: 0 2px 12px rgba(0, 184, 153, 0.35);
}

.kb-nav-item-image {
  flex: 1;
  min-height: 0;
  background: var(--kb-bg-white);
  overflow: hidden;
  transition: background 0.2s;
}

.kb-nav-item-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  object-position: top center;
}

@media (min-width: 600px) {
  .kb-nav-item-image img {
    max-height: 260px;
  }
}

/* Active state for navigation items */
.kb-nav-item a.active {
  background: var(--kb-primary);
  border-color: var(--kb-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 184, 153, 0.25);
}

.kb-nav-item a.active:hover {
  background: #00A085;
  border-color: #00A085;
  color: white;
  box-shadow: 0 2px 12px rgba(0, 184, 153, 0.35);
}

/* Table of Contents */
.kb-toc {
  background: var(--kb-bg-white);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: var(--kb-section-spacing);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kb-toc h2 {
  margin-top: 0;
  color: var(--kb-primary);
  border-bottom: 2px solid var(--kb-primary);
  padding-bottom: 10px;
}

/* Reusable Button Navigation Section (for Marketplaces, etc.) */
.kb-button-section {
  background: var(--kb-bg-white);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: var(--kb-section-spacing);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Scroll target for marketplace nav - keeps section visible below fixed header */
#kb-marketplaces {
  scroll-margin-top: 100px;
}

/* Scroll target for TOC links - offset for fixed header so article title stays visible */
.kb-article {
  scroll-margin-top: calc(var(--header-height, 84px) + 24px);
}

/* In-article section targets (user guide chapter TOC) - same offset so header doesn't cover section */
.kb-article [id^="section-"] {
  scroll-margin-top: calc(var(--header-height, 84px) + 24px);
}

/* Platform links (iOS / Android) - side-by-side buttons above Introduction */
.kb-platform-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0 24px 0;
}
.kb-platform-btn {
  display: inline-block;
  padding: 12px 20px;
  background: var(--kb-primary);
  color: var(--kb-bg-white) !important;
  font-weight: 600;
  text-decoration: none !important;
  border-radius: 8px;
  border: 2px solid var(--kb-primary);
  transition: background 0.2s, color 0.2s;
}
.kb-platform-btn:hover,
.kb-platform-btn:visited {
  color: var(--kb-bg-white) !important;
  text-decoration: none !important;
}
.kb-platform-btn:hover {
  background: var(--kb-text-teal-dark);
  border-color: var(--kb-text-teal-dark);
}

.kb-button-section h2 {
  margin-top: 0;
  color: var(--kb-primary);
  border-bottom: 2px solid var(--kb-primary);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.kb-button-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.kb-button-item {
  min-width: 0;
}

.kb-button-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  background: var(--kb-bg-white);
  border: 2px solid var(--kb-border-light);
  border-radius: 8px;
  color: var(--kb-text-medium);
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  min-height: 60px;
}

.kb-button-item a img {
  max-width: 100%;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.kb-button-item a:hover {
  background: var(--kb-hover-bg);
  border-color: var(--kb-primary);
  color: var(--kb-primary);
  box-shadow: 0 2px 8px rgba(0, 184, 153, 0.15);
  transform: translateY(-1px);
}

.kb-button-item a:hover img {
  opacity: 0.9;
}

.kb-button-item a:active {
  transform: translateY(0);
}

.kb-button-item a.active {
  background: var(--kb-primary);
  border-color: var(--kb-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 184, 153, 0.25);
}

.kb-button-item a.active:hover {
  background: #00A085;
  border-color: #00A085;
  color: white;
  box-shadow: 0 2px 12px rgba(0, 184, 153, 0.35);
}

.kb-button-item a.active:hover img {
  opacity: 1;
}

/* Coming Soon - marketplaces without articles (Shopify, Meta, Depop, Whatnot) */
.kb-button-item--coming-soon {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

.kb-button-item--coming-soon .kb-button-item-disabled {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  background: var(--kb-bg-white);
  border: 2px solid var(--kb-border-light);
  border-radius: 8px;
  min-height: 60px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kb-button-item--coming-soon .kb-button-item-disabled img {
  max-width: 100%;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.kb-button-item--coming-soon .kb-coming-soon-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 6px;
}

@media (max-width: 600px) {
  .kb-button-item--coming-soon .kb-button-item-disabled {
    padding: 16px 20px;
    min-height: 56px;
  }

  .kb-button-item--coming-soon .kb-button-item-disabled img {
    max-height: 36px;
  }

  .kb-button-item--coming-soon .kb-coming-soon-label {
    font-size: 0.75rem;
  }
}

.kb-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 1;
}

/* User guide chapter TOC: two columns for top-level sections; indented subsections stay one column */
.kb-toc--chapters ul {
  columns: 2;
  column-gap: 24px;
}

.kb-toc--chapters ul ul {
  columns: 1;
}

@media (max-width: 600px) {
  .kb-toc ul {
    columns: 1;
  }

  .kb-toc--chapters ul {
    columns: 1;
  }
}

.kb-toc li {
  margin-bottom: 10px;
  break-inside: avoid;
}

/* Nested TOC (user guide: X.Y under X) – indent subsections */
.kb-toc--chapters ul ul {
  list-style: none;
  padding: 0;
  margin: 4px 0 0 0;
  margin-left: 1.25em;
  border-left: 1px solid var(--kb-border-light);
  padding-left: 12px;
}

.kb-toc--chapters ul ul li {
  margin-bottom: 6px;
}

.kb-toc a {
  color: var(--kb-text-medium);
  text-decoration: none;
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.kb-toc a:hover {
  background: var(--kb-hover-bg);
  color: var(--kb-primary);
}

/* ========================================
   ARTICLE CONTAINER
   ======================================== */

/* Articles container - holds dynamically loaded articles */
#articles-container {
  width: 100%;
  box-sizing: border-box;
}

.kb-article,
.article {
  background: var(--kb-bg-white);
  border-radius: 12px;
  padding: var(--kb-article-padding);
  margin-bottom: var(--kb-article-margin-bottom);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ========================================
   TYPOGRAPHY STANDARDIZATION
   Edit these styles to change typography across all articles
   ======================================== */

/* Headings */
.kb-article h1,
.article h1 {
  color: var(--kb-primary);
  margin-top: 30px;
  font-size: var(--kb-h1-size);
}

.kb-article h2,
.article h2 {
  color: var(--kb-primary);
  margin-top: 0;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--kb-border-light);
  font-size: var(--kb-h2-size);
}

.kb-article h2:not(:first-of-type) {
  margin-top: 30px;
  padding-bottom: 0;
  border-bottom: none;
}

.kb-article h3 {
  color: var(--kb-text-medium);
  margin-top: 25px;
}

.kb-article h4 {
  color: var(--kb-strong-color);
  margin-top: 20px;
  display: block;
}

/* Paragraphs */
.kb-article p {
  margin: 1em 0;
}

/* Links */
.kb-article a {
  color: var(--kb-primary);
  text-decoration: none;
  word-break: break-word;
}

.kb-article a:hover {
  text-decoration: underline;
}

/* Lists - support both .kb-article and .article classes */
.kb-article ul,
.kb-article ol,
.article ul,
.article ol {
  padding-left: 25px;
  margin: 1em 0;
}

.kb-article li,
.article li {
  margin-bottom: 8px;
}

.kb-article ul ul,
.article ul ul {
  margin-top: 8px;
}

/* ========================================
   STYLED NUMBERED LIST
   Similar to bullet lists, with customizable number styling
   ======================================== */
.kb-numbered-list {
  list-style: none;
  padding: 0;
  margin: 1em 0;
  counter-reset: kb-list-counter;
}

.kb-numbered-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 0;
  font-size: 0.95rem;
  color: var(--kb-text-dark);
  line-height: 1.6;
  counter-increment: kb-list-counter;
  position: relative;
  padding-left: 0;
}

.kb-numbered-list li::before {
  content: counter(kb-list-counter);
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  background: var(--kb-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Nested numbered lists */
.kb-numbered-list .kb-numbered-list {
  margin-top: 8px;
  margin-left: 20px;
  counter-reset: kb-list-counter;
}

.kb-numbered-list .kb-numbered-list li::before {
  background: var(--kb-text-medium);
  font-size: 0.75rem;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
}

/* Images */
.kb-article img,
.article img {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  margin: 15px 0;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  object-fit: contain;
}

/* Ensure article containers prevent image overflow */
.kb-article,
.article {
  overflow-x: hidden;
  word-wrap: break-word;
}

/* Strong/Bold */
.kb-article strong {
  color: var(--kb-strong-color);
}

/* Italics */
.kb-article em,
.kb-article i {
  color: var(--kb-italic-color);
  font-style: italic;
}

/* ========================================
   ARTICLE METADATA
   ======================================== */

/* Article metadata container - works for both .kb-article and .article */
.kb-article .kb-article-meta,
.article .kb-article-meta {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--kb-border-light);
}

/* Article version */
.kb-article-version {
  display: block;
  font-size: 0.9em;
  color: var(--kb-text-medium);
  margin-bottom: 5px;
}

/* Article last updated date */
.kb-article-updated {
  display: block;
  font-size: 0.9em;
  color: var(--kb-text-medium);
  margin-bottom: 5px;
}

/* Article title (in metadata section) */
.kb-article-author {
  display: block;
  font-size: 1.1em;
  font-weight: 600;
  color: var(--kb-primary);
  margin-bottom: 0;
}

/* ========================================
   CONTENT ELEMENTS
   ======================================== */

/* Tables */
.kb-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95em;
}

.kb-article th,
.kb-article td {
  padding: 12px 15px;
  text-align: left;
  border: 1px solid var(--kb-border-light);
  vertical-align: top;
}

.kb-article th {
  background: var(--kb-primary);
  color: white;
  font-weight: 600;
}

.kb-article tr:nth-child(even) {
  background: var(--kb-table-stripe);
}

/* Code */
.kb-article code {
  background: var(--kb-code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.9em;
}

.kb-article pre {
  background: var(--kb-pre-bg);
  color: var(--kb-pre-text);
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
}

.kb-article pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Images */
.kb-article img {
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  border-radius: 8px;
  margin: 15px 0;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mark/Highlight */
.kb-article mark {
  background: var(--kb-mark-bg);
  padding: 2px 4px;
  border-radius: 3px;
}

/* Video Container */
.kb-video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.kb-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ========================================
   CONTENT BOXES (Tip, Warning, Note, etc.)
   Extensible system for styled content boxes
   ======================================== */

/* Base box styles - all content boxes share these */
.kb-tip-box,
.kb-steps-box,
.kb-warning-box,
.kb-note-box,
.kb-info-box {
  background: var(--kb-bg-white);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid;
  position: relative;
}

/* Tip Box - Primary green theme */
.kb-tip-box {
  border-left-color: var(--kb-primary);
  background: rgba(0, 184, 153, 0.08);
  color: var(--kb-text-teal-dark);
  line-height: 1.6;
}

/* Tip box header with icon and label */
.kb-tip-box::before {
  content: "Tip:";
  font-weight: 600;
  color: var(--kb-text-teal-dark);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  background-image: url('images/icon-tip.svg');
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 18px 18px;
  padding-left: 24px;
}

/* Tip box content */
.kb-tip-box p {
  margin: 0;
  color: var(--kb-text-teal-dark);
  line-height: 1.6;
}

.kb-tip-box p:not(:last-child) {
  margin-bottom: 8px;
}

/* Lists inside tip boxes */
.kb-tip-box ul,
.kb-tip-box ol {
  margin: 0;
  padding-left: 20px;
}

.kb-tip-box li {
  margin-bottom: 6px;
}

/* Style bullets in tip boxes to be teal */
.kb-tip-box ul li::marker {
  color: var(--kb-primary);
}

/* Steps Box - Blue theme (different from tip boxes) */
.kb-steps-box {
  border: 1px solid var(--kb-primary);
  background: var(--kb-bg-light-teal);
  color: var(--kb-text-teal-dark);
  line-height: 1.6;
}

/* Steps box header with icon and label */
.kb-steps-box::before {
  content: attr(data-steps-title, "Steps:");
  font-weight: 600;
  color: var(--kb-text-teal-dark);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  background-image: url('images/icon-steps.svg');
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 18px 18px;
  padding-left: 24px;
}

/* Steps box content */
.kb-steps-box p {
  margin: 0;
  color: var(--kb-text-teal-dark);
  line-height: 1.6;
}

.kb-steps-box p:not(:last-child) {
  margin-bottom: 8px;
}

/* Lists inside steps boxes */
.kb-steps-box ul,
.kb-steps-box ol {
  margin: 0;
  padding-left: 20px;
}

.kb-steps-box li {
  margin-bottom: 6px;
}

/* First tier: numbered lists (ordered list style) */
.kb-steps-box > ul,
.kb-steps-box > ol {
  list-style-type: decimal;
}

.kb-steps-box > ul li::marker,
.kb-steps-box > ol li::marker {
  color: var(--kb-primary);
  font-weight: 600;
}

/* Second tier: closed bullet points (disc) */
.kb-steps-box ul ul,
.kb-steps-box ol ul {
  list-style-type: disc;
}

.kb-steps-box ul ul li::marker,
.kb-steps-box ol ul li::marker {
  color: var(--kb-primary);
}

/* Third tier: outline bullets (circle) */
.kb-steps-box ul ul ul,
.kb-steps-box ol ul ul {
  list-style-type: circle;
}

.kb-steps-box ul ul ul li::marker,
.kb-steps-box ol ul ul li::marker {
  color: var(--kb-primary);
}

/* Warning Box - Orange/amber theme (for future use) */
.kb-warning-box {
  border-left-color: #F59E0B;
  background: rgba(245, 158, 11, 0.08);
}

.kb-warning-box::before {
  content: "⚠️ Warning:";
  font-weight: 600;
  color: #F59E0B;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 10px;
}

.kb-warning-box p {
  margin: 0;
  color: var(--kb-text-dark);
  line-height: 1.6;
}

.kb-warning-box p:not(:last-child) {
  margin-bottom: 8px;
}

.kb-warning-box {
  color: var(--kb-text-dark);
  line-height: 1.6;
}

/* Note Box - Blue theme (for future use) */
.kb-note-box {
  border-left-color: #3B82F6;
  background: rgba(59, 130, 246, 0.08);
}

.kb-note-box::before {
  content: "ℹ️ Note:";
  font-weight: 600;
  color: #3B82F6;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 10px;
}

.kb-note-box p {
  margin: 0;
  color: var(--kb-text-dark);
  line-height: 1.6;
}

.kb-note-box p:not(:last-child) {
  margin-bottom: 8px;
}

.kb-note-box {
  color: var(--kb-text-dark);
  line-height: 1.6;
}

/* Info Box - Neutral theme (for future use) */
.kb-info-box {
  border-left-color: var(--kb-text-medium);
  background: rgba(59, 84, 80, 0.08);
}

.kb-info-box::before {
  content: "ℹ️ Info:";
  font-weight: 600;
  color: var(--kb-text-medium);
  font-size: 0.95rem;
  display: block;
  margin-bottom: 10px;
}

.kb-info-box p {
  margin: 0;
  color: var(--kb-text-dark);
  line-height: 1.6;
}

.kb-info-box p:not(:last-child) {
  margin-bottom: 8px;
}

.kb-info-box {
  color: var(--kb-text-dark);
  line-height: 1.6;
}

/* ========================================
   FAQ BOX (Knowledge Base Q&A)
   Always-visible, non-collapsible for SEO, search, and navigation.
   Stylistically aligned with tip/steps boxes but distinct (FAQ accent).
   ======================================== */

.kb-faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}

.kb-faq-entry {
  background: var(--kb-bg-white);
  border-radius: 12px;
  padding: 12px 20px 18px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-top: 4px solid var(--kb-primary-dark);
  position: relative;
  color: var(--kb-text-dark);
  line-height: 1.6;
}

.kb-faq-q {
  margin: 0 0 10px 0;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--kb-text-teal-dark);
}

.kb-faq-q strong {
  color: var(--kb-text-teal-dark);
}

.kb-faq-a {
  margin: 0;
}

.kb-faq-a p {
  margin: 0 0 8px 0;
  color: var(--kb-text-dark);
  line-height: 1.6;
}

.kb-faq-a p:last-child {
  margin-bottom: 0;
}

.kb-faq-a ul,
.kb-faq-a ol {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.kb-faq-a li {
  margin-bottom: 6px;
}

.kb-faq-a ul li::marker {
  color: var(--kb-primary-dark);
}

.kb-faq-a ol li::marker {
  color: var(--kb-primary-dark);
  font-weight: 600;
}

.kb-faq-a a {
  color: var(--kb-primary);
  text-decoration: underline;
}

.kb-faq-a a:hover {
  color: var(--kb-primary-dark);
}

/* Section headers within FAQ article (e.g. "1. General & Company") */
.kb-faq-section {
  margin: 24px 0 12px 0;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--kb-text-teal-dark);
}

.kb-faq-section:first-of-type {
  margin-top: 0;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Back to Top Button */
.kb-back-to-top {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 16px;
  background: var(--kb-hover-bg);
  color: var(--kb-primary);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9em;
  transition: all 0.2s;
}

.kb-back-to-top:hover {
  background: var(--kb-primary);
  color: white;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Mobile compatibility layer - simple and flexible */
@media (max-width: 880px) {
  .kb-main {
    flex: 1 1 auto;
  }
  
  /* On mobile, footer flows after main instead of sticking to viewport bottom */
  #footer-placeholder {
    margin-top: 0;
  }
  
  /* Remove rounded corners from main containers on mobile */
  .kb-header {
    border-radius: 0;
  }
  
  .kb-nav-categories {
    grid-template-columns: 1fr;
    padding: 0;
  }
  
  .kb-nav-item a {
    padding: 16px 20px;
  }
  
  .kb-button-grid {
    grid-template-columns: 1fr;
  }
  
  .kb-button-item a {
    padding: 16px 20px;
    min-height: 56px;
  }
  
  .kb-button-item a img {
    max-height: 36px;
  }
  
  .kb-toc {
    border-radius: 0;
  }
  
  .kb-button-section {
    border-radius: 0;
  }
  
  .kb-article,
  .article {
    border-radius: 0;
  }
  
  /* Ensure articles container has proper spacing and visible height on mobile */
  body > #articles-container,
  .kb-main > #articles-container {
    min-height: 180px;
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Keep rounded corners on inner containers (tip boxes, steps boxes, etc.) */
  /* These are intentionally not included in the above rules */
}

/* Mobile table overflow */
@media (max-width: 600px) {
  .kb-article table {
    display: block;
    overflow-x: auto;
  }
}

/* ========================================
   HEADER BUTTONS - Knowledge Base Styling
   ======================================== */

/* Header primary button - use KB primary color (cyan) */
.site-header .btn-primary {
  background: var(--kb-primary) !important;
  color: var(--white) !important;
}

.site-header .btn-primary:hover {
  background: #00A085 !important; /* Slightly darker teal on hover */
  color: var(--white) !important;
}

/* Header chat button - use KB primary color (cyan) */
.site-header .header-chat-btn {
  background: var(--kb-primary) !important;
}

.site-header .header-chat-btn:hover {
  box-shadow: 0 4px 12px rgba(0, 184, 153, 0.4) !important;
}
