/* ==========================================================================
   GAVERIFY.ME - DOCUMENTATION SYSTEM STYLESHEET (website/css/docs.css)
   Interactive Docs UI inspired by React.dev & Inventateq.
   Two-column responsive layout, sticky expandable sidebar, dynamic routing,
   deep breadcrumbs, code blocks, learning callouts, and mobile drawer.
   ========================================================================== */

/* Google Fonts: Plus Jakarta Sans (Primary Typography) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* Page Shell & Outer Container */
.docs-page {
  background-color: #ffffff;
  color: var(--color-text-dark, #0b0d17);
  font-family: 'Plus Jakarta Sans', var(--font-main, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.docs-main-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 1.5rem 1.75rem 4rem;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
  position: relative;
}

/* ==========================================================================
   1. SIDEBAR (Left Column - Expandable Categories & Search)
   ========================================================================== */

.docs-sidebar {
  position: sticky;
  top: 5.5rem;
  height: calc(100vh - 6.5rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.docs-sidebar::-webkit-scrollbar {
  width: 5px;
}

.docs-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 9999px;
}

/* Sidebar Search Box */
.docs-search-box,
.docs-search-wrap {
  position: relative;
  width: 100%;
}

.docs-search-input {
  width: 100%;
  padding: 0.7rem 2.2rem 0.7rem 2.4rem;
  background-color: #f8faff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.88rem;
  color: #1e293b;
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.docs-search-input:focus {
  background-color: #ffffff;
  border-color: var(--color-primary-blue, #255ff1);
  box-shadow: 0 0 0 3px rgba(37, 95, 241, 0.12);
}

.docs-search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  display: flex;
  align-items: center;
  width: 16px;
  height: 16px;
}

.docs-search-clear {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.2rem;
  display: none;
  align-items: center;
  border-radius: 4px;
}

.docs-search-clear.visible {
  display: flex;
}

.docs-search-clear:hover {
  color: #0f172a;
}

/* Sidebar Navigation Groups */
.docs-nav,
.docs-nav-tree {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.docs-category-group {
  display: flex;
  flex-direction: column;
}

.docs-category-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.4rem;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s ease;
  user-select: none;
  text-align: left;
}

.docs-category-btn:hover {
  color: #0f172a;
}

.docs-category-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-category-count {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
}

.docs-category-chevron {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.docs-category-group.collapsed .docs-category-chevron {
  transform: rotate(-90deg);
}

.docs-category-group.collapsed .docs-nav-list {
  display: none;
}

/* Document Item Links in Sidebar */
.docs-nav-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.docs-nav-item {
  margin: 0;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  color: #475569;
  font-size: 0.885rem;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  transition: all 0.18s ease;
  line-height: 1.4;
}

.docs-nav-link:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* Active Nav State - Inspired by Inventateq & React.dev */
.docs-nav-link.active {
  background-color: #eff6ff;
  color: var(--color-primary-blue, #255ff1);
  font-weight: 600;
  border-left-color: var(--color-primary-blue, #255ff1);
}

/* Quick Search No-Result State */
.docs-search-empty {
  display: none;
  padding: 1.5rem 0.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

/* ==========================================================================
   2. MAIN DOCUMENTATION AREA (Right Column)
   ========================================================================== */

.docs-content,
.docs-content-area {
  min-width: 0;
  max-width: 920px;
  width: 100%;
}

/* Breadcrumb & Top Utility Bar with Copy Link Button */
.docs-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}

.docs-top-bar .hero-breadcrumb {
  margin-bottom: 0;
}

.docs-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 9999px;
  background: #ffffff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  flex-shrink: 0;
}

.docs-copy-btn:hover {
  background: #f8faff;
  color: var(--color-primary-blue, #255ff1);
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 95, 241, 0.08);
}

.docs-copy-btn.copied {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.docs-copy-btn.copied svg {
  color: #047857;
}

/* Article Header */
.docs-header,
.docs-article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}

/* Category Badge / Pill */
.docs-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  color: var(--color-primary-blue, #255ff1);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.docs-title {
  font-size: clamp(2.1rem, 3.5vw, 2.75rem);
  font-weight: 800;
  color: var(--color-primary-navy, #1a1054);
  line-height: 1.22;
  letter-spacing: -0.03em;
  margin: 0 0 1rem 0;
}

.docs-lead {
  font-size: 1.15rem;
  line-height: 1.68;
  color: #475569;
  margin: 0;
  font-weight: 400;
}

/* "What You Will Learn" Callout Card */
.docs-learn-card,
.docs-callout-learn {
  background: #f8faff;
  border: 1.5px solid #dbeafe;
  border-radius: 16px;
  padding: 1.5rem 1.85rem;
  margin: 2rem 0 2.5rem 0;
  position: relative;
  box-shadow: 0 2px 10px rgba(37, 95, 241, 0.04);
}

.docs-learn-heading,
.docs-callout-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary-navy, #1a1054);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.docs-learn-badge-icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary-blue, #255ff1);
  flex-shrink: 0;
}

.docs-learn-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.docs-learn-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.55;
}

.docs-learn-icon {
  width: 18px;
  height: 18px;
  color: var(--color-primary-blue, #255ff1);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* Typography & Content Flow */
.docs-body {
  font-size: 1rem;
  line-height: 1.75;
  color: #334155;
}

.docs-body h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color-primary-navy, #1a1054);
  letter-spacing: -0.02em;
  margin: 2.75rem 0 1rem 0;
  padding-top: 0.5rem;
  border-top: 1px solid #f1f5f9;
}

.docs-body h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 1.5rem;
}

.docs-body h3 {
  font-size: 1.22rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.015em;
  margin: 1.85rem 0 0.75rem 0;
}

.docs-body p {
  margin: 0 0 1.25rem 0;
}

.docs-body strong {
  color: #0f172a;
  font-weight: 600;
}

.docs-body ul,
.docs-body ol {
  margin: 0 0 1.5rem 0;
  padding-left: 1.5rem;
}

.docs-body li {
  margin-bottom: 0.5rem;
  line-height: 1.65;
}

/* Callout Alerts (Info, Tip, Success, Warning) */
.docs-alert,
.docs-callout {
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.94rem;
  line-height: 1.6;
}

.docs-alert-title {
  font-weight: 700;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-alert.info,
.docs-callout-info {
  background-color: #f0f9ff;
  border: 1.5px solid #bae6fd;
  color: #0369a1;
}

.docs-alert.tip,
.docs-callout-tip {
  background-color: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  color: #047857;
}

.docs-alert.success {
  background-color: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  color: #15803d;
}

.docs-alert.warning,
.docs-callout-warning {
  background-color: #fffbeb;
  border: 1.5px solid #fde68a;
  color: #b45309;
}

/* Numbered Process Steps */
.docs-steps {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin: 1.75rem 0 2.25rem;
}

.docs-step {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 1.4rem;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.02);
  transition: all 0.2s ease;
}

.docs-step:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.docs-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--color-primary-blue, #255ff1);
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.docs-step-content {
  flex: 1;
  min-width: 0;
}

.docs-step-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary-navy, #1a1054);
  margin: 0 0 0.35rem 0;
}

.docs-step-content p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #64748b;
  margin: 0;
}

/* Code Snippet Box with Copy Button */
.docs-code-wrap {
  position: relative;
  background: #0f172a;
  border-radius: 12px;
  margin: 1.5rem 0 2rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
}

.docs-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  font-size: 0.76rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-code-copy-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.docs-code-copy-btn:hover {
  background: #334155;
  color: #ffffff;
}

.docs-code-wrap pre {
  margin: 0;
  padding: 1.25rem 1.25rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  color: #f8fafc;
}

.docs-code-wrap code {
  font-family: inherit;
}

/* Inline Code Tag */
:not(pre) > code {
  background: #f1f5f9;
  color: #0f172a;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  border: 1px solid #e2e8f0;
}

/* Comparison / Parameters Table */
.docs-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0 2.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.02);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.docs-table th {
  background: #f8faff;
  padding: 0.95rem 1.15rem;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 1.5px solid #e2e8f0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.docs-table td {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  line-height: 1.55;
}

.docs-table tr:hover td {
  background-color: #fafcff;
}

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

/* ==========================================================================
   3. BOTTOM PAGINATION (Previous & Next Doc Cards)
   ========================================================================== */

.docs-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1.5px solid #f1f5f9;
}

.docs-page-nav-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.4rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  text-decoration: none;
  transition: all 0.22s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

.docs-page-nav-card:hover {
  border-color: var(--color-primary-blue, #255ff1);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 95, 241, 0.1);
}

.docs-page-nav-card.next {
  text-align: right;
  align-items: flex-end;
}

.docs-page-nav-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.docs-page-nav-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary-navy, #1a1054);
  line-height: 1.35;
}

.docs-page-nav-card:hover .docs-page-nav-title {
  color: var(--color-primary-blue, #255ff1);
}

/* ==========================================================================
   4. MOBILE DRAWER & RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* Mobile Top Floating / Sticky Subnav Bar */
.docs-mobile-bar {
  display: none;
  position: sticky;
  top: 4rem;
  z-index: 40;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 1.25rem;
}

.docs-mobile-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 1380px;
  margin: 0 auto;
}

.docs-mobile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 9999px;
  background: #ffffff;
  color: var(--color-primary-navy, #1a1054);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.docs-mobile-btn:hover {
  background: #f8faff;
  border-color: var(--color-primary-blue, #255ff1);
}

.docs-mobile-doc-pill {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

/* Mobile Backdrop Overlay */
.docs-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.docs-backdrop.active,
.docs-backdrop.is-open {
  display: block;
  opacity: 1;
}

@media (max-width: 1024px) {
  .docs-main-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.25rem 1.25rem 3rem;
  }

  .docs-mobile-bar {
    display: block;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 86vw;
    height: 100vh;
    background: #ffffff;
    z-index: 100;
    padding: 1.5rem 1.25rem;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .docs-sidebar.drawer-open,
  .docs-sidebar.is-open {
    transform: translateX(0);
  }

  .docs-mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
  }

  .docs-mobile-drawer-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-primary-navy, #1a1054);
  }

  .docs-mobile-drawer-close {
    background: transparent;
    border: none;
    color: #64748b;
    padding: 0.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 6px;
  }

  .docs-mobile-drawer-close:hover {
    color: #0f172a;
    background: #f1f5f9;
  }
}

@media (min-width: 1025px) {
  .docs-mobile-drawer-header {
    display: none;
  }
}

@media (max-width: 640px) {
  .docs-pagination {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .docs-page-nav-card.next {
    text-align: left;
    align-items: flex-start;
  }

  .docs-learn-card,
  .docs-callout-learn {
    padding: 1.25rem 1.25rem;
  }
}
