/* Logo container in the sidebar */
.logo-container {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 10px;
}

.sidebar-logo {
    max-width: 40%;
    height: auto;
}

/* Sidebar layout fixes */
.sidebar {
    padding-top: 50px; /* Space for menu bar */
    z-index: 1;
    width: 300px;
    position: fixed;
    left: 0;
    height: 100%;
    overflow-y: auto;
    border-right: 1px solid var(--sidebar-bg);
    background: linear-gradient(to bottom, #FF9500, #e07f00); /* Lucia Protocol orange gradient */
    color: #ffffff; /* White text for better contrast */
}

.sidebar-visible .sidebar {
    display: block;
}

.sidebar-hidden .sidebar {
    display: none;
}

/* Fix for sidebar toggle button */
#sidebar-toggle {
    cursor: pointer;
}

/* Fix for theme popup */
.theme-popup {
    display: none;
    position: absolute;
    left: 10px;
    top: 50px;
    z-index: 1000;
    border-radius: 4px;
    font-size: 0.7em;
    color: var(--fg);
    background: var(--theme-popup-bg);
    border: 1px solid var(--theme-popup-border);
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-y: auto;
    max-height: 300px;
}

/* Content adjustments */
.page {
    outline: 0;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Page wrapper layout fixes */
.page-wrapper {
    position: relative;
    box-sizing: border-box;
    transition: margin-left 0.3s;
}

.sidebar-visible .page-wrapper {
    margin-left: 300px; /* Match the sidebar width */
}

.sidebar-hidden .page-wrapper {
    margin-left: 0;
}

/* Menu bar adjustments */
.menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2; /* Above the sidebar */
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg);
    border-bottom: 1px solid var(--bg);
}

/* Content padding */
.content {
    padding-top: 50px; /* Space for menu bar */
    box-sizing: border-box;
}

/* Responsive adjustments for mobile */
@media only screen and (max-width: 1080px) {
    .sidebar-visible .page-wrapper {
        margin-left: 0;
    }

    .sidebar {
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        z-index: 10;
    }

    .sidebar-visible .sidebar {
        transform: translateX(0);
    }

    .sidebar-hidden .sidebar {
        transform: translateX(-100%);
    }
}

/* Links in sidebar */
.sidebar a {
    display: inline-block;
    text-decoration: none;
    color: #ffffff; /* White text for better contrast */
}

.sidebar a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Don't modify the basic list styling */
.sidebar ul {
    margin: 0;
    padding: 0 0 0 20px;
}

/* Restore default MDBook sidebar styling without collapse functionality */
.sidebar .chapter {
    margin-top: 0;
    margin-bottom: 0;
    list-style: none;
    padding-left: 0;
    line-height: 2.2em;
}

.sidebar .chapter li {
    list-style: none;
}

.sidebar .chapter li.chapter-item {
    list-style: none;
    /* margin-top: 0; */
    /* margin-bottom: 0; */
}

/* Remove all collapse functionality */
.sidebar .chapter li > a {
    display: block;
    align-items: center;
}

.sidebar .chapter li.chapter-item > a {
    color: #ffffff; /* White text for better contrast */
    text-decoration: none;
    font-size: 1em;
}

/* Remove all dropdown arrows */
.sidebar .chapter li.has-sub > a:after {
    content: none;
}

/* Always display all sublists */
.sidebar .chapter li > ul {
    display: block !important;
}

/* Proper spacing for items and section headers */
.sidebar .chapter .section {
    padding-left: 20px;
}

/* Spacing between navbar items */
/* .sidebar .chapter li {
    margin: 2px 0;
} */

/* Sidebar scrollbox styling */
.sidebar-scrollbox {
    background: transparent; /* Make it transparent to show the gradient */
    padding: 10px;
}

/* Show the first element in the SUMMARY.md specifically (the logo) */
.sidebar-scrollbox > ul:first-child::before {
    content: "";
    display: block;
    background-image: url('../images/logo.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 100%;
    height: 60px;
    margin-bottom: 20px;
}

.chapter li > a.toggle {
    display: none;
    cursor: default;
}
