/* ============================================================
   CWorkLog API Documentation Styles
   ============================================================ */

/* --- Layout --- */
.apidocs-wrap {
    display: flex;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1a1a2e;
    background: #f8f9fb;
}

/* --- Sidebar --- */
.apidocs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    background: #1a1a2e;
    color: #c4c8d8;
    padding: 0;
    z-index: 100;
    border-right: 1px solid #2a2a4a;
}

.apidocs-sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid #2a2a4a;
}

.apidocs-sidebar-logo {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}

.apidocs-sidebar-sub {
    font-size: 12px;
    color: #8888aa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.apidocs-manage-link {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: #6ea8fe;
    text-decoration: none;
}
.apidocs-manage-link:hover {
    color: #9ec5fe;
    text-decoration: underline;
}

.apidocs-nav {
    list-style: none;
    margin: 0;
    padding: 12px 0;
}

.apidocs-nav-group {
    padding: 0;
    margin: 0;
}

.apidocs-nav-heading {
    display: block;
    padding: 12px 20px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #6b6b8d;
}

.apidocs-nav-link {
    display: block;
    padding: 6px 20px 6px 28px;
    color: #b0b4c8;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.apidocs-nav-link:hover {
    background: #24244a;
    color: #ffffff;
}

.apidocs-nav-link.active {
    background: #24244a;
    color: #ffffff;
    border-left-color: #4a90d9;
}

/* --- Main content --- */
.apidocs-main {
    margin-left: 260px;
    flex: 1;
    padding: 40px 48px 80px;
    max-width: 900px;
}

/* --- Hero / intro --- */
.apidocs-hero {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e0e3eb;
}

.apidocs-hero h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
}

.apidocs-hero p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 8px;
}

/* --- Section --- */
.apidocs-section {
    margin-bottom: 56px;
    scroll-margin-top: 24px;
}

.apidocs-section h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e3eb;
}

/* --- Endpoint block --- */
.apidocs-endpoint {
    margin-bottom: 40px;
    background: #ffffff;
    border: 1px solid #e0e3eb;
    border-radius: 8px;
    padding: 24px;
    scroll-margin-top: 24px;
}

.apidocs-endpoint h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.apidocs-method {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

.apidocs-method-get {
    background: #e6f4ea;
    color: #1a7f37;
}

.apidocs-method-post {
    background: #e3edf9;
    color: #1a5fb4;
}

.apidocs-method-put {
    background: #fef3e2;
    color: #9a6700;
}

.apidocs-method-delete {
    background: #fde8e8;
    color: #c0392b;
}

.apidocs-path {
    font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.apidocs-endpoint-desc {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 16px;
}

/* --- Parameter tables --- */
.apidocs-params {
    margin-bottom: 16px;
}

.apidocs-params-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b6b8d;
    margin: 0 0 8px;
}

.apidocs-params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.apidocs-params-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f4f5f8;
    color: #555;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e0e3eb;
}

.apidocs-params-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f1f4;
    vertical-align: top;
    color: #333;
}

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

.apidocs-param-name {
    font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    color: #1a1a2e;
}

.apidocs-param-required {
    color: #c0392b;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

.apidocs-param-optional {
    color: #888;
    font-size: 11px;
    font-style: italic;
    margin-left: 4px;
}

.apidocs-param-type {
    font-size: 12px;
    color: #6b6b8d;
    font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

/* --- Code blocks --- */
.apidocs-code-wrap {
    position: relative;
    margin-bottom: 12px;
}

.apidocs-code-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b6b8d;
    margin: 0 0 6px;
}

.apidocs-code {
    background: #1e1e2e;
    color: #e0e0e0;
    border-radius: 6px;
    padding: 16px 20px;
    overflow-x: auto;
    font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    white-space: pre;
    tab-size: 2;
}

.apidocs-copy-btn {
    position: absolute;
    top: 28px;
    right: 8px;
    background: #333355;
    border: none;
    color: #aaa;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.apidocs-copy-btn:hover {
    background: #4a4a7a;
    color: #fff;
}

.apidocs-copy-btn.copied {
    background: #1a7f37;
    color: #fff;
}

/* --- Auth section --- */
.apidocs-auth-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.apidocs-auth-card {
    background: #ffffff;
    border: 1px solid #e0e3eb;
    border-radius: 8px;
    padding: 20px;
}

.apidocs-auth-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #1a1a2e;
}

.apidocs-auth-card p {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin: 0;
}

/* --- Info boxes --- */
.apidocs-info {
    background: #e3edf9;
    border-left: 4px solid #4a90d9;
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 13px;
    color: #1a4a7a;
    line-height: 1.5;
}

.apidocs-warning {
    background: #fef3e2;
    border-left: 4px solid #e6a817;
    border-radius: 0 6px 6px 0;
    padding: 14px 18px;
    margin: 16px 0;
    font-size: 13px;
    color: #7a5a00;
    line-height: 1.5;
}

/* --- Base URL --- */
.apidocs-base-url {
    background: #ffffff;
    border: 1px solid #e0e3eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 16px 0;
    font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    color: #1a1a2e;
}

.apidocs-base-url-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    display: block;
    margin-bottom: 6px;
}

/* --- Response status codes --- */
.apidocs-status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
}

.apidocs-status-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f4f5f8;
    color: #555;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e0e3eb;
}

.apidocs-status-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f1f4;
    vertical-align: top;
    color: #333;
}

.apidocs-status-code {
    font-family: "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 700;
    font-size: 13px;
}

.apidocs-status-2xx {
    color: #1a7f37;
}

.apidocs-status-4xx {
    color: #c0392b;
}

.apidocs-status-5xx {
    color: #9a6700;
}

/* --- Mobile sidebar toggle --- */
.apidocs-menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: #1a1a2e;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .apidocs-auth-methods {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .apidocs-menu-toggle {
        display: block;
    }

    .apidocs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .apidocs-sidebar.open {
        transform: translateX(0);
    }

    .apidocs-main {
        margin-left: 0;
        padding: 60px 20px 60px;
    }

    .apidocs-endpoint h3 {
        flex-direction: column;
        align-items: flex-start;
    }
}
