/* POSaBIT Developer API — Brand Tokens */
:root {
  --color-blue: #6EBBD5;
  --color-green: #7CC144;
  --color-dark: #1A1A1B;
  --color-text: #333333;
  --color-muted: #8C8C94;
  --color-bg: #F5F5FA;
  --color-white: #FFFFFF;
  --color-border: #E2E2EA;
  --color-code-bg: #1E2228;
  --radius: 6px;
  --sidebar-width: 260px;
  --font-body: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

a { color: var(--color-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre { font-family: var(--font-mono); font-size: 0.87rem; }

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--color-dark);
  color: #CFCFD7;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-white);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--color-blue);
  color: var(--color-white);
  font-weight: 700;
  border-radius: var(--radius);
  font-size: 1rem;
}

.sidebar-toggle { display: none; }

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

.search-input {
  display: block;
  width: calc(100% - 36px);
  margin: 0 18px 16px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.87rem;
  outline: none;
}
.search-input::placeholder { color: rgba(255,255,255,0.35); }
.search-input:focus { border-color: var(--color-blue); background: rgba(255,255,255,0.1); }

.nav-section-title {
  padding: 10px 18px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
}

.nav-list {
  list-style: none;
  margin-bottom: 8px;
}

.nav-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-list li a {
  display: block;
  flex: 1;
  padding: 7px 18px 7px 28px;
  color: #CFCFD7;
  font-size: 0.93rem;
  font-weight: 400;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-list li a:hover { background: rgba(255,255,255,0.06); color: var(--color-white); }
.nav-list li.active a { color: var(--color-blue); font-weight: 700; background: rgba(110,187,213,0.08); }

.endpoint-count {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  padding-right: 18px;
}

/* ---- Content ---- */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
}

.content-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 36px 60px;
}

.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--color-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--color-border);
}

/* ---- Index Page ---- */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 32px;
}

.api-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.api-card {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--color-border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-dark);
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(110,187,213,0.12);
  color: var(--color-blue);
}

.api-card p {
  color: var(--color-muted);
  font-size: 0.93rem;
  margin-bottom: 20px;
  line-height: 1.55;
}

.card-versions h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  margin-bottom: 8px;
}

.card-versions ul {
  list-style: none;
  margin-bottom: 20px;
}

.card-versions li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.card-versions li a {
  font-weight: 700;
  font-size: 0.93rem;
}

.card-versions .endpoint-count {
  font-size: 0.8rem;
  color: var(--color-muted);
  padding-right: 0;
}

.card-action { margin-top: auto; }

.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  background: var(--color-dark);
  color: var(--color-white);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.87rem;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: #2A2A2C; text-decoration: none; }

/* ---- API Section Page ---- */
.toc {
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
  border: 1px solid var(--color-border);
}

.toc h3 {
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 12px;
}

.toc-list { list-style: none; columns: 2; column-gap: 24px; }

.toc-list li {
  break-inside: avoid;
  margin-bottom: 6px;
}

.toc-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.87rem;
  color: var(--color-text);
}
.toc-list a:hover { color: var(--color-blue); }

.toc-method {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--color-white);
  min-width: 44px;
  text-align: center;
}

.toc-list code {
  font-size: 0.82rem;
  color: inherit;
}

/* ---- Endpoint ---- */
.endpoint {
  background: var(--color-white);
  border-radius: var(--radius);
  margin-bottom: 24px;
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #FAFAFE;
  border-bottom: 1px solid var(--color-border);
}

.method-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
  color: var(--color-white);
  min-width: 56px;
  text-align: center;
  letter-spacing: 0.02em;
}

.method-get    { background: var(--color-blue); }
.method-post   { background: var(--color-green); }
.method-put    { background: #F0AD4E; }
.method-patch  { background: #5BC0DE; }
.method-delete { background: #D9534F; }

.endpoint-path {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-dark);
  background: none;
  padding: 0;
}

.endpoint-summary {
  padding: 16px 24px 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.endpoint-notes {
  padding: 8px 24px 0;
  font-size: 0.87rem;
  color: var(--color-muted);
  line-height: 1.55;
}

/* ---- Parameters Table ---- */
.params-section,
.responses-section,
.example-section {
  padding: 16px 24px;
}

.params-section h4,
.responses-section h4 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  margin-bottom: 10px;
}

.params-table,
.responses-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.params-table th,
.responses-table th {
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  padding: 8px 12px;
  border-bottom: 2px solid var(--color-border);
}

.params-table td,
.responses-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.params-table tbody tr:nth-child(even) { background: #FAFAFE; }

.params-table code {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-dark);
}

.required { color: var(--color-green); font-weight: 700; font-size: 0.8rem; }
.optional { color: var(--color-muted); font-size: 0.8rem; }

.status-code {
  display: inline-block;
  font-weight: 700;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

/* ---- Code Blocks ---- */
.example-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.example-header h4 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

.copy-btn {
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-muted);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: border-color 0.15s, color 0.15s;
}
.copy-btn:hover { border-color: var(--color-blue); color: var(--color-blue); }
.copy-btn.copied { border-color: var(--color-green); color: var(--color-green); }

.code-block {
  background: var(--color-code-bg);
  border-radius: var(--radius);
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
  padding: 16px 20px;
  color: #D4D4D4;
  line-height: 1.5;
}

.code-block code { background: none; }

/* Rouge syntax highlighting (dark theme) */
.highlight .s2, .highlight .s1, .highlight .s { color: #CE9178; }   /* strings */
.highlight .mi, .highlight .mf { color: #B5CEA8; }                   /* numbers */
.highlight .kc { color: #569CD6; }                                     /* true/false/null */
.highlight .nl { color: #9CDCFE; }                                     /* JSON keys */
.highlight .p  { color: #D4D4D4; }                                     /* punctuation */

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }
  .hamburger {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-white);
    position: relative;
  }
  .hamburger::before,
  .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-white);
  }
  .hamburger::before { top: -6px; }
  .hamburger::after { top: 6px; }

  .content { margin-left: 0; }
  .content-inner { padding: 24px 16px 40px; }

  .api-cards { grid-template-columns: 1fr; }
  .toc-list { columns: 1; }

  /* Mobile top bar */
  body::before {
    content: '';
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--color-dark);
    z-index: 90;
  }
  .content { padding-top: 56px; }
}

@media (max-width: 480px) {
  .endpoint-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
