/* Sidebar General Styling */
.mehrulms-sidebar {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    background-color: #fcfcfc;
    overflow-y: auto;
    overflow-x: hidden;
    transition: 0.4s;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    padding-top: 60px;
    border-right: 1px solid #e0e0e0;
}

.mehrulms-sidebar.open {
    width: 320px;
}

.mehrulms-sidebar-content {
    padding: 20px;
}

/* --- HIERARCHY STYLING FOR ALL LISTS --- */

/* General list styling */
.mehrulms-sidebar ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.mehrulms-sidebar li a {
    display: block;
    padding: 8px 15px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 4px;
    margin: 2px 0;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.mehrulms-sidebar li a:hover {
    background-color: #f0f0f0;
}

/* General "Current Item" highlighting - This overrides all other colors */
.mehrulms-sidebar li.current-item > a {
    background-color: #e1f0fa;
    color: #005a87 !important; /* Use !important to ensure override */
    font-weight: 700;
    border-left-color: #0073aa;
}

/* --- SPECIFIC HIERARCHY STYLES WITH COLOR --- */

/* 1. Current Lesson Outline (Nested Tree) */
.mehrulms-lesson-tree {
    padding-left: 5px;
}
.mehrulms-lesson > a {
    font-size: 1.05em;
    font-weight: 600;
    color: #1D2327; /* Darkest (almost black) for top level */
}
.mehrulms-sublesson {
    padding-left: 15px;
}
.mehrulms-sublesson > a {
    font-size: 1em;
    color: #2271b1; /* WordPress Blue */
}
.mehrulms-microlesson {
    padding-left: 30px;
}
.mehrulms-microlesson > a {
    font-size: 0.95em;
    color: #993366; /* Purple */
}
.mehrulms-nanolesson {
    padding-left: 45px;
}
.mehrulms-nanolesson > a {
    font-size: 0.9em;
    color: #787c82; /* Gray */
}


/* 2. Flat lists (All Lessons, All Subjects) */
.mehrulms-context-block {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.mehrulms-context-block .section-title {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #1d2327;
}

/* 3. Available Courses Section */
.mehrulms-available-courses {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e02020;
}
.mehrulms-available-courses .section-title {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #1d2327;
}

/* --- HEADER AND CONTROLS --- */

/* Current Course Header */
.mehrulms-current-course {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}
.mehrulms-current-course h4 {
    margin: 0;
    font-size: 1.2em;
}
.mehrulms-current-course h4 a {
    text-decoration: none;
    color: #1d2327;
    font-weight: 700;
}

/* Menu Toggle and Close Buttons */
.mehrulms-menu-toggle {
    font-size: 24px;
    cursor: pointer;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 10000;
    background: #fff;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border: 1px solid #eee;
}

.mehrulms-close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 36px;
    cursor: pointer;
    color: #777;
    text-decoration: none;
    line-height: 1;
}
.mehrulms-close-btn:hover {
    color: #1d2327;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .mehrulms-sidebar.open {
        width: 90%;
        max-width: 340px;
    }
}