/* ═══════════════════════════════════════════════════════
   FORMDOCK HELP CENTER – style.css
   Primary: #1e3a5f | Secondary: #5b8def | Accent: #198754
   ═══════════════════════════════════════════════════════ */

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a1a;
  background: #f7f8fa;
}
a { color: #5b8def; text-decoration: none; }
a:hover { color: #1e3a5f; text-decoration: underline; }
img { max-width: 100%; height: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ─── Header ─── */
.site-header {
  background: #1e3a5f;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.logo:hover { color: #fff; text-decoration: none; }
.logo-text { letter-spacing: -0.5px; }
.helpcenter-badge {
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Header Search */
.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.header-search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  outline: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.header-search-input::placeholder {
  color: rgba(255,255,255,0.5);
}
.header-search-input:focus {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 0 0 3px rgba(91,141,239,0.2);
}
.header-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  pointer-events: none;
}

.main-nav {
  flex-shrink: 0;
}
.main-nav a {
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a:hover { color: #fff; text-decoration: none; }

/* ─── Site Main ─── */
.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  min-height: calc(100vh - 56px - 60px);
}

/* ─── Hero Section (Index only) ─── */
.hero {
  text-align: center;
  padding: 48px 0 40px;
}
.hero-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 24px;
}
.hero-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  font-size: 1rem;
  border: 2px solid #dde1e7;
  border-radius: 12px;
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  border-color: #5b8def;
  box-shadow: 0 0 0 3px rgba(91,141,239,0.15);
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #9ca3af;
  pointer-events: none;
}

/* ─── Category Grid ─── */
.categories { padding-bottom: 40px; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ─── Category Card ─── */
.category-card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.15s;
}
.category-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.category-card i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: #eef3ff;
  color: #5b8def;
  border-radius: 10px;
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.category-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: #1e3a5f;
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-card p {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0 0 10px;
  line-height: 1.5;
}
.category-card .count {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* ─── Badge (Neu) ─── */
.category-card .badge,
.hc-badge {
  display: inline-block;
  background: #198754;
  color: #fff;
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

/* ─── Breadcrumb ─── */
.breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 24px;
  color: #6b7280;
}
.breadcrumb a { color: #5b8def; }
.breadcrumb a:hover { color: #1e3a5f; }
.breadcrumb-sep { margin: 0 6px; color: #d1d5db; }
.breadcrumb-current { color: #374151; font-weight: 500; }

/* ─── Collection Page ─── */
.collection-header {
  text-align: center;
  padding: 32px 0 28px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 28px;
}
.collection-icon i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: #eef3ff;
  color: #5b8def;
  border-radius: 14px;
  font-size: 1.5rem;
  margin-bottom: 14px;
}
.collection-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 8px;
}
.collection-description {
  font-size: 0.95rem;
  color: #6b7280;
  margin: 0 0 8px;
}
.collection-count {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0;
}

/* ─── Article List (Collection page) ─── */
.articles-list {
  max-width: 720px;
  margin: 0 auto;
}
.articles-list article {
  border-bottom: 1px solid #f0f1f3;
}
.articles-list article:last-child { border-bottom: none; }
.articles-list article a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 12px;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s;
}
.articles-list article a:hover {
  background: #f0f4ff;
  text-decoration: none;
}
.articles-list article a::after {
  content: '›';
  font-size: 1.2rem;
  color: #d1d5db;
  flex-shrink: 0;
  margin-left: 12px;
}
.articles-list article h4 {
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
  color: #1e3a5f;
}
.articles-list article p {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 4px 0 0;
}

/* ═══════════════════════════════════════════════════════
   ARTICLE LAYOUT – Two-column with sidebar
   ═══════════════════════════════════════════════════════ */

.article-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.article-main {
  flex: 1;
  min-width: 0;
}

/* ─── Article Sidebar (right) ─── */
.article-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 76px; /* header 56px + 20px gap */
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e3a5f;
}
.sidebar-header i {
  font-size: 1rem;
  color: #5b8def;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

a.sidebar-link {
  display: block;
  padding: 7px 10px;
  font-size: 0.8rem;
  color: #4b5563;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}
a.sidebar-link:hover {
  background: #f0f4ff;
  color: #1e3a5f;
  text-decoration: none;
}

.sidebar-item.is-current {
  margin: 2px 0;
}

span.sidebar-link.active {
  display: block;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e3a5f;
  background: #eef3ff;
  border-radius: 6px;
  border-left: 3px solid #5b8def;
  line-height: 1.4;
}

/* ─── TOC inside sidebar ─── */
.sidebar-toc {
  list-style: none;
  margin: 4px 0 4px 0;
  padding: 0;
}
.sidebar-toc li {
  margin: 0;
}
.sidebar-toc li a {
  display: block;
  padding: 4px 10px 4px 20px;
  font-size: 0.75rem;
  color: #6b7280;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  line-height: 1.5;
}
.sidebar-toc li a:hover {
  color: #1e3a5f;
  background: #f0f4ff;
  text-decoration: none;
}
.sidebar-toc li.toc-sub a {
  padding-left: 32px;
  font-size: 0.72rem;
  color: #9ca3af;
}
.sidebar-toc li.toc-sub a:hover {
  color: #6b7280;
}

/* ─── Scrollbar styling for sidebar ─── */
.article-sidebar::-webkit-scrollbar {
  width: 4px;
}
.article-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.article-sidebar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}

/* ─── Article Content ─── */
.article-content {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px 36px;
}
.article-content h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #eef3ff;
}
.article-content h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1e3a5f;
  margin: 28px 0 12px;
  scroll-margin-top: 76px;
}
.article-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin: 20px 0 8px;
  scroll-margin-top: 76px;
}
.article-content p {
  margin: 0 0 14px;
  color: #374151;
}
.article-content ul, .article-content ol {
  margin: 0 0 14px;
  padding-left: 24px;
}
.article-content li {
  margin-bottom: 6px;
  color: #374151;
}
.article-content strong { color: #1a1a1a; }

/* Blockquotes as Info Boxes */
.article-content blockquote {
  margin: 16px 0;
  padding: 14px 18px;
  background: #f0f7ff;
  border-left: 4px solid #5b8def;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: #1e3a5f;
}
.article-content blockquote p { margin: 0; color: inherit; }
.article-content blockquote strong { color: #1e3a5f; }

/* Code Blocks */
.article-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'SF Mono', Consolas, monospace;
  color: #c7254e;
}
.article-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}
.article-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.85rem;
}

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}
.article-content th, .article-content td {
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  text-align: left;
}
.article-content th {
  background: #f8f9fa;
  font-weight: 600;
  color: #1e3a5f;
}
.article-content tr:nth-child(even) td { background: #fafbfc; }

/* ─── Search Results Dropdown ─── */
#hc-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  margin-top: 6px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}
.hc-search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: inherit;
  text-decoration: none;
  transition: background 0.1s;
}
.hc-search-result-item:last-child { border-bottom: none; }
.hc-search-result-item:hover,
.hc-search-result-item.hc-search-active {
  background: #f0f4ff;
  text-decoration: none;
}
.hc-search-result-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #1e3a5f;
}
.hc-search-result-category {
  font-size: 0.7rem;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-left: 10px;
}
.hc-search-highlight {
  background: #fef3c7;
  font-weight: 600;
  border-radius: 2px;
}
.hc-search-no-results {
  padding: 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
}

/* ─── Feedback ─── */
.article-feedback {
  margin: 24px 0;
  text-align: center;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.feedback-question {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0 0 12px;
}
.feedback-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.feedback-btn {
  padding: 8px 24px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  color: #374151;
  transition: background 0.15s, border-color 0.15s;
}
.feedback-btn:hover {
  background: #f0f4ff;
  border-color: #5b8def;
  color: #1e3a5f;
}

/* ─── Back Link ─── */
.back-link {
  margin: 16px 0 40px;
}
.back-link a {
  font-size: 0.85rem;
  color: #5b8def;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.back-link a:hover { color: #1e3a5f; }

/* ─── Footer ─── */
.site-footer {
  background: #1e293b;
  color: rgba(255,255,255,0.6);
  padding: 20px 0;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}
.footer-brand { font-weight: 500; }
.footer-nav {
  display: flex;
  gap: 20px;
}
.footer-nav a {
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
}
.footer-nav a:hover { color: #fff; text-decoration: none; }

/* ═══════════════════════════════════════════════════════
   FLOW DIAGRAMS – Visual process flows
   ═══════════════════════════════════════════════════════ */

.flow-diagram {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 24px 16px;
  margin: 16px 0;
  background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
  border: 1px solid #e0e7f5;
  border-radius: 12px;
  overflow-x: auto;
}

/* Source group (multiple inputs stacked) */
.flow-sources {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* Individual flow box */
.flow-box {
  min-width: 130px;
  max-width: 160px;
  padding: 12px 14px;
  border-radius: 10px;
  text-align: center;
  flex-shrink: 0;
  border: 1.5px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s;
}
.flow-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.flow-box-icon {
  margin-bottom: 6px;
}
.flow-box-icon i {
  font-size: 1.3rem;
}
.flow-box-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
}
.flow-box-detail {
  font-size: 0.68rem;
  line-height: 1.35;
  opacity: 0.75;
}

/* Box colors by type */
.flow-box.flow-source {
  background: #fff;
  border-color: #5b8def;
}
.flow-box.flow-source .flow-box-icon i { color: #5b8def; }
.flow-box.flow-source .flow-box-title { color: #1e3a5f; }
.flow-box.flow-source .flow-box-detail { color: #6b7280; }

.flow-box.flow-process {
  background: #fff;
  border-color: #f59e0b;
}
.flow-box.flow-process .flow-box-icon i { color: #f59e0b; }
.flow-box.flow-process .flow-box-title { color: #92400e; }
.flow-box.flow-process .flow-box-detail { color: #6b7280; }

.flow-box.flow-result {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #10b981;
}
.flow-box.flow-result .flow-box-icon i { color: #10b981; }
.flow-box.flow-result .flow-box-title { color: #065f46; }
.flow-box.flow-result .flow-box-detail { color: #047857; }

.flow-box.flow-large {
  min-width: 150px;
  max-width: 180px;
}

/* Arrow between boxes */
.flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  flex-shrink: 0;
}
.flow-arrow i {
  font-size: 1.1rem;
  color: #5b8def;
  opacity: 0.6;
}

/* Converge variant – sources feed into one target */
.flow-converge .flow-sources {
  gap: 6px;
}
.flow-converge .flow-sources .flow-box {
  min-width: 120px;
  max-width: 140px;
  padding: 8px 10px;
}
.flow-converge .flow-sources .flow-box-icon { margin-bottom: 3px; }
.flow-converge .flow-sources .flow-box-icon i { font-size: 1.1rem; }
.flow-converge .flow-sources .flow-box-title { font-size: 0.72rem; }
.flow-converge .flow-sources .flow-box-detail { font-size: 0.63rem; }

/* Steps variant – linear flow, wrap on small screens */
.flow-steps {
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.flow-steps .flow-box {
  min-width: 110px;
  max-width: 140px;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 1.6rem; }
  .article-content { padding: 24px 20px; }

  /* Sidebar below article on smaller screens */
  .article-layout {
    flex-direction: column;
  }
  .article-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    order: -1;
    margin-bottom: 20px;
  }
}
@media (max-width: 600px) {
  .category-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0 16px; gap: 12px; }
  .header-search { max-width: none; }
  .site-main { padding: 16px; }
  .hero { padding: 32px 0 24px; }
  .hero-title { font-size: 1.3rem; }
  .article-content { padding: 20px 16px; }
  .article-sidebar { padding: 16px; }
  .footer-inner { flex-direction: column; gap: 10px; text-align: center; }

  /* Flow diagrams stack vertically on mobile */
  .flow-diagram {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 12px;
  }
  .flow-sources {
    width: 100%;
  }
  .flow-box {
    max-width: none;
    min-width: 0;
    width: 100%;
  }
  .flow-converge .flow-sources .flow-box {
    max-width: none;
    min-width: 0;
  }
  .flow-arrow {
    padding: 6px 0;
  }
  .flow-arrow i::before {
    content: "\F282"; /* bi-arrow-down */
  }
  .flow-steps {
    flex-direction: column;
  }
}
