/* ============================================
   THE FALSE POSITIVE — Documentation Styles
   (Pentest Handbook Page)
   ============================================ */

/* ── Docs Layout ───────────────────────────── */
.docs-layout {
  --current-sidebar-width: var(--sidebar-width);
  --current-toc-width: var(--toc-width);
  display: grid;
  grid-template-columns: var(--current-sidebar-width) 1fr var(--current-toc-width);
  min-height: calc(100vh - var(--nav-height));
  padding-top: var(--nav-height);
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.docs-layout.left-collapsed {
  --current-sidebar-width: 48px;
}

.docs-layout.right-collapsed {
  --current-toc-width: 48px;
}

/* ── Left Sidebar ──────────────────────────── */
.docs-sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: var(--current-sidebar-width);
  height: calc(100vh - var(--nav-height));
  border-right: 1px solid var(--border);
  background: var(--bg-main);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.sidebar-desktop-toggle {
  position: absolute;
  top: 1.25rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.sidebar-desktop-toggle:hover {
  color: var(--white);
  background: var(--bg-elevated);
}

.docs-layout.left-collapsed .sidebar-desktop-toggle {
  transform: rotate(180deg);
  right: 12px;
}

.sidebar-inner {
  padding: var(--space-xl) var(--space-lg);
  min-height: 100%;
  position: relative;
  transition: opacity 0.2s ease;
}

.docs-layout.left-collapsed .sidebar-inner {
  opacity: 0;
  pointer-events: none;
}

/* Back to home link */
.sidebar-home-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin: 0 var(--space-sm) var(--space-md);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.sidebar-home-link:hover {
  color: var(--off-white);
  background: var(--bg-elevated);
  border-color: var(--border);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0 var(--space-md) var(--space-md);
}

/* Category header */
.sidebar-category {
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-top: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Nav items */
.sidebar-nav { list-style: none; }

.sidebar-nav-item { }

.sidebar-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem var(--space-md) 0.4rem calc(var(--space-md) + 0.5rem);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
  background: transparent;
  border-top: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
}

.sidebar-nav-link:hover {
  color: var(--off-white);
  background: var(--bg-elevated);
  border-left-color: var(--border-light);
}

.sidebar-nav-link.active {
  color: var(--white);
  background: var(--red-ghost);
  border-left-color: var(--red);
}

/* Collapse chevron */
.sidebar-chevron {
  transition: transform var(--transition-fast);
  opacity: 0.5;
  font-size: 0.7rem;
}
.sidebar-nav-item.open > .sidebar-nav-link .sidebar-chevron {
  transform: rotate(90deg);
}

/* Nested items */
.sidebar-sub-nav {
  list-style: none;
  display: none;
  border-left: 1px solid var(--border);
  margin-left: calc(var(--space-md) + 0.5rem);
}

.sidebar-nav-item.open > .sidebar-sub-nav { display: block; }

.sidebar-sub-nav a {
  display: block;
  padding: 0.3rem var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
}

.sidebar-sub-nav a:hover {
  color: var(--off-white);
  border-left-color: var(--red-dim);
  padding-left: calc(var(--space-md) + 2px);
}

.sidebar-sub-nav a.active {
  color: var(--red-bright);
  border-left-color: var(--red);
}

/* ── Main Docs Content ──────────────────────── */
.docs-content {
  grid-column: 2;
  margin-left: var(--current-sidebar-width);
  margin-right: var(--current-toc-width);
  padding: var(--space-2xl) var(--space-2xl);
  min-width: 0;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar-toggle {
  display: none;
}
.mobile-sidebar-close {
  display: none;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: var(--space-lg);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.breadcrumb a:hover { color: var(--red-bright); }

.breadcrumb-sep { color: var(--border-light); }
.breadcrumb-current { color: var(--silver); }

/* Content heading */
.docs-page-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--white);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.docs-page-title::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 60px; height: 1px;
  background: var(--red);
}

/* Copy page btn */
.copy-page-btn {
  float: right;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-left: var(--space-md);
}
.copy-page-btn:hover {
  color: var(--off-white);
  border-color: var(--border-red);
}

/* Section headings within docs */
.docs-content h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--white);
  margin: var(--space-2xl) 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.docs-content h3 {
  font-size: 1.1rem;
  color: var(--off-white);
  margin: var(--space-lg) 0 var(--space-sm);
}

/* Death Note Rule callout */
.callout-rule {
  border: 1px solid var(--red-dim);
  border-left: 4px solid var(--red);
  background: var(--red-ghost);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 4px 4px 0;
  margin: var(--space-lg) 0;
  position: relative;
}

.callout-rule .rule-header {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red-bright);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* L Probability note */
.callout-probability {
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 4px solid var(--white);
  background: rgba(255,255,255,0.03);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 4px 4px 0;
  margin: var(--space-lg) 0;
  font-style: italic;
  color: var(--silver);
}

.callout-probability .prob-header {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: var(--space-sm);
  font-style: normal;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Checkbox items */
.checklist { list-style: none; padding: 0; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.checklist li::before {
  content: '□';
  color: var(--red-dim);
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Right TOC Sidebar ──────────────────────── */
.docs-toc {
  position: fixed;
  top: var(--nav-height);
  right: 0;
  width: var(--current-toc-width);
  height: calc(100vh - var(--nav-height));
  border-left: 1px solid var(--border);
  background: var(--bg-main);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.toc-desktop-toggle {
  position: absolute;
  top: 1.25rem;
  left: 0.75rem;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.toc-desktop-toggle:hover {
  color: var(--white);
  background: var(--bg-elevated);
}

.docs-layout.right-collapsed .toc-desktop-toggle {
  transform: rotate(180deg);
  left: 12px;
}

.toc-inner {
  padding: var(--space-xl) var(--space-md);
  min-height: 100%;
  position: relative;
  transition: opacity 0.2s ease;
}

.docs-layout.right-collapsed .toc-inner {
  opacity: 0;
  pointer-events: none;
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-md);
}

.toc-nav { list-style: none; }

.toc-nav a {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0 0.25rem var(--space-sm);
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
  line-height: 1.4;
  margin-bottom: 2px;
}

.toc-nav a:hover { color: var(--off-white); border-left-color: var(--border-light); }
.toc-nav a.active { color: var(--red-bright); border-left-color: var(--red); }

.toc-nav .toc-h3 { padding-left: var(--space-lg); font-size: 0.7rem; }

/* ── Under Investigation WIP ──────────────────── */
.notebook-wip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  max-width: 600px;
  margin: 0 auto;
  min-height: 60vh;
}

.wip-icon {
  color: var(--red);
  margin-bottom: 1.5rem;
  opacity: 0.8;
  animation: pulseWarning 3s ease-in-out infinite;
}

@keyframes pulseWarning {
  0%, 100% { opacity: 0.5; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 12px rgba(220,53,69,0.4)); }
}

.wip-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--red-bright);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.wip-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--white);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wip-quote {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--off-white);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.wip-attr {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.wip-divider {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
  margin: 0 auto 2rem;
}

.wip-body {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--silver);
  line-height: 1.8;
  margin-bottom: 3rem;
  opacity: 0.8;
}

.wip-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--white);
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all var(--transition-fast);
  background: var(--bg-elevated);
}

.wip-back:hover {
  border-color: var(--red);
  color: var(--red-bright);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1200px) {
  .docs-toc { display: none; }
  .docs-layout { grid-template-columns: var(--current-sidebar-width) 1fr; }
}

@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }
  
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh;
    border-right: none;
    border-bottom: none;
    padding: var(--space-xl) var(--space-md);
    background: var(--bg-primary);
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .docs-sidebar.mobile-open {
    transform: translateX(0);
  }
  
  .mobile-sidebar-close {
    display: flex;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--off-white);
    padding: 0.5rem;
    cursor: pointer;
    z-index: 2010;
  }

  .mobile-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 0;
    margin-right: 0.5rem;
  }
  
  .sidebar-inner {
    padding: 2rem 0;
    display: block;
  }
  
  .docs-layout.left-collapsed .sidebar-inner {
    opacity: 1;
    pointer-events: auto;
  }
  
  .sidebar-home-link {
    margin: 0 0 2rem 0;
  }

  .docs-sidebar-nav {
    display: block;
    overflow-x: visible;
    white-space: normal;
  }

  .docs-content {
    margin-left: 0;
    margin-right: 0;
    padding: var(--space-lg) var(--space-md);
  }
  .wip-title { font-size: 1.8rem; }
  .wip-quote { font-size: 1.1rem; }
  .sidebar-desktop-toggle { display: none; }
}
