header nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

header .logo a {
    color: #a78bfa;
    text-decoration: none;
    font-size: 1.8em;
    font-weight: bold;
    z-index: 10;
}

header nav ul.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    gap: 20px;
}

header nav ul.nav-links li a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #f0f0f0;
    text-decoration: none;
    font-weight: 500;
    font-size: 1em;
    padding: 8px 10px;
    border-radius: 4px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Style for the active navigation link */
header nav ul.nav-links li a.active {
    color: #a78bfa;
    font-weight: 700;
    cursor: default;
}


.nav-icon {
    width: 1.3em;
    height: 1.3em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

.special-icon {
    width: 1.3em;
    height: 1.3em;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: middle;
}

header nav ul.nav-links li a:not(.active):hover {
    color: #a78bfa;
}


.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #f0f0f0;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    line-height: 0;
}

.mobile-nav-toggle .hamburger-svg-icon {
    width: 28px;
    height: 28px;

}

.mobile-nav-toggle .hamburger-svg-icon path {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform-origin: center center;
}

.mobile-nav-toggle.active .hamburger-svg-icon .line-top {

    transform: translateY(5.8px) rotate(45deg);
}
.mobile-nav-toggle.active .hamburger-svg-icon .line-middle {
    opacity: 0;
    transform: scaleX(0);
}
.mobile-nav-toggle.active .hamburger-svg-icon .line-bottom {

    transform: translateY(-4.2px) rotate(-45deg);
}

.toc-container {
    background-color: #262638;
    border: 1px solid #3a3a4f;
    border-radius: 8px;
    padding: 20px 25px;
    margin-bottom: 35px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.toc-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    color: #e8e8e8;
    border-bottom: 1px solid #4a4a60;
    padding-bottom: 12px;
}

nav.toc ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

nav.toc ul li {
    margin-bottom: 0;
    position: relative;
}

nav.toc ul li a {
    display: block;
    text-decoration: none;
    color: #c0c0d0;
    padding: 8px 10px;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s ease;
    font-weight: 500;
    text-align: left;
}

nav.toc ul li a:hover {
    color: #a78bfa;
    background-color: rgba(167, 139, 250, 0.1);
}

nav.toc > ul > li > a {
    font-weight: 600;
    color: #d8d8e0;
}
nav.toc > ul > li > a:hover {
    color: #a78bfa;
}

nav.toc ul ul {
    list-style: none;
    padding-left: 20px;
    margin-top: 5px;
    margin-bottom: 10px;
    border-left: 2px solid #4a4a60;
}

nav.toc ul ul li a {
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 0.9em;
    font-weight: 400;
    color: #b0b0c0;
    text-align: left;
}

nav.toc ul ul li a:hover {
    color: #a78bfa;
    background-color: rgba(167, 139, 250, 0.08);
}

.heading-anchor-link {
    color: #a78bfa;
    text-decoration: none;
    margin-left: 0.5em;
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.2s ease;
}

h2:hover .heading-anchor-link,
h3:hover .heading-anchor-link,
h4:hover .heading-anchor-link {
    opacity: 0.7;
}

.heading-anchor-link:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    header nav {
        padding: 0 15px;
    }

    header nav ul.nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(20, 20, 40, 0.98);
        backdrop-filter: blur(5px);
        padding: 15px 0;
        gap: 0;
        border-top: 1px solid #333;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    header nav ul.nav-links.mobile-nav-active {
        display: flex;
    }

    header nav ul.nav-links li {
        width: 100%;
        text-align: center;
    }

    header nav ul.nav-links li a {
        font-size: 1.1em;
        padding: 15px 20px;
        width: 100%;
        justify-content: center;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    header nav ul.nav-links li:last-child a {
        border-bottom: none;
    }

    .mobile-nav-toggle {
        display: block;
    }
}
