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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.8;
    font-size: 1rem;
    color: #333;
    background-color: #f9f9f9;
}

#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 18rem;
    height: 100vh;
    background-color: #1e1e1e;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    z-index: 10;
    text-align: left;
    display: block;
}

#navbar header {
    display: block;
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
}

#navbar a {
    display: block;
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.75rem 1rem;
    margin-bottom: 0.3rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.fa-solid {
    margin-right: 8px;
}

.nav-text {
    display: inline;
}

#navbar a:hover {
    background-color: #444;
    color: #fff;
    transform: translateY(2px);
}

#main-doc {
    margin-left: 20rem;
    padding: 3vw 4vw;
    max-width: calc(100vw - 20rem);
}

.main-section {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto 8vh;
    background-color: #fff;
    padding: 2rem;
    border: 1px solid #dddddd;
    border-radius: 0.8rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-section:hover {
    transform: translateY(-3px);
    z-index: 2;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.main-section header h2 {
    font-size: 1.8rem;
    color: #222;
    margin-bottom: 1rem;
    border-bottom: 0.2rem solid #eeeeee;
    padding-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.main-section p {
    margin-bottom: 1rem;
    text-align: justify;
}

.main-section p code {
    background-color: #f4f4f4;
    padding: 0.3em 0.6em;
    border-radius: 0.4rem;
    font-family: monospace;
}

.main-section pre {
    background-color: #f4f4f4;
    padding: 1rem;
    border-radius: 0.4rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 1rem;
}

.main-section pre code {
    display: inline;
    padding: 0;
    background: none;
    font-family: monospace;
    font-size: 0.95rem;
}

ul {
    margin: 0.8rem 0 0.8rem 2rem;
    list-style-type: disc;
}

#references ul {
    padding-left: 1.5rem;
    margin-top: 1rem;
}

#references li {
    margin-bottom: 0.6rem;
}

#references li a {
    color: #1a73e8;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}

#references li a:hover,
#references li a:focus {
    color: #155ab6;
    text-decoration: underline;
    outline: none;
}

.new-tab-indicator {
    font-size: 0.8rem;
    margin-left: 0.3rem;
    color: #888;
}

#references a:hover .new-tab-indicator {
    color: #444;
}

#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: #2c2c2c;
    color: #fff;
    text-decoration: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    opacity: 0.9;
    z-index: 15;
}

#backToTop:hover {
    background-color: #333;
    opacity: 1;
    transform: translateY(-2px);
}

#backToTop:active {
    transform: scale(0.95);
    background-color: #555;
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {

    .nav-text,
    #navbar header {
        display: none;
    }

    #navbar {
        width: 6rem;
        padding: 1rem 0;
        text-align: center;
        border-radius: 0;
    }

    #navbar a {
        padding: 1rem 0;
        margin-bottom: 0.3rem;
        border-radius: 0;
    }

    #navbar a i {
        margin-right: 0;
        font-size: 1.5rem;
    }

    #main-doc {
        margin-left: 7rem;
        padding: 2rem 1rem;
        max-width: calc(100% - 7rem);
    }
}