/* ============================================================
   php_http_apps_todo — Documentation Stylesheet
   ============================================================ */

:root {
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --color-primary: #0d6efd;
  --color-primary-light: #cfe2ff;
  --color-border: #dee2e6;
  --color-code-bg: #f1f3f5;
  --color-table-stripe: #f8f9fa;
  --color-method-get: #198754;
  --color-method-post: #fd7e14;
  --color-note-bg: #fff3cd;
  --color-note-border: #ffc107;
  --sidebar-width: 260px;
  --header-height: 60px;
}

/* -----------------------------------------------------------
   Reset & Base
   ----------------------------------------------------------- */

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  min-height: 100vh;
}

/* -----------------------------------------------------------
   Layout — Sidebar + Content
   ----------------------------------------------------------- */

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
}

.sidebar-title a {
  color: inherit;
  text-decoration: none;
}

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

.sidebar-nav li {
  margin-bottom: 0.25rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.4rem 0.5rem;
  color: var(--color-text);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.sidebar-nav a.active {
  background: var(--color-primary);
  color: #ffffff;
}

/* Main content area */
.content {
  margin-left: var(--sidebar-width);
  padding: 2rem 3rem;
  max-width: 900px;
  width: 100%;
}

/* -----------------------------------------------------------
   Typography
   ----------------------------------------------------------- */

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--color-border);
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--color-primary);
}

a:hover {
  text-decoration: underline;
}

strong {
  font-weight: 600;
}

/* -----------------------------------------------------------
   Code
   ----------------------------------------------------------- */

code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas,
    monospace;
  font-size: 0.875em;
  background: var(--color-code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  white-space: nowrap;
}

pre {
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
}

/* -----------------------------------------------------------
   Tables
   ----------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

th,
td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border: 1px solid var(--color-border);
}

th {
  background: var(--color-code-bg);
  font-weight: 600;
  font-size: 0.9rem;
}

tr:nth-child(even) td {
  background: var(--color-table-stripe);
}

/* -----------------------------------------------------------
   Blockquotes / Notes
   ----------------------------------------------------------- */

blockquote {
  background: var(--color-note-bg);
  border-left: 4px solid var(--color-note-border);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 0 4px 4px 0;
}

blockquote p {
  margin: 0;
}

/* -----------------------------------------------------------
   Horizontal Rule
   ----------------------------------------------------------- */

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* -----------------------------------------------------------
   Method Badges (for API reference tables)
   ----------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 0.1em 0.5em;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 3px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-get {
  background: var(--color-method-get);
}

.badge-post {
  background: var(--color-method-post);
}

/* -----------------------------------------------------------
   Utility
   ----------------------------------------------------------- */

.text-muted {
  color: var(--color-text-muted);
}

.mt-2 {
  margin-top: 1rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

/* -----------------------------------------------------------
   Responsive
   ----------------------------------------------------------- */

@media (max-width: 768px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .layout {
    flex-direction: column;
  }

  .content {
    margin-left: 0;
    padding: 1.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  pre {
    padding: 0.75rem;
  }
}

/* -----------------------------------------------------------
   Print
   ----------------------------------------------------------- */

@media print {
  .sidebar {
    display: none;
  }

  .content {
    margin-left: 0;
    max-width: none;
  }
}