/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary-color: #007bff;
    /* Branded Blue */
    --header-bg: #0e65c9;
    /* Distinct Blue Header */
    --sidebar-bg: #151719;
    /* Dark Sidebar */
    --content-bg: #0d1117;
    /* Very Dark Content */
    --code-bg: #000000;
    /* Pitch Black for Code */
    --text-color: #e6edf3;
    --text-muted: #8b949e;
    --border-color: #30363d;
    --input-bg: #0d1117;
    --input-border: #30363d;
    --sidebar-width: 280px;
    --code-column-width: 45%;

    --success-color: #238636;
    /* Green for POST/200 */
    --danger-color: #da3633;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--content-bg);
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.main-header {
    height: 60px;
    background-color: var(--header-bg);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 200;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.header-logo {
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
}

.header-nav {
    margin-left: auto;
    display: flex;
    gap: 20px;
}

.header-nav a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.header-nav a:hover {
    color: white;
}

/* Body Wrapper (Sidebar + Main) */
.body-wrapper {
    display: flex;
    margin-top: 60px;
    /* Offset for header */
    min-height: calc(100vh - 60px);
    /* Fill screen but allow grow */
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    /* Sticky behavior */
    position: sticky;
    top: 60px;
    /* Below header */
    height: calc(100vh - 60px);
    overflow-y: auto;
    padding: 2rem 0;
    flex-shrink: 0;
}

/* ... nav styles ... */
.nav-group {
    margin-bottom: 2rem;
    padding: 0 1.5rem;
}

/* Main Content Wrapper (Removed scroll) */
.content-split {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    /* overflow-y: auto;  REMOVED */
    overflow-x: hidden;
}

/* Row for the 2 columns */
.doc-row {
    display: flex;
    flex: 1;
    width: 100%;
}

/* Left Content Column */
.content-column {
    flex: 1;
    padding: 3rem 4rem;
    background-color: var(--content-bg);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

h2 {
    font-size: 1.8rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: white;
}

h3 {
    font-size: 1.2rem;
    margin-top: 2rem;
    color: white;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.5rem;
    color: #c9d1d9;
}

/* Endpoint Box */
.endpoint-box {
    background: #161b22;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.method-badge {
    background-color: rgba(35, 134, 54, 0.2);
    color: #3fb950;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    border: 1px solid rgba(35, 134, 54, 0.4);
}

.endpoint-url {
    color: white;
    opacity: 0.9;
}

.try-btn {
    margin-left: auto;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

/* Form Styles for Parameters */
.params-box {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    background: #161b22;
}

.form-group {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.form-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.param-check {
    margin-top: 4px;
    margin-right: 15px;
}

.param-details {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.param-label-group {
    display: flex;
    flex-direction: column;
}

.param-name {
    font-weight: 600;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.param-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.param-input-group input,
.param-input-group textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.param-input-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.param-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Code Column (Right Side) */
.code-column {
    width: var(--code-column-width);
    background-color: var(--code-bg);
    border-left: 1px solid var(--border-color);
    padding: 2rem;
    /* Parent handles height, this sticks within it */
}

/* Inner sticky wrapper for code */
.code-column-inner {
    position: sticky;
    top: 80px;
    /* Header (60) + Buffer (20) */
    max-height: calc(100vh - 80px);
    /* Allow internal scroll if code is long */
    overflow-y: auto;
}


.code-block {
    margin-bottom: 2rem;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.code-title {
    color: white;
    font-weight: 600;
}

.language-tabs {
    display: flex;
    gap: 8px;
}

.lang-tab {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-tab:hover,
.lang-tab.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(0, 123, 255, 0.1);
}

.code-content {
    background: #111;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
}

/* Syntax Highlighting overrides */
.hljs {
    background: transparent !important;
    padding: 0 !important;
}

/* Footer Styles */
.main-footer {
    background-color: #161b22;
    /* Slightly Lighter than content for distinction */
    border-top: 1px solid var(--border-color);
    padding: 4rem 4rem 2rem 4rem;
    color: var(--text-color);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.footer-col h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-legal-links {
    display: flex;
    gap: 1.5rem;
}

.footer-legal-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-legal-links a:hover {
    color: white;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icon {
    color: var(--text-muted);
    text-decoration: none;
}

.social-icon:hover {
    color: white;
}


/* Responsiveness */
@media (max-width: 1200px) {
    .doc-row {
        flex-direction: column;
    }

    .content-column,
    .code-column {
        width: 100%;
        overflow: visible;
    }

    .code-column {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }

    .main-footer {
        padding: 3rem 2rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 60px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content-column {
        padding: 2rem 1.5rem;
    }

    .mobile-nav-toggle {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 20px;
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        z-index: 1100;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        cursor: pointer;
    }
}