/* ============================================================
   WORKWIZ DOCUMENTATION STYLES
   Extends landing.css variables — load landing.css first
   ============================================================ */

/* ---- Docs Shell ---- */
.docs-shell {
  display: flex;
  min-height: 100vh;
  padding-top: 64px; /* nav height */
}

/* ---- Sidebar ---- */
.docs-sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0 40px;
  z-index: 40;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-200) transparent;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }

.docs-sidebar-section {
  padding: 0 16px 20px;
}

.docs-sidebar-section + .docs-sidebar-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.docs-sidebar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px 8px;
  display: block;
}

.docs-sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  line-height: 1.4;
}

.docs-sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.docs-sidebar-link.active {
  color: var(--primary-700);
  background: var(--primary-50);
  font-weight: 500;
}

.docs-sidebar-link .docs-sidebar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.docs-sidebar-link.active .docs-sidebar-icon {
  opacity: 1;
}

/* ---- Main Content ---- */
.docs-content {
  margin-left: 260px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.docs-article {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 56px 80px;
}

/* ---- Breadcrumb ---- */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.docs-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.docs-breadcrumb a:hover { color: var(--text-primary); }

.docs-breadcrumb-sep {
  color: var(--gray-300);
  font-size: 12px;
}

/* ---- Page Header ---- */
.docs-page-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-600);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  margin-bottom: 16px;
}

.docs-h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.docs-lead {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 40px;
  max-width: 660px;
}

/* ---- Divider ---- */
.docs-divider {
  height: 1px;
  background: var(--border);
  margin: 40px 0;
}

/* ---- Section heading ---- */
.docs-h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 12px;
  margin-top: 48px;
  scroll-margin-top: 80px;
}

.docs-h2:first-of-type { margin-top: 0; }

.docs-h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  margin-top: 28px;
  scroll-margin-top: 80px;
}

/* ---- Body text ---- */
.docs-p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
}

.docs-p:last-child { margin-bottom: 0; }

/* ---- Steps ---- */
.docs-steps {
  counter-reset: step;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0;
}

.docs-step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0 16px;
  position: relative;
}

.docs-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 40px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.docs-step-num {
  counter-increment: step;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-50);
  border: 1.5px solid var(--primary-100);
  color: var(--primary-700);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}

.docs-step-body {
  padding: 8px 0 32px;
}

.docs-step-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.docs-step-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---- Feature grid ---- */
.docs-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.docs-feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.docs-feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.docs-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--primary-600);
}

.docs-feature-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.docs-feature-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---- Info / Tip / Warning callouts ---- */
.docs-callout {
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 24px 0;
  display: flex;
  gap: 14px;
  font-size: 14px;
  line-height: 1.65;
}

.docs-callout-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.docs-callout.info {
  background: #EFF8FF;
  border-left: 3px solid #2E90FA;
  color: #1849A9;
}

.docs-callout.info .docs-callout-icon { color: #2E90FA; }

.docs-callout.tip {
  background: var(--primary-25);
  border-left: 3px solid var(--primary-500);
  color: var(--primary-800);
}

.docs-callout.tip .docs-callout-icon { color: var(--primary-500); }

.docs-callout.warning {
  background: #FFFAEB;
  border-left: 3px solid var(--warning-500);
  color: #B54708;
}

.docs-callout.warning .docs-callout-icon { color: var(--warning-500); }

.docs-callout-body strong {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}

/* ---- Table ---- */
.docs-table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.docs-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.docs-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.6;
}

.docs-table tr:last-child td { border-bottom: none; }
.docs-table tr:hover td { background: var(--bg-surface); }

.docs-table td strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* ---- Code ---- */
.docs-code-inline {
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  background: var(--bg-elevated);
  color: var(--primary-700);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}

.docs-code-block {
  background: var(--gray-900);
  color: #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 13.5px;
  line-height: 1.7;
  overflow-x: auto;
  margin: 20px 0;
}

.docs-code-block .comment { color: #718096; }
.docs-code-block .string { color: #68d391; }
.docs-code-block .keyword { color: #76e4f7; }

/* ---- Checklist ---- */
.docs-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.docs-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.docs-checklist li::before {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-500);
  flex-shrink: 0;
  margin-top: 1px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='8' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4L3.5 6.5L9 1' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* ---- Plan badge ---- */
.plan-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
}

.plan-badge.free { background: #F2F4F7; color: #475467; }
.plan-badge.pro { background: #EFF8FF; color: #1849A9; }
.plan-badge.business { background: var(--primary-50); color: var(--primary-700); }

/* ---- Page nav (prev/next) ---- */
.docs-page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.docs-page-nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.docs-page-nav-link:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.docs-page-nav-link.next { text-align: right; }

.docs-page-nav-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.docs-page-nav-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ---- On This Page (TOC) ---- */
.docs-toc {
  position: fixed;
  top: 80px;
  right: 24px;
  width: 200px;
  display: none;
}

@media (min-width: 1400px) {
  .docs-toc { display: block; }
  .docs-article { padding-right: 240px; }
}

.docs-toc-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: block;
}

.docs-toc-link {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1.5;
}

.docs-toc-link:hover {
  color: var(--text-primary);
  border-left-color: var(--gray-300);
}

.docs-toc-link.active {
  color: var(--primary-700);
  border-left-color: var(--primary-500);
  font-weight: 500;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .docs-content { margin-left: 0; }
  .docs-article { padding: 32px 20px 60px; }
}

/* ---- Mobile sidebar toggle ---- */
.docs-mobile-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-600);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .docs-mobile-toggle { display: flex; }
}

/* ---- Quick links grid (docs home) ---- */
.docs-quicklinks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.docs-quicklink {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  background: var(--bg-base);
}

.docs-quicklink:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.docs-quicklink-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--primary-50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  flex-shrink: 0;
}

.docs-quicklink-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.docs-quicklink-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.docs-quicklink-desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- Status dots ---- */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.green { background: var(--success-500); }
.status-dot.yellow { background: var(--warning-500); }
.status-dot.red { background: var(--error-500); }
.status-dot.gray { background: var(--gray-400); }
