/* --- Table of Contents --- */
.toc-list-modern {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin: 2.5rem auto 2.5rem auto;
    max-width: 520px;
    width: 100%;
    padding: 0;
}

/* ==============================================
   DARK MODE STYLES FOR TABLE OF CONTENTS
   ============================================== */

/* Dark mode TOC list items */
body.dark-mode .toc-list-item {
    background: var(--card-bg, #2d2d2d) !important;
 border: 2px solid var(--border-color, #404040) !important;
    color: var(--text-color, #e0e0e0) !important;
}

body.dark-mode .toc-list-item:hover {
    background: #1e3a5f !important;
    box-shadow: 0 4px 16px rgba(0, 180, 255, 0.3) !important;
    border-color: #60a5fa !important;
}

/* Dark mode active chapter */
body.dark-mode .toc-list-item.active {
    background: var(--primary-color, #00b4ff) !important;
    color: #fff !important;
    border-color: var(--primary-color, #00b4ff) !important;
}

body.dark-mode .toc-list-item.active .toc-chapter-number {
    background: #fff !important;
    color: var(--primary-color, #00b4ff) !important;
}

/* Dark mode chapter numbers */
body.dark-mode .toc-chapter-number {
    background: #374151 !important;
    color: #60a5fa !important;
}

/* Dark mode locked chapters - IMPROVE VISIBILITY */
body.dark-mode .toc-list-item-locked {
    background: #1a1a1a !important;
    color: #6b7280 !important;
    border: 2px dashed #404040 !important;
    opacity: 0.6 !important;
}

body.dark-mode .toc-list-item-locked .toc-chapter-number {
    background: #2d2d2d !important;
    color: #4a5568 !important;
}

body.dark-mode .toc-list-item-locked .toc-lock-icon {
    color: #6b7280 !important;
}

/* ==============================================
   END DARK MODE STYLES
   ============================================== */

.toc-list-item {
    display: flex;
    align-items: center;
    background: var(--background-light);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-light);
    padding: 1.1rem 1.5rem;
    cursor: pointer;
    transition: background 0.18s, box-shadow 0.18s, transform 0.13s;
    border: 2px solid transparent;
 position: relative;
    font-size: 1.15rem;
    font-weight: 500;
}

.toc-list-item:hover {
    background: #e0f2ff;
    box-shadow: var(--box-shadow-heavy);
transform: translateY(-2px) scale(1.01);
    border-color: var(--primary-color)33;
}

.toc-list-item.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow-heavy);
}

.toc-list-item.active .toc-chapter-number {
    background: #fff;
    color: var(--primary-color);
    font-weight: 900;
}

.toc-chapter-number {
    min-width: 2.2rem;
    height: 2.2rem;
    background: #b3e6ff;
    color: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    margin-right: 1.1rem;
    transition: background 0.18s, color 0.18s;
    padding: 0;
    gap: 0;
}

.toc-chapter-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.toc-lock-icon {
    font-size: 1.1rem;
    margin-right: 0.2rem;
    vertical-align: middle;
    opacity: 0.8;
    display: flex;
    align-items: center;
}

.toc-list-item-locked {
    background: #f3f3f3 !important;
    color: #b0b0b0 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    pointer-events: none;
    border: 2px dashed var(--divider-color);
}
