/* Unter Documentation — Custom Styles */

:root {
    --color-primary: #000000;
    --color-accent: #DDFF1F;
    --color-sidebar: #0a0a0a;
    --color-sidebar-hover: #1a1a1a;
    --color-text: #1a1a1a;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;
    --color-bg: #ffffff;
    --color-bg-code: #f3f4f6;
    --sidebar-width: 280px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-sidebar);
    color: #ffffff;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #000;
    flex-shrink: 0;
}

.sidebar-logo span {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

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

.sidebar-section {
    padding: 0.5rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
    margin-top: 0.5rem;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 1.25rem;
    color: #aaa;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    color: #fff;
    background: var(--color-sidebar-hover);
}

.sidebar-link.active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
    background: var(--color-sidebar-hover);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #222;
    font-size: 0.75rem;
    color: #555;
}

/* ── Main content ────────────────────────────────────────── */

.main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* ── Typography ──────────────────────────────────────────── */

h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

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

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

p { margin-bottom: 1rem; }

a { color: #000; font-weight: 500; }
a:hover { color: #555; }

.subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

/* ── Code blocks ─────────────────────────────────────────── */

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85em;
    background: var(--color-bg-code);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

pre {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
}

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

/* Prism overrides */
pre[class*="language-"] {
    background: #1a1a2e !important;
    border: 1px solid #2a2a3e;
    padding: 1.25rem !important;
}

:not(pre) > code[class*="language-"] {
    background: var(--color-bg-code);
}

/* ── Tables ──────────────────────────────────────────────── */

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

thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: var(--color-bg-code);
    font-weight: 600;
    border-bottom: 2px solid var(--color-border);
}

tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

tbody tr:hover { background: #fafafa; }

/* ── Cards & callouts ────────────────────────────────────── */

.card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card h3 { margin-top: 0; }

.card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.callout {
    border-left: 4px solid var(--color-accent);
    background: #fafff0;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.875rem;
}

.callout-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.callout-warn {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.callout strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* ── Method badges ───────────────────────────────────────── */

.method {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.15em 0.5em;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.method-get { background: #dcfce7; color: #166534; }
.method-post { background: #dbeafe; color: #1e40af; }
.method-put { background: #fef3c7; color: #92400e; }
.method-patch { background: #fce7f3; color: #9d174d; }
.method-delete { background: #fee2e2; color: #991b1b; }

/* ── Status badges ───────────────────────────────────────── */

.status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2em 0.6em;
    border-radius: 9999px;
    font-family: 'JetBrains Mono', monospace;
}

.status-active { background: #dcfce7; color: #166534; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-failed { background: #fee2e2; color: #991b1b; }
.status-expired { background: #f3f4f6; color: #6b7280; }

/* ── Hero ────────────────────────────────────────────────── */

.hero {
    background: var(--color-primary);
    color: #fff;
    padding: 4rem 2rem;
    margin: -3rem -2rem 3rem -2rem;
    border-radius: 0 0 0 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.hero p {
    color: #aaa;
    font-size: 1.125rem;
    max-width: 600px;
}

.hero .btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: #000;
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    transition: opacity 0.15s ease;
}

.hero .btn:hover { opacity: 0.85; color: #000; }

/* ── Step indicators ─────────────────────────────────────── */

.step {
    counter-increment: step-counter;
    position: relative;
    padding-left: 3rem;
    margin-bottom: 2.5rem;
}

.step::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--color-primary);
    color: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.steps { counter-reset: step-counter; }

/* ── Flow diagram (text-based) ───────────────────────────── */

.flow-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.flow-step .flow-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--color-primary);
    color: var(--color-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.flow-step .flow-content { flex: 1; }
.flow-step .flow-content h4 { margin-top: 0; }

.flow-arrow {
    margin-left: 1.125rem;
    margin-bottom: 0.5rem;
    color: #ccc;
    font-size: 1.25rem;
    line-height: 1;
}

/* ── Hamburger (mobile) ──────────────────────────────────── */

.hamburger {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.25rem;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}

/* ── Footer ──────────────────────────────────────────────── */

.page-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* ── Grid ────────────────────────────────────────────────── */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .hamburger { display: flex; }
    .main { margin-left: 0; }
    .content { padding: 4rem 1.25rem 2rem; }
    .hero { padding: 3rem 1.25rem; margin: -4rem -1.25rem 2rem -1.25rem; }
    .hero h1 { font-size: 1.75rem; }
    .grid-2 { grid-template-columns: 1fr; }
    table { font-size: 0.8125rem; }
    thead th, tbody td { padding: 0.5rem; }
}

/* ── Utility ─────────────────────────────────────────────── */

ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }
