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

:root {
    --sidebar-width: 320px;
    --sidebar-min-width: 200px;
    --sidebar-max-width: 600px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #1e1e1e;
    color: #d4d4d4;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Header */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background-color: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 1100;
    gap: 12px;
}

.header-title {
    flex: 1;
    font-size: 1.1em;
    font-weight: 600;
}

.header-title a {
    color: #4fc3f7;
    text-decoration: none;
}

.header-title a:hover {
    color: #81d4fa;
}

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

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    width: 34px;
    padding: 0;
    background-color: #3c3c3c;
    border: 1px solid #555555;
    border-radius: 4px;
    color: #d4d4d4;
    text-decoration: none;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background-color: #4a4a4a;
    border-color: #4fc3f7;
}

.header-btn.header-btn-compact .api-label strong {
    font-size: 0.85em;
    transform: scaleX(0.75);
}

.header-btn-api {
    height: 34px;
    padding: 2px 0;
}

.api-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    gap: 0;
}

.api-label strong {
    display: block;
}

.api-label small {
    font-size: 0.55em;
    font-weight: normal;
    opacity: 0.7;
    margin-top: -1px;
}

.header-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.sidebar-toggle {
    width: 34px;
    height: 34px;
    background-color: #3c3c3c;
    border: 1px solid #555555;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 8px;
    transition: all 0.2s ease;
}

.sidebar-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background-color: #d4d4d4;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: #4a4a4a;
    border-color: #4fc3f7;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 50px;
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - 50px);
    background-color: #252526;
    border-right: 1px solid #3e3e42;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 15px 20px;
    background-color: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.1em;
    color: #4fc3f7;
    font-weight: 600;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #3e3e42 transparent;
}

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

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: #3e3e42;
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background-color: #4fc3f7;
}

.sidebar-scroll-top {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    padding: 8px;
    background-color: #3c3c3c;
    color: #4fc3f7;
    border: 1px solid #555555;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    margin-bottom: 15px;
    transition: all 0.2s ease;
    display: none;
}

.sidebar-scroll-top.visible {
    display: block;
}

.sidebar-scroll-top:hover {
    background-color: #4a4a4a;
    border-color: #4fc3f7;
}

.sidebar-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    background: transparent;
    z-index: 1051;
    transition: background-color 0.2s ease;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.resizing {
    background: rgba(79, 195, 247, 0.5);
}

body.sidebar-collapsed .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

body.sidebar-collapsed .sidebar-resize-handle {
    display: none;
}

.sidebar-nav h3 {
    color: #4fc3f7;
    font-size: 0.9em;
    text-transform: uppercase;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.sidebar-nav h3:first-child {
    margin-top: 0;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 4px 0;
}

.sidebar-nav a {
    display: block;
    color: #d4d4d4;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover {
    background-color: #2d2d30;
    color: #4fc3f7;
}

.sidebar-nav a.active {
    background-color: #094771;
    color: #ffffff;
    font-weight: 500;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid #3e3e42;
    font-size: 0.75em;
    color: #858585;
    text-align: center;
    flex-shrink: 0;
}

body.sidebar-collapsed .sidebar-footer {
    display: none;
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    margin-top: 50px;
    padding: 30px;
    min-height: calc(100vh - 50px);
    transition: margin-left 0.3s ease;
}

body.sidebar-collapsed .content {
    margin-left: 0;
}

.docs-content {
    /* Remove max-width and centering for full-width content like API docs */
}

.docs-content h1 {
    color: #4fc3f7;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3e3e42;
}

.docs-content h2 {
    color: #4fc3f7;
    margin-top: 30px;
    margin-bottom: 15px;
}

.docs-content h3 {
    color: #81d4fa;
    margin-top: 25px;
    margin-bottom: 12px;
}

.docs-content p {
    margin-bottom: 15px;
}

.docs-content ul, .docs-content ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

.docs-content li {
    margin-bottom: 8px;
}

.docs-content a {
    color: #4fc3f7;
    text-decoration: none;
}

.docs-content a:hover {
    color: #81d4fa;
    text-decoration: underline;
}

.docs-content code {
    background-color: #1e1e1e;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #ce9178;
}

.docs-content pre {
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.docs-content pre code {
    background: none;
    padding: 0;
    color: #d4d4d4;
}

.docs-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 15px 0;
}

/* GitHub-style Alerts (Markdig format) */
.docs-content .markdown-alert {
    margin: 20px 0;
    padding: 15px 20px;
    border-left: 4px solid;
    border-radius: 4px;
}

.docs-content .markdown-alert-note {
    background-color: rgba(76, 195, 247, 0.1);
    border-color: #4fc3f7;
}

.docs-content .markdown-alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
}

.docs-content .markdown-alert-important {
    background-color: rgba(156, 39, 176, 0.1);
    border-color: #9c27b0;
}

.docs-content .markdown-alert-tip {
    background-color: rgba(76, 175, 80, 0.1);
    border-color: #4caf50;
}

.docs-content .markdown-alert-caution {
    background-color: rgba(244, 67, 54, 0.1);
    border-color: #f44336;
}

.docs-content .markdown-alert-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.docs-content .markdown-alert-title svg {
    margin-right: 8px;
    fill: currentColor;
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .content {
        margin-left: 0;
        padding: 20px;
    }
}
