/* ============================================================
   Help Center — Mintlify-inspired layout
   Built on top of AdminKit / Bootstrap
   ============================================================ */

/* ---- Layout shell ---- */
.help-layout {
  display: flex;
  min-height: calc(100vh - 160px);   /* below header, above footer */
}

.help-layout-sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid #e5e7eb;
  background: #fafbfc;
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  overflow-y: auto;
  z-index: 10;
}

.help-layout-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem;
  max-width: 900px;
}

.help-layout-toc {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 2rem 1.5rem 2rem 0;
}

/* When there's no TOC (index, category, search pages) let main expand */
.help-layout-main.full-width {
  max-width: 1100px;
}

/* ---- Sidebar ---- */
.help-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 0;
}

.help-sidebar-search {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0.75rem;
}

.help-sidebar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 0.8rem;
}

.help-sidebar-search-input {
  padding-left: 30px !important;
  padding-right: 42px !important;
  border-radius: 8px !important;
  border: 1px solid #e5e7eb !important;
  background: #fff !important;
  font-size: 0.85rem !important;
  height: 36px;
}

.help-sidebar-search-input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1) !important;
}

.help-sidebar-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #6b7280;
  font-family: inherit;
  line-height: 1;
}

.help-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.5rem;
}

.help-sidebar-group {
  margin-bottom: 0.125rem;
}

.help-sidebar-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s;
}

.help-sidebar-group-header:hover {
  background: #f3f4f6;
  color: #111827;
  text-decoration: none;
}

.help-sidebar-group-header.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.help-sidebar-group-icon {
  width: 20px;
  text-align: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.help-sidebar-group-title {
  flex: 1;
}

.help-sidebar-group-count {
  font-size: 0.75rem;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 24px;
  text-align: center;
}

.help-sidebar-group-header.active .help-sidebar-group-count {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Article list inside active category */
.help-sidebar-articles {
  list-style: none;
  padding: 0.25rem 0 0.5rem 2.25rem;
  margin: 0;
}

.help-sidebar-article-link {
  display: block;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  color: #6b7280;
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  line-height: 1.4;
}

.help-sidebar-article-link:hover {
  color: #111827;
  background: #f9fafb;
  text-decoration: none;
}

.help-sidebar-article-link.active {
  color: #1d4ed8;
  background: #eff6ff;
  border-left-color: #3b82f6;
  font-weight: 500;
}

/* Sidebar footer */
.help-sidebar-footer {
  border-top: 1px solid #e5e7eb;
  padding: 0.75rem 0.5rem 0;
  margin-top: 0.5rem;
}

.help-sidebar-footer-link {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: #6b7280;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
}

.help-sidebar-footer-link:hover {
  color: #111827;
  background: #f3f4f6;
  text-decoration: none;
}

/* ---- Index page — hero + cards ---- */
.help-hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  max-width: 680px;
  margin: 0 auto;
}

.help-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.75rem;
}

.help-hero p {
  font-size: 1.05rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.help-hero-search {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
}

.help-hero-search .form-control {
  height: 48px;
  padding-left: 44px;
  padding-right: 48px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.help-hero-search .form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
}

.help-hero-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 1rem;
}

.help-hero-search kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #6b7280;
}

/* Category cards on index */
.help-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  max-width: 800px;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
}

.help-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.help-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 4px 12px rgba(59,130,246,0.08);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}

.help-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.help-card-body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.25rem;
}

.help-card-body p {
  font-size: 0.825rem;
  color: #6b7280;
  margin: 0 0 0.4rem;
  line-height: 1.5;
}

.help-card-meta {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* ---- Category / article list ---- */
.help-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-article-list-item {
  border-bottom: 1px solid #f3f4f6;
}

.help-article-list-item:nth-child(even) {
  background: #f9fafb;
}

.help-article-list-item:last-child {
  border-bottom: none;
}

.help-article-list-link {
  display: block;
  padding: 1rem 0.5rem;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s;
}

.help-article-list-link:hover {
  background: #f9fafb;
  color: inherit;
  text-decoration: none;
}

.help-article-list-link h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.25rem;
}

.help-article-list-link p {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.help-article-list-link .meta {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.35rem;
}

/* ---- Article page ---- */
.help-article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.help-article-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.help-article-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Article content styling */
.help-article-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #374151;
}

.help-article-body h2 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #111827;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-top: 0.5rem;
}

.help-article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.help-article-body h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.help-article-body p {
  margin-bottom: 1rem;
  color: #374151;
}

.help-article-body ul,
.help-article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.help-article-body li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.help-article-body code {
  background: #f3f4f6;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: #dc2626;
}

.help-article-body pre {
  background: #1f2937;
  color: #e5e7eb;
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.help-article-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.help-article-body blockquote {
  border-left: 3px solid #3b82f6;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  background: #eff6ff;
  border-radius: 0 8px 8px 0;
  color: #1e40af;
  font-size: 0.9rem;
}

.help-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  display: block;
  overflow-x: auto;
}

.help-article-body th,
.help-article-body td {
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e7eb;
  text-align: left;
}

.help-article-body th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}

.help-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

/* ---- Right-side TOC ---- */
.help-toc-panel h5 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-bottom: 0.75rem;
}

.help-toc-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-toc-panel li {
  margin-bottom: 0.25rem;
}

.help-toc-panel a {
  display: block;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  color: #6b7280;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  line-height: 1.4;
}

.help-toc-panel a:hover {
  color: #111827;
  text-decoration: none;
}

.help-toc-panel a.active {
  color: #1d4ed8;
  border-left-color: #3b82f6;
  font-weight: 500;
}

/* ---- Breadcrumbs ---- */
.help-breadcrumb {
  font-size: 0.825rem;
  margin-bottom: 1.25rem;
}

.help-breadcrumb a {
  color: #6b7280;
  text-decoration: none;
}

.help-breadcrumb a:hover {
  color: #3b82f6;
}

.help-breadcrumb .separator {
  color: #d1d5db;
  margin: 0 0.4rem;
}

.help-breadcrumb .current {
  color: #374151;
  font-weight: 500;
}

/* ---- Related articles ---- */
.help-related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.help-related h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
}

.help-related-link {
  display: block;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: #374151;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
}

.help-related-link:hover {
  background: #f3f4f6;
  color: #1d4ed8;
  text-decoration: none;
}

/* ---- Article footer ---- */
.help-article-footer {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  text-align: center;
}

.help-article-footer p {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

/* ---- FAQ section on index ---- */
.help-faq-list {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.help-faq-card {
  display: block;
  padding: 1rem 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}

.help-faq-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(59,130,246,0.06);
  text-decoration: none;
  color: inherit;
}

.help-faq-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.25rem;
}

.help-faq-card p {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0;
}

/* ---- Category header ---- */
.help-category-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.help-category-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.25rem;
}

.help-category-header p {
  font-size: 0.9rem;
  color: #6b7280;
  margin: 0;
}

/* ---- Mobile toggle ---- */
.help-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1050;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #3b82f6;
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
  cursor: pointer;
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .help-layout-toc {
    display: none;
  }
}

@media (max-width: 991px) {
  .help-layout-sidebar {
    position: fixed;
    left: -290px;
    top: 0;
    height: 100vh;
    z-index: 1040;
    transition: left 0.25s ease;
    box-shadow: none;
  }

  .help-layout-sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  }

  .help-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .help-layout-main {
    padding: 1.5rem 1rem;
  }

  .help-card-grid {
    grid-template-columns: 1fr;
  }

  .help-hero h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 575px) {
  .help-layout {
    margin-top: 60px;
  }

  .help-hero {
    padding: 2rem 0.5rem 1.5rem;
  }
}
