/* ==================== */
/* Variables & Reset    */
/* ==================== */

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

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --text: #1a1f36;
    --text-light: #6b7c93;
    --border: #e3e8ee;
    --bg: #ffffff;
    --bg-light: #f6f9fc;
    --code-bg: #0a2540;
    --success: #00d924;
    --sidebar-width: 280px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    overflow-x: hidden; /* prevent horizontal scroll from wide code blocks */
}

/* ==================== */
/* Layout               */
/* ==================== */

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

/* ==================== */
/* Sidebar              */
/* ==================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.logo-icon {
    font-size: 28px;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    padding: 8px 24px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.nav-item {
    display: block;
    padding: 8px 24px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.nav-item.active {
    color: var(--primary);
    background: var(--bg-light);
    border-left: 2px solid var(--primary);
}

.nav-item.method {
    display: flex;
    align-items: center;
    gap: 8px;
}

.method-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.method-badge.post {
    background: #00d924;
    color: white;
}

.method-badge.get {
    background: #0074e0;
    color: white;
}

.method-badge.delete {
    background: #ff4444;
    color: white;
}

/* ==================== */
/* Main Content         */
/* ==================== */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;           /* flex children can shrink below content size */
    overflow-x: hidden;
}

.content-area {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 40px;
    box-sizing: border-box;
}

/* ==================== */
/* Typography           */
/* ==================== */

h1 {
    font-size: 40px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
    margin-top: 60px;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
    scroll-margin-top: 20px;
}

h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-top: 40px;
    margin-bottom: 16px;
}

h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 12px;
}

p {
    color: var(--text-light);
    margin-bottom: 16px;
    line-height: 1.7;
}

.subtitle {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 40px;
}

/* ==================== */
/* Endpoint Cards       */
/* ==================== */

.endpoint-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    margin: 32px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.method-tag {
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.method-tag.post {
    background: rgba(0, 217, 36, 0.1);
    color: #00d924;
}

.method-tag.get {
    background: rgba(0, 116, 224, 0.1);
    color: #0074e0;
}

.method-tag.delete {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
}

.endpoint-path {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 15px;
    color: var(--text);
    font-weight: 500;
    word-break: break-all;
}

/* ==================== */
/* Parameters Table     */
/* ==================== */

.params-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    display: block;
    overflow-x: auto;
}

.params-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.params-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
}

.params-table tr:last-child td {
    border-bottom: none;
}

.param-name {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
}

.param-type {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 12px;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.param-required {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #00d924;
}

.param-optional {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

/* ==================== */
/* Code Examples        */
/* ==================== */

.code-example-wrapper {
    margin: 32px 0;
}

.code-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: -1px;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.code-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, monospace;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.code-tab:hover {
    color: var(--text);
}

.code-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.code-content {
    display: none;
}

.code-content.active {
    display: block;
}

pre {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 24px;
    overflow-x: auto;
    max-width: 100%;        /* never wider than its container */
    box-sizing: border-box;
    margin: 0;
    color: #e3e8ee;
}

code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e3e8ee;
}

/* ==================== */
/* Callouts             */
/* ==================== */

.callout {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 24px 0;
    border-left: 3px solid;
}

.callout.info {
    background: rgba(102, 126, 234, 0.05);
    border-color: var(--primary);
}

.callout.warning {
    background: rgba(255, 193, 7, 0.05);
    border-color: #ffc107;
}

.callout.success {
    background: rgba(0, 217, 36, 0.05);
    border-color: #00d924;
}

.callout-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.callout.info .callout-title {
    color: var(--primary);
}

.callout.warning .callout-title {
    color: #ffc107;
}

.callout.success .callout-title {
    color: #00d924;
}

/* ==================== */
/* Inline Code          */
/* ==================== */

.content-area code {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
}

.content-area pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ==================== */
/* Links                */
/* ==================== */

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ==================== */
/* Back Button          */
/* ==================== */

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 40px;
    transition: all 0.2s;
}

.back-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ==================== */
/* Mobile Menu Toggle   */
/* ==================== */

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
}

/* ==================== */
/* Sidebar Overlay      */
/* ==================== */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 150;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* ==================== */
/* Scrollbar Styling    */
/* ==================== */

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* ==================== */
/* Tablet (≤1024px)     */
/* ==================== */

@media (max-width: 1024px) {
    /* Show toggle button */
    .mobile-menu-toggle {
        display: block;
    }

    /* Sidebar off-screen by default */
    .sidebar {
        transform: translateX(-100%);
        z-index: 160;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    }

    /* Content fills full width */
    .main-content {
        margin-left: 0;
    }

    /* Add top padding so content clears the toggle button */
    .content-area {
        padding: 80px 32px 60px;
        max-width: 800px;
    }

    h1 { font-size: 34px; }
    h2 { font-size: 26px; margin-top: 50px; }
    h3 { font-size: 20px; }

    .endpoint-card {
        padding: 24px;
    }

    .subtitle {
        font-size: 16px;
    }
}

/* ==================== */
/* Phone (≤600px)       */
/* ==================== */

@media (max-width: 600px) {
    .mobile-menu-toggle {
        top: 12px;
        left: 12px;
        padding: 8px 12px;
        font-size: 16px;
    }

    .content-area {
        padding: 70px 16px 48px;
    }

    h1 { font-size: 26px; letter-spacing: -0.3px; }
    h2 { font-size: 22px; margin-top: 40px; margin-bottom: 16px; }
    h3 { font-size: 18px; margin-top: 32px; }
    h4 { font-size: 15px; }

    .subtitle {
        font-size: 15px;
        margin-bottom: 28px;
    }

    /* Endpoint cards */
    .endpoint-card {
        padding: 16px;
        margin: 20px 0;
    }

    .endpoint-path {
        font-size: 12px;
    }

    /* Parameters table */
    .params-table th,
    .params-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    /* Code blocks */
    pre {
        padding: 14px;
        border-radius: 6px;
    }

    code {
        font-size: 12px;
    }

    /* Code tabs — scrollable row of tabs */
    .code-tabs {
        gap: 2px;
    }

    .code-tab {
        padding: 8px 10px;
        font-size: 11px;
    }

    /* Callouts */
    .callout {
        padding: 12px 14px;
    }

    /* Back button */
    .back-button {
        padding: 8px 16px;
        font-size: 13px;
        margin-bottom: 28px;
    }

    /* Reduce section spacing */
    .code-example-wrapper {
        margin: 20px 0;
    }
}