/* Basic Layout */
body {
    font-family: sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#sidebar {
    width: 250px;
    padding: 1rem;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    background-color: #f8f9fa;
}

#content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

/* Header Elements */
.selectors select {
    margin-right: 1rem;
}

#sidebar-toggle {
    display: none; /* Hidden on desktop */
}

/* Search and TOC */
.search-container {
    margin-bottom: 1rem;
}

#search-box {
    width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
}

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

#toc a {
    text-decoration: none;
    color: #007bff;
    display: block;
    padding: 0.25rem 0;
}

#toc a:hover {
    text-decoration: underline;
}

/* Scroll to top button */
#scrollToTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #555;
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 10px;
    font-size: 18px;
}

#scrollToTopBtn:hover {
    background-color: #777;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}

.dropdown-menu a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-menu a:hover {
    background-color: #f1f1f1;
}

.dropdown.show .dropdown-menu {
    display: block;
}

/* Theme Styles */
body.light-theme {
    background-color: #fff;
    color: #212529;
}

body.dark-theme {
    background-color: #212529;
    color: #f8f9fa;
}

body.dark-theme header,
body.dark-theme #sidebar {
    background-color: #343a40;
    border-color: #495057;
}

body.dark-theme #content {
    background-color: #212529;
}

body.dark-theme .dropdown-menu {
    background-color: #343a40;
}

body.dark-theme .dropdown-menu a {
    color: #f8f9fa;
}

body.dark-theme .dropdown-menu a:hover {
    background-color: #495057;
}

body.dark-theme #toc a {
    color: #8ab4f8;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        bottom: 0;
        height: 100%;
        transition: left 0.3s ease;
        z-index: 100;
        background-color: #f8f9fa;
    }

    #sidebar.open {
        left: 0;
    }

    #sidebar-toggle {
        display: block;
    }
}
