@font-face {
    font-family: "Liberation Mono";
    src: url("fonts/LiberationMono-Regular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: "Liberation Mono";
    src: url("fonts/LiberationMono-Bold.ttf") format("truetype");
    font-weight: bold;
    font-style: normal;
}
body {
    font-family: "Noto Sans", sans-serif;
    display: flex;
    flex-direction: row;
    line-height: 1.6;
    margin: 0;
    background-color: #161b22;
    color: #c9d1d9;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #0d1117;
    border-bottom: 1px solid #21262d;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1000;
}
.top-bar .logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}
.top-bar a {
    margin: 0;
    color: #c9d1d9;
    text-decoration: none;
}
.top-bar .page-title {
    margin: 0;
    font-weight: 600;
    color: #c9d1d9;
}
.top-bar .menu-toggle {
    display: none;
    font-size: 1.5em;
    background: none;
    border: none;
    cursor: pointer;
    color: #c9d1d9;
}
.top-bar .menu-toggle:hover {
    color: #58a6ff;
}

.sidebar {
    width: 20%;
    position: fixed;
    left: 0;
    top: 60px;
    height: 100vh;
    overflow-y: auto;
    padding: 24px;
    box-sizing: border-box;
    border-right: 1px solid #21262d;
    background-color: #161b22;
    transition: transform 0.3s ease;
}
.sidebar h2 {
    margin-top: 0;
    font-size: 1.25em;
    font-weight: 600;
    color: #c9d1d9;
}
.sidebar ul {
    list-style: none;
    padding: 0;
}
.sidebar li a {
    text-decoration: none;
    color: #c9d1d9;
    display: block;
    padding: 8px 0;
    font-weight: 500;
}
.sidebar li a:hover {
    color: #58a6ff;
}
.sidebar li a.active {
    color: #58a6ff;
    font-weight: 600;
    background-color: #21262d;
    border-radius: 4px;
    padding-left: 8px;
}

.content {
    width: 60%;
    margin-left: 20%;
    padding: 32px;
    box-sizing: border-box;
    margin-top: 60px;
    background-color: #161b22;
}

/* TOC */
.toc {
    width: 20%;
    position: fixed;
    right: 0;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    padding-left: 20px;
    transition: opacity 0.3s ease;
}
.toc h3 {
    margin-top: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #c9d1d9;
}
.toc ul {
    list-style: none;
    padding-left: 10px;
}
.toc li a {
    text-decoration: none;
    color: #8b949e;
    font-size: 0.9em;
    display: block;
    padding: 4px 0;
    font-weight: 400;
}
.toc li a:hover {
    color: #58a6ff;
}
.toc li a.active {
    color: #58a6ff;
    font-weight: 500;
}

/* Code Styling */
pre {
    background-color: #21262d;
    border: 1px solid #30363d;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #c9d1d9;
}
code {
    background-color: #21262d;
    border: 1px solid #30363d;
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: "Liberation Mono", monospace;
    font-size: 10px;
    color: #c9d1d9;
}
pre code {
    background-color: transparent;
    border: none;
    padding: 0;
    font-size: 100%;
}

/* Table Styling (GitHub-inspired) */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
th,
td {
    border: 1px solid #30363d;
    padding: 8px 16px;
    text-align: left;
    color: #c9d1d9;
}
th {
    background-color: #21262d;
    font-weight: 600;
}
td {
    background-color: #161b22;
}
tr:hover td {
    background-color: #1c2529;
}

.card {
    background-color: #161b22;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 16px;
    margin: 16px 0;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 999;
        position: fixed;
        top: 60px;
        left: 0;
        background-color: #0d1117;
        padding: 24px;
        box-sizing: border-box;
        overflow-y: auto;
    }
    .sidebar.active {
        transform: translateX(0);
        width: 100vw;
    }
    .content {
        width: 100%;
        margin-left: 0;
        padding: 20px;
    }
    .toc {
        display: none;
        width: 100%;
        position: static;
        border: none;
        padding: 20px;
        margin-top: 20px;
    }
    .toc.active {
        display: block;
    }
    .top-bar .menu-toggle {
        display: block;
    }
}
@media (max-width: 480px) {
    .content {
        padding: 16px;
    }
    .sidebar {
        padding: 16px;
    }
    .toc {
        padding: 16px;
    }
}
