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

:root {
    --sidebar-w: 260px;
    --header-h: 60px;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --primary: #16a34a;
    --primary-dark: #15803d;
    --prod: #2563eb;
    --stage: #f59e0b;
    --code-bg: #f3f4f6;
    --danger: #ef4444;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

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

/* ===== Header ===== */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    height: 100%;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo img { height: 28px; width: auto; display: block; }
.logo span {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 15px;
    padding-left: 10px;
    border-left: 1px solid var(--border);
}
.top-nav { display: flex; gap: 20px; }
.top-nav a { color: var(--text); font-weight: 500; font-size: 14px; }

/* ===== Layout ===== */
.layout {
    display: flex;
    padding-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
}
.sidebar {
    width: var(--sidebar-w);
    border-right: 1px solid var(--border);
    background: var(--bg-alt);
    padding: 24px 0;
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    overflow-y: auto;
}
.nav-section { margin-bottom: 24px; }
.nav-section-title {
    padding: 0 24px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.sidebar ul { list-style: none; }
.sidebar li a {
    display: block;
    padding: 6px 24px;
    color: var(--text);
    font-size: 14px;
    border-left: 3px solid transparent;
}
.sidebar li a:hover { background: #eef2f6; text-decoration: none; }
.sidebar li a.active {
    background: #e9f4ee;
    border-left-color: var(--primary);
    color: var(--primary-dark);
    font-weight: 600;
}

.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
}
.content {
    max-width: 860px;
    width: 100%;
    min-width: 0;
    padding: 48px 56px;
}
.content > * { max-width: 100%; }

/* ===== Typography ===== */
h1 { font-size: 32px; margin-bottom: 12px; }
h2 { font-size: 24px; margin: 36px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
h3 { font-size: 18px; margin: 24px 0 10px; }
h4 { font-size: 15px; margin: 16px 0 6px; }
p { margin-bottom: 14px; }
ul, ol { margin: 0 0 14px 22px; }
li { margin-bottom: 4px; }
strong { font-weight: 600; }

.lead { color: var(--text-muted); font-size: 17px; }

/* ===== Cards / Callouts ===== */
.callout {
    padding: 14px 18px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid;
    background: var(--bg-alt);
    font-size: 14px;
}
.callout.info    { border-left-color: var(--prod);    background: #eff6ff; }
.callout.warning { border-left-color: var(--stage);   background: #fffbeb; }
.callout.danger  { border-left-color: var(--danger);  background: #fef2f2; }
.callout.success { border-left-color: var(--primary); background: #f0fdf4; }
.callout b { display: block; margin-bottom: 4px; }

/* ===== Environment Tag ===== */
.env-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    vertical-align: middle;
}
.env-tag.prod  { background: #dbeafe; color: #1e40af; }
.env-tag.stage { background: #fef3c7; color: #92400e; }

/* ===== Env URL Box ===== */
.env-urls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0 24px;
}
.env-url {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    background: var(--bg);
}
.env-url.prod  { border-top: 3px solid var(--prod); }
.env-url.stage { border-top: 3px solid var(--stage); }
.env-url .env-label { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; margin-bottom: 6px; }
.env-url.prod  .env-label { color: var(--prod); }
.env-url.stage .env-label { color: var(--stage); }
.env-url code {
    display: block;
    background: var(--code-bg);
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 13px;
    word-break: break-all;
}
.env-url p { font-size: 12px; color: var(--text-muted); margin: 8px 0 0; }

/* ===== Method Badge ===== */
.method {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-right: 8px;
    vertical-align: middle;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.method.get    { background: #dbeafe; color: #1e40af; }
.method.post   { background: #dcfce7; color: #166534; }
.method.put    { background: #fef3c7; color: #92400e; }
.method.delete { background: #fee2e2; color: #991b1b; }

/* ===== Code ===== */
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}
p code, li code, td code {
    background: var(--code-bg);
    padding: 1px 6px;
    border-radius: 4px;
    color: #be185d;
}
pre[class*="language-"],
pre:has(code[class*="language-"]) {
    margin: 14px 0 22px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    line-height: 1.65 !important;
    padding: 14px 18px !important;
    background: #282828 !important;
    color: #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    text-shadow: none !important;
    overflow-x: auto !important;
}
pre[class*="language-"] code,
pre:has(code[class*="language-"]) code {
    font-size: inherit !important;
    line-height: inherit !important;
    background: transparent !important;
    color: #e5e7eb !important;
    text-shadow: none !important;
}

/* Prism token renkleri — okunurluk için canlandır */
.token.property           { color: #60a5fa !important; } /* JSON key: mavi */
.token.string             { color: #86efac !important; } /* string: açık yeşil */
.token.number             { color: #fbbf24 !important; } /* number: amber */
.token.boolean,
.token.null                { color: #f472b6 !important; } /* bool/null: pembe */
.token.operator,
.token.punctuation        { color: #d1d5db !important; }
.token.comment            { color: #9ca3af !important; font-style: italic; }
.token.keyword,
.token.builtin            { color: #c084fc !important; } /* keyword: mor */
.token.function           { color: #fcd34d !important; } /* fonksiyon: sarı */
.token.class-name         { color: #fcd34d !important; }
.token.tag                { color: #f87171 !important; }

/* ===== Tables ===== */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 14px 0 22px;
    font-size: 14px;
}
th, td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
th { background: var(--bg-alt); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* ===== Footer ===== */
.site-footer {
    margin-left: var(--sidebar-w);
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--text-muted);
    font-size: 13px;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 56px;
}

/* ===== Responsive ===== */
/* ===== Mobile menu toggle ===== */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
}

@media (max-width: 900px) {
    :root { --sidebar-w: 0px; }

    html, body { overflow-x: hidden; max-width: 100vw; }
    .layout { width: 100%; max-width: 100vw; }
    .main-wrap { width: 100%; max-width: 100vw; }
    .content { max-width: 100vw; }

    .header-inner { padding: 0 16px; }
    .logo { font-size: 15px; gap: 8px; }
    .logo img { height: 24px; }
    .logo span { font-size: 13px; padding-left: 8px; }
    .top-nav { gap: 12px; }
    .top-nav a { font-size: 13px; }

    .menu-toggle { display: inline-flex; align-items: center; gap: 6px; }

    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 200;
        box-shadow: 2px 0 12px rgba(0,0,0,0.08);
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: var(--header-h) 0 0 0;
        background: rgba(0,0,0,0.4);
        z-index: 150;
    }
    .sidebar-overlay.open { display: block; }

    .main-wrap, .site-footer { margin-left: 0; }
    .content { padding: 24px 20px; }
    .footer-inner { padding: 20px 20px; flex-direction: column; gap: 6px; }

    h1 { font-size: 26px; }
    h2 { font-size: 20px; margin: 28px 0 10px; }
    h3 { font-size: 16px; }

    /* Tablolar yatay scroll */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    table code { white-space: normal; word-break: break-word; }

    /* Code blocklar ekran dışına taşmasın */
    pre[class*="language-"],
    pre:has(code[class*="language-"]) {
        font-size: 12.5px !important;
        padding: 12px 14px !important;
    }
    .code-tabs pre[class*="language-"],
    .code-tabs pre:has(code[class*="language-"]) {
        padding: 20px 18px !important;
    }

    /* URL kartlarında uzun URL'ler taşmasın */
    .env-url code {
        font-size: 11.5px;
        word-break: break-all;
    }

    /* Callout içerisi daralsın */
    .callout { padding: 12px 14px; font-size: 13px; }
}

@media (max-width: 500px) {
    .logo span { display: none; }
    .content { padding: 20px 16px; }
    h1 { font-size: 23px; }
    .code-tab { padding: 10px 12px; font-size: 12px; }
    .env-urls { gap: 8px; }
    .env-url { padding: 12px; }
    .copy-btn { width: 28px; height: 28px; }
}

/* ===== Copy Button ===== */
.code-wrapper { position: relative; }
.copy-btn {
    position: absolute;
    top: 8px; right: 10px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    color: #d1d5db;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s;
    z-index: 2;
}
.copy-btn:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border-color: rgba(255,255,255,0.25);
}
.copy-btn.copied {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.35);
}

/* Standalone code blocklar için kopyala butonu hover'da belirsin */
.code-wrapper .copy-btn { opacity: 0; }
.code-wrapper:hover .copy-btn { opacity: 1; }

/* ===== Code Tabs ===== */
.code-tabs {
    margin: 16px 0 24px;
    border-radius: 8px;
    background: #2d2d2d;
    position: relative;
    isolation: isolate;
}
.code-tabs-header {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.code-tabs-body {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
}
.code-tabs-header {
    display: flex;
    gap: 2px;
    background: #1f1f1f;
    padding: 0 6px 0 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    border-bottom: 1px solid #0f0f0f;
    padding-right: 50px; /* kopya ikonuna yer */
}
.code-tabs-header::-webkit-scrollbar { height: 3px; }
.code-tabs-header::-webkit-scrollbar-thumb { background: #4a4a4a; }

.code-tab {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    margin-bottom: -1px;
}
.code-tab:hover { color: #e5e7eb; }
.code-tab.active {
    color: #fff;
    border-bottom-color: var(--primary);
}

.code-tabs-body { position: relative; }
.code-tab-content { display: none; }
.code-tab-content.active { display: block; }

.code-tabs pre[class*="language-"],
.code-tabs pre:has(code[class*="language-"]) {
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 26px 28px !important;
    background: #2d2d2d !important;
    box-shadow: none !important;
    overflow-x: auto !important;
    max-width: 100%;
}
.code-tabs pre code {
    display: block;
    white-space: pre !important;
    min-width: 0;
}
