/* Sidebar styles */
.sidebar {
    position: fixed;
    top: 60px; /* Below the header */
    left: -200px; /* Start hidden off-screen */
    width: 200px;
    height: calc(100vh - 60px); /* Adjust for header height */
    background: #222;
    color: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 800; /* Increased to ensure sidebar is above all content */
    overflow-y: auto;
    transition: left 0.3s ease; /* Smooth transition */
}

.sidebar.open {
    left: 0; /* Show sidebar when open class is applied */
}

/* Main content transition for when sidebar opens/closes */
body {
    /* No layout shift when sidebar opens */
}

/* Optional backdrop to dim content and capture clicks to close sidebar */
.sidebar-backdrop {
    position: fixed;
    top: 60px; /* match header */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 750; /* below sidebar (800) */
    display: none;
    transition: opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.sidebar-backdrop.visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    body.sidebar-open {
        padding-left: 0; /* No padding on mobile, since sidebar overlays content */
    }
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar nav ul li {
    margin: 0;
}
.sidebar nav ul li a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 15px 20px;
    transition: background 0.2s;
}
.sidebar nav ul li a:hover, .sidebar nav ul li a.active {
    background: #444;
}

/* Mobile Menu Button */
.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    padding: 0 15px;
    height: 60px; /* Match header height */
    color: var(--text-primary);
    transition: color 0.2s;
    background: none;
    border: none;
    outline: none;
}

.menu-toggle:hover {
    color: var(--accent-color);
}

/* Move the open-nav-btn to be absolutely positioned */
.open-nav-btn {
    display: none; /* Hide the old button */
}

@media (max-width: 768px) {
    .sidebar {
        display: none; /* Hide desktop sidebar on mobile */
    }
}
