/* ============================================================
   BACON-AI Git Docs — Global Stylesheet
   Dark theme, deep blues, neon cyan accents
   ============================================================ */

/* --- Fonts -------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Custom Properties -------------------------------------- */
:root {
  /* palette */
  --bg-darkest:   #0a0e1a;
  --bg-dark:      #0f1425;
  --bg-card:      #141a2e;
  --bg-sidebar:   #0d1120;
  --bg-hover:     #1a2240;
  --bg-active:    #1e2a4a;

  --accent:       #00e5ff;
  --accent-dim:   #00b8d4;
  --accent-glow:  rgba(0, 229, 255, 0.15);
  --accent-glow2: rgba(0, 229, 255, 0.06);

  --text:         #e0e6f0;
  --text-dim:     #8892a8;
  --text-muted:   #5a6580;
  --text-bright:  #ffffff;

  --border:       #1e2640;
  --border-light: #2a3358;

  --success:      #00e676;
  --warning:      #ffab40;
  --danger:       #ff5252;
  --info:         #448aff;

  /* sizes */
  --sidebar-w:    280px;
  --content-max:  1400px;
  --radius:       8px;
  --radius-lg:    12px;

  /* transitions */
  --ease: cubic-bezier(.4,0,.2,1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-darkest);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* --- Layout ------------------------------------------------- */
.page-wrapper {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar ------------------------------------------------ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s var(--ease);
}

.sidebar-brand {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand h1 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.sidebar-brand p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.sidebar-nav a.active {
  color: var(--accent);
  background: var(--accent-glow2);
  border-left-color: var(--accent);
}

.sidebar-nav a .nav-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-hover);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-nav a.active .nav-num {
  background: var(--accent);
  color: var(--bg-darkest);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* mobile burger */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* --- Main Content ------------------------------------------- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-header {
  padding: 16px 40px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-dark);
  position: sticky;
  top: 0;
  z-index: 50;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--accent); }

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

.progress-indicator {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.content-body {
  flex: 1;
  padding: 48px 48px 80px;
  width: 100%;
}

/* --- Typography --------------------------------------------- */
h1, h2, h3, h4 {
  color: var(--text-bright);
  font-weight: 700;
  line-height: 1.3;
}

.content-body h1 {
  font-size: 2.25rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-bright), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.content-body .subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 40px;
  max-width: 800px;
}

.content-body h2 {
  font-size: 1.5rem;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.content-body h3 {
  font-size: 1.15rem;
  margin: 32px 0 12px;
  color: var(--accent);
}

.content-body p {
  margin-bottom: 16px;
  max-width: 90ch;
}

.content-body ul, .content-body ol {
  margin: 0 0 16px 24px;
}

.content-body li {
  margin-bottom: 6px;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dim); }

strong { color: var(--text-bright); font-weight: 600; }

/* --- Cards / Boxes ------------------------------------------ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* feature card with icon */
.feature-card {
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.feature-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.feature-card .icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

/* --- Analogy Box -------------------------------------------- */
.analogy {
  background: linear-gradient(135deg, var(--accent-glow), var(--accent-glow2));
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
  position: relative;
}

.analogy::before {
  content: 'Real-world analogy';
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

.analogy p {
  color: var(--text);
  font-size: 0.95rem;
}

/* --- Key Point Box ------------------------------------------ */
.key-point {
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  margin: 24px 0;
}

.key-point strong:first-child {
  color: var(--accent);
}

/* --- Warning / Tip ------------------------------------------ */
.tip {
  background: rgba(68,138,255,0.08);
  border: 1px solid rgba(68,138,255,0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.9rem;
}

.tip::before {
  content: 'Tip';
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--info);
  margin-bottom: 6px;
}

.warning {
  background: rgba(255,171,64,0.08);
  border: 1px solid rgba(255,171,64,0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.9rem;
}

.warning::before {
  content: 'Important';
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--warning);
  margin-bottom: 6px;
}

/* --- Code Blocks -------------------------------------------- */
code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0 24px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* --- Cheat Sheet Blocks ------------------------------------- */
.cheat-section {
  margin-bottom: 32px;
}

.cheat-section h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.cheat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.cheat-card .phrase {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  padding: 14px 18px;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: all;
  transition: background 0.2s;
}

.cheat-card .phrase:hover {
  background: var(--bg-hover);
}

.cheat-card .explain {
  padding: 12px 18px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* --- Diagrams ----------------------------------------------- */
.diagram-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  margin: 28px 0;
  overflow-x: auto;
}

.diagram-wrapper .mermaid {
  display: flex;
  justify-content: center;
}

.diagram-caption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 16px;
  font-style: italic;
}

/* Mermaid theme overrides */
.mermaid svg {
  max-width: 100%;
}

/* --- Glossary Table ----------------------------------------- */
.glossary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}

.glossary-table th,
.glossary-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.glossary-table th {
  background: var(--bg-card);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.glossary-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.glossary-table tr:hover td {
  background: var(--bg-hover);
}

/* --- Page Navigation (prev/next) ---------------------------- */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.page-nav a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 180px;
}

.page-nav a:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.page-nav a .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.page-nav a .title {
  font-size: 0.95rem;
  color: var(--text-bright);
  font-weight: 600;
}

.page-nav .next { margin-left: auto; text-align: right; }

/* --- Welcome / Hero ----------------------------------------- */
.hero {
  padding: 24px 0 40px;
}

.hero h1 {
  font-size: 2.75rem;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

/* --- Workflow Steps ----------------------------------------- */
.step {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-darkest);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

.step-content h4 {
  margin-bottom: 6px;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* --- Responsive --------------------------------------------- */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: flex;
  }
  .main-content {
    margin-left: 0;
  }
  .content-header {
    padding: 16px 20px;
    padding-left: 64px;
  }
  .content-body {
    padding: 32px 20px 60px;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .content-body h1 {
    font-size: 1.75rem;
  }
  .page-nav {
    flex-direction: column;
  }
  .page-nav .next {
    text-align: left;
  }
}

/* overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
}
.sidebar-overlay.active {
  display: block;
}
