html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #1e1e1e; 
    color: #d4d4d4;
    display: flex;
    margin: 0;
}

::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #252526;
}
::-webkit-scrollbar-thumb {
    background: #4e94ce;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #569cd6;
}

#sidebar {
    width: 260px;
    background: #252526; 
    padding: 20px;
    height: 100vh;
    position: fixed;
    overflow-y: auto;
    border-right: 1px solid #3c3c3c;
    transition: transform 0.3s ease;
    z-index: 1001; 
    box-shadow: 3px 0 15px rgba(0,0,0,0.2);
}

#sidebar h2 {
    margin-top: 0;
    color: #d4d4d4;
    padding-bottom: 10px;
    border-bottom: 1px solid #3c3c3c;
    margin-bottom: 20px;
}

#sidebar ul {
    list-style: none;
    padding: 0;
}

#sidebar ul li a {
    text-decoration: none;
    color: #cccccc;
    display: block;
    padding: 8px 15px; 
    margin-bottom: 2px; 
    border-radius: 4px; 
    transition: color 0.2s, background-color 0.2s;
}

#sidebar ul li a:hover {
    color: #ffffff;
    background-color: #3a3d41; 
}

#sidebar ul li a.active {
    color: #ffffff;
    background-color: #4e94ce;
    font-weight: bold;
}

#sidebar ul ul {
    padding-left: 20px;
    margin-top: 5px;
}

#content {
    padding: 20px 40px; 
    max-width: 800px;
}

#content a {
    color: #9cdcfe;
    transition: color 0.2s;
}

#content a:hover {
    text-decoration: underline;
    color: #4e94ce;
}

h1, h2, h3, h4 {
    color: #569cd6;
    font-weight: 500;
}

h1 {
    border-bottom: 2px solid #3c3c3c;
    padding-bottom: 10px;
    margin-top: 0;
}
h2 {
    border-bottom: 1px solid #3c3c3c;
    padding-bottom: 8px;
    margin-top: 2.5em;
}
h3 {
    margin-top: 2em;
}

code {
    background: #3a3d41;
    color: #d4d4d4;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

pre {
    background: #252526;
    color: #dcdcdc;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #3c3c3c;
    overflow-x: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); 
    position: relative; 
}

.module-section {
    margin-bottom: 2em;
    padding: 20px;
    border: 1px solid #3c3c3c;
    border-radius: 5px;
    background-color: #252526;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease;
}
.module-section:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.function-def {
    margin-bottom: 1.5em;
    padding-bottom: 1em;
    border-bottom: 1px solid #333;
}
.function-def:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.function-def h4 {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    color: #9cdcfe; 
}

.intro-logo {
    float: right;
    width: 120px;
    height: 120px;
    margin-left: 20px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.download-button {
    display: inline-block;
    background-color: #4e94ce; 
    color: #ffffff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 15px;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.download-button:hover {
    background-color: #569cd6; 
    text-decoration: none;
    transform: translateY(-2px); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}


#sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 280px; 
    z-index: 1002; 
    background-color: rgba(78, 148, 206, 0.8); 
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    line-height: 38px; 
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#sidebar-toggle:hover {
    background-color: #569cd6; 
    transform: scale(1.1);
}


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

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

body.sidebar-collapsed #sidebar-toggle {
    left: 20px;
}


pre .copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #3a3d41;
    color: #cccccc;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0; 
    transition: opacity 0.2s, background-color 0.2s, color 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
pre:hover .copy-button {
    opacity: 1; 
}
pre .copy-button:hover {
    background-color: #569cd6;
    color: #ffffff;
}


#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; 
}


body:not(.sidebar-collapsed) #overlay {
    opacity: 1;
    pointer-events: auto; 
}


@media (max-width: 850px) {
    body {
        font-size: 15px; 
    }

    #content {
        padding: 20px 12px; 
    }

    #sidebar {
        width: 280px; 
        max-width: 80vw; 
    }

    h1 {
        font-size: 1.8em; 
    }

    h2 {
        margin-top: 2em; 
        font-size: 1.5em;
    }

    .intro-logo {
        float: none; 
        display: block; 
        margin: 0 auto 20px; 
        width: 100px; 
        height: 100px;
    }

    pre {
        padding: 12px;
        font-size: 0.9em; 
    }

    .download-button {
        padding: 10px 20px; 
        width: 100%; 
        box-sizing: border-box; 
        text-align: center;
    }

    .module-section {
        padding: 15px 12px; 
    }
}


#sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 280px; 
    z-index: 1002; 
    background-color: rgba(78, 148, 206, 0.8); 
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    line-height: 38px; 
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#sidebar-toggle:hover {
    background-color: #569cd6; 
    transform: scale(1.1);
}


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

body.sidebar-collapsed #sidebar-toggle {
    left: 20px;
}


table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95em;
}

thead {
    background-color: #3a3d41;
}

th, td {
    border: 1px solid #3c3c3c;
    padding: 10px 12px;
    text-align: left;
}

th {
    color: #d4d4d4;
    font-weight: 600;
}

tbody tr:nth-child(odd) {
    background-color: #252526;
}

tbody tr:hover {
    background-color: #3a3d41;
}

hr {
    border: none;
    border-top: 1px solid #3c3c3c;
    margin: 2em 0;
}