/**
 * BFC Software - Dakota WMS Documentation
 * Professional enterprise styling
 */

:root {
  /* BFC Brand Colors - Professional B2B */
  --bfc-primary: #1e3a5f;        /* Deep navy blue */
  --bfc-secondary: #2563eb;      /* Bright blue accent */
  --bfc-accent: #3b82f6;         /* Light blue highlight */
  --bfc-success: #059669;        /* Green for success states */
  --bfc-warning: #d97706;        /* Orange for warnings */
  --bfc-danger: #dc2626;         /* Red for errors */

  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Layout */
  --sidebar-width: 280px;
  --header-height: 64px;
  --content-max-width: 900px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--gray-50);
}

/* Header */
.bfc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bfc-primary);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bfc-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bfc-header .logo img {
  height: 36px;
  width: auto;
}

.bfc-header .logo-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
}

.bfc-header h1 {
  margin: 0 0 0 24px;
  font-size: 1.25rem;
  font-weight: 500;
  flex: 1;
}

.bfc-header .search-box {
  position: relative;
}

.bfc-header .search-box input {
  width: 240px;
  padding: 8px 12px 8px 36px;
  border: none;
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 0.875rem;
  outline: none;
  transition: background 0.2s, width 0.2s;
}

.bfc-header .search-box input::placeholder {
  color: rgba(255,255,255,0.7);
}

.bfc-header .search-box input:focus {
  background: rgba(255,255,255,0.25);
  width: 300px;
}

.bfc-header .search-box::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  opacity: 0.7;
}

/* Menu toggle (mobile) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  margin-right: 12px;
}

/* Container */
.container {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: white;
  border-right: 1px solid var(--gray-200);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 50;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  cursor: pointer;
  user-select: none;
}

.sidebar-section-title::before {
  content: '▼';
  font-size: 0.625rem;
  margin-right: 8px;
  transition: transform 0.2s;
}

.sidebar-section.collapsed .sidebar-section-title::before {
  transform: rotate(-90deg);
}

.sidebar-section.collapsed .sidebar-links {
  display: none;
}

.sidebar-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-links a {
  display: block;
  padding: 8px 20px 8px 32px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-links a:hover {
  background: var(--gray-100);
  color: var(--bfc-secondary);
}

.sidebar-links a.active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--bfc-secondary);
  border-left-color: var(--bfc-secondary);
  font-weight: 500;
}

/* Main content */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 40px 48px;
  max-width: calc(var(--content-max-width) + var(--sidebar-width) + 96px);
}

.content article {
  max-width: var(--content-max-width);
  background: white;
  padding: 40px 48px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Document metadata */
.doc-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
}

.doc-meta span {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 4px;
}

.doc-meta .doc-type {
  background: var(--bfc-secondary);
  color: white;
}

.doc-meta .module {
  background: var(--gray-200);
  color: var(--gray-700);
}

.doc-meta .persona {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.25;
  color: var(--gray-900);
}

h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.5rem; border-bottom: 1px solid var(--gray-200); padding-bottom: 0.5em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; color: var(--gray-600); }

p {
  margin: 1em 0;
}

a {
  color: var(--bfc-secondary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Lists */
ul, ol {
  margin: 1em 0;
  padding-left: 1.5em;
}

li {
  margin: 0.5em 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9375rem;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
}

tr:hover td {
  background: var(--gray-50);
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--gray-100);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--gray-800);
}

pre {
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Blockquotes */
blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 4px solid var(--bfc-secondary);
  background: var(--gray-50);
  color: var(--gray-700);
}

blockquote p {
  margin: 0;
}

/* Callouts */
.callout {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-radius: 8px;
  border-left: 4px solid;
}

.callout-warning {
  background: #fef3c7;
  border-color: var(--bfc-warning);
}

.callout-tip {
  background: #d1fae5;
  border-color: var(--bfc-success);
}

.callout-note {
  background: #dbeafe;
  border-color: var(--bfc-secondary);
}

.callout-caution {
  background: #fee2e2;
  border-color: var(--bfc-danger);
}

/* Search results */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 400px;
  max-height: 60vh;
  overflow-y: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  z-index: 200;
  display: none;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  text-decoration: none;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--gray-50);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: 500;
  margin-bottom: 4px;
}

.search-result-excerpt {
  font-size: 0.8125rem;
  color: var(--gray-500);
  line-height: 1.4;
}

.search-result-meta {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.search-result-meta span {
  font-size: 0.6875rem;
  padding: 2px 6px;
  background: var(--gray-100);
  border-radius: 3px;
  color: var(--gray-600);
}

.search-no-results {
  padding: 24px;
  text-align: center;
  color: var(--gray-500);
}

/* Footer */
.doc-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
  font-size: 0.8125rem;
  color: var(--gray-500);
  text-align: center;
}

.doc-footer p {
  margin: 4px 0;
}

/* Print styles */
@media print {
  .bfc-header,
  .sidebar,
  .search-box {
    display: none !important;
  }

  .content {
    margin-left: 0;
    padding: 0;
  }

  .content article {
    box-shadow: none;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .content {
    padding: 24px;
  }

  .content article {
    padding: 24px;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .bfc-header h1 {
    display: none;
  }

  .bfc-header .search-box input {
    width: 180px;
  }

  .bfc-header .search-box input:focus {
    width: 220px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .content {
    margin-left: 0;
    padding: 16px;
  }

  .content article {
    padding: 20px;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

/* Syntax highlighting (highlight.js compatible) */
.hljs {
  background: var(--gray-900) !important;
  color: var(--gray-100);
}

.hljs-keyword { color: #c792ea; }
.hljs-string { color: #c3e88d; }
.hljs-number { color: #f78c6c; }
.hljs-comment { color: #697098; }
.hljs-function { color: #82aaff; }
.hljs-class { color: #ffcb6b; }
.hljs-variable { color: #f07178; }
.hljs-operator { color: #89ddff; }
