/* ============================================
   FoodTruckPilot — Hilfe/Docs CSS
   ============================================ */

/* --- Variables (same as marketing + docs-specific) --- */
:root {
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-200: #fed7aa;
  --orange-300: #fdba74;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e0;
  --stone-300: #d6d3d1;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.3s ease;

  /* Docs-specific */
  --sidebar-width: 280px;
  --header-height: 64px;
  --toc-width: 220px;
  --green-50: #f0fdf4;
  --green-600: #16a34a;
  --green-700: #15803d;
  --blue-50: #eff6ff;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--stone-800);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
  line-height: 1.2;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- Header --- */
.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stone-200);
  z-index: 100;
  display: flex;
  align-items: center;
}

.docs-header-inner {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.docs-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.docs-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--stone-800);
}

.docs-logo .logo-icon {
  font-size: 1.4rem;
}

.docs-badge {
  background: var(--orange-100);
  color: var(--orange-700);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 99px;
}

.docs-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.docs-back-link {
  font-size: 0.875rem;
  color: var(--stone-500);
  transition: color var(--transition);
}

.docs-back-link:hover {
  color: var(--orange-600);
}

.docs-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  position: relative;
  flex-shrink: 0;
}

.docs-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--stone-700);
  position: absolute;
  left: 6px;
  transition: all 0.3s;
}

.docs-hamburger span:nth-child(1) { top: 8px; }
.docs-hamburger span:nth-child(2) { top: 15px; }
.docs-hamburger span:nth-child(3) { top: 22px; }

.docs-hamburger.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 15px;
}
.docs-hamburger.active span:nth-child(2) { opacity: 0; }
.docs-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 15px;
}

/* --- Layout --- */
.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--toc-width);
  gap: 0;
  max-width: 1440px;
  margin: var(--header-height) auto 0;
  min-height: calc(100vh - var(--header-height));
}

/* --- Sidebar --- */
.docs-sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 24px 0 24px 24px;
  border-right: 1px solid var(--stone-200);
}

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

.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--stone-300);
  border-radius: 4px;
}

.docs-search {
  position: relative;
  margin-bottom: 20px;
  padding-right: 24px;
}

.docs-search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--stone-200);
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--stone-50);
  outline: none;
  transition: border-color var(--transition);
}

.docs-search-input:focus {
  border-color: var(--orange-400);
}

.docs-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--stone-400);
  font-size: 0.875rem;
  pointer-events: none;
}

.docs-nav-group {
  margin-bottom: 20px;
}

.docs-nav-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--stone-400);
  padding: 0 12px;
  margin-bottom: 4px;
}

.docs-nav-link {
  display: block;
  padding: 6px 12px;
  font-size: 0.875rem;
  color: var(--stone-600);
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  margin-right: 24px;
}

.docs-nav-link:hover {
  color: var(--stone-800);
  background: var(--stone-50);
}

.docs-nav-link.active {
  color: var(--orange-700);
  background: var(--orange-50);
  border-left-color: var(--orange-500);
  font-weight: 600;
}

.docs-nav-link.hidden {
  display: none;
}

/* --- Main Content --- */
.docs-main {
  padding: 40px 48px 80px;
  max-width: 100%;
  overflow-x: hidden;
}

/* Breadcrumb */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--stone-400);
  margin-bottom: 8px;
}

.docs-breadcrumb a {
  color: var(--stone-500);
  transition: color var(--transition);
}

.docs-breadcrumb a:hover {
  color: var(--orange-600);
}

.docs-breadcrumb .separator {
  font-size: 0.7rem;
}

/* Title area */
.docs-main > h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--stone-900);
}

.docs-intro {
  font-size: 1.1rem;
  color: var(--stone-500);
  margin-bottom: 32px;
  line-height: 1.7;
}

/* Inline TOC (mobile/tablet) */
.docs-toc-inline {
  display: none;
  background: var(--stone-50);
  border: 1px solid var(--stone-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 32px;
}

.docs-toc-inline-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--stone-400);
  margin-bottom: 8px;
}

.docs-toc-inline a {
  display: block;
  font-size: 0.875rem;
  color: var(--stone-600);
  padding: 4px 0;
  transition: color var(--transition);
}

.docs-toc-inline a:hover {
  color: var(--orange-600);
}

/* Content sections */
.docs-section {
  margin-bottom: 48px;
}

.docs-section h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  padding-top: 8px;
  color: var(--stone-800);
}

.docs-section h3 {
  font-size: 1.15rem;
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--stone-700);
}

.docs-section p {
  margin-bottom: 12px;
  color: var(--stone-600);
  line-height: 1.7;
}

.docs-section ul,
.docs-section ol {
  margin-bottom: 12px;
  padding-left: 24px;
}

.docs-section ul { list-style: disc; }
.docs-section ol { list-style: decimal; }

.docs-section li {
  margin-bottom: 6px;
  color: var(--stone-600);
  line-height: 1.6;
}

.docs-section strong {
  color: var(--stone-800);
  font-weight: 600;
}

.docs-section code {
  background: var(--stone-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--orange-700);
}

/* Steps */
.docs-steps {
  counter-reset: step-counter;
  margin: 16px 0 24px;
}

.docs-step {
  counter-increment: step-counter;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.docs-step::before {
  content: counter(step-counter);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-500), var(--amber-500));
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.docs-step-content h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--stone-800);
}

.docs-step-content p {
  margin-bottom: 0;
  font-size: 0.925rem;
}

/* Callouts */
.docs-callout {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 16px 0 20px;
  font-size: 0.925rem;
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.docs-callout-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  margin-top: 1px;
}

.docs-callout p {
  margin: 0;
  color: inherit;
}

.docs-callout-tip {
  background: var(--green-50);
  border: 1px solid #bbf7d0;
  color: var(--green-700);
}

.docs-callout-info {
  background: var(--blue-50);
  border: 1px solid #bfdbfe;
  color: var(--blue-700);
}

.docs-callout-warning {
  background: var(--amber-100);
  border: 1px solid var(--amber-200);
  color: #92400e;
}

/* Feature list */
.docs-feature-list {
  margin: 12px 0 20px;
  padding-left: 0;
  list-style: none;
}

.docs-feature-list li {
  padding: 6px 0 6px 28px;
  position: relative;
}

.docs-feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green-600);
  font-weight: 700;
}

/* Prev/Next Navigation */
.docs-page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--stone-200);
}

.docs-page-nav-card {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.docs-page-nav-card:hover {
  border-color: var(--orange-300);
  box-shadow: var(--shadow-md);
}

.docs-page-nav-card.next {
  text-align: right;
  grid-column: 2;
}

.docs-page-nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--stone-400);
  margin-bottom: 4px;
}

.docs-page-nav-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--orange-600);
}

/* --- Right TOC --- */
.docs-toc {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 40px 24px 40px 0;
}

.docs-toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--stone-400);
  margin-bottom: 12px;
  padding-left: 12px;
}

.docs-toc-link {
  display: block;
  font-size: 0.8rem;
  color: var(--stone-400);
  padding: 4px 12px;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}

.docs-toc-link:hover {
  color: var(--stone-700);
}

.docs-toc-link.active {
  color: var(--orange-600);
  border-left-color: var(--orange-500);
}

/* --- Responsive --- */

/* Tablet: hide right TOC, show inline TOC */
@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: var(--sidebar-width) 1fr;
  }

  .docs-toc {
    display: none;
  }

  .docs-toc-inline {
    display: block;
  }
}

/* Mobile: sidebar as overlay */
@media (max-width: 768px) {
  .docs-hamburger {
    display: block;
  }

  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--white);
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-right: 1px solid var(--stone-200);
    padding: 24px;
  }

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

  .docs-backdrop {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 80;
  }

  .docs-backdrop.open {
    display: block;
  }

  .docs-main {
    padding: 24px 16px 60px;
  }

  .docs-main > h1 {
    font-size: 1.5rem;
  }

  .docs-page-nav {
    grid-template-columns: 1fr;
  }

  .docs-page-nav-card.next {
    grid-column: 1;
    text-align: left;
  }

  .docs-nav-link {
    margin-right: 0;
  }
}

/* --- Print --- */
@media print {
  .docs-header,
  .docs-sidebar,
  .docs-toc,
  .docs-hamburger,
  .docs-backdrop,
  .docs-page-nav { display: none; }

  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-main {
    padding: 0;
    margin: 0;
  }
}
