/**
 * Table of Contents Styles
 * 
 * BEM-style TOC component for single post sidebar.
 */

/* ===== Table of Contents Container ===== */
.toc {
   
}

.toc__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
    padding-bottom: var(--spacing-xs);
    border-bottom: 2px solid var(--secondary-color);
}

/* ===== TOC List ===== */
.toc__list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* ===== TOC Items ===== */
.toc__item {
    margin-bottom: 0;
    border-bottom: 1px solid #e2e8f0;
}

.toc__item:last-child {
    border-bottom: none;
}

.toc__item--sub {
    margin-left: 0;
    margin-bottom: 0;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.toc__item--sub:last-child {
    border-bottom: none;
}

/* ===== TOC Links ===== */
.toc__link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.5;
    display: block;
    padding: 12px 16px;
    transition: all 0.3s ease;
    position: relative;
    border-left: 3px solid transparent;
}

.toc__item--sub .toc__link {
    padding-left: 32px;
    font-size: 0.85rem;
    color: var(--text-light);
    border-left: 3px solid #e2e8f0;
}

/* ===== TOC Hover Effects ===== */
.toc__link:hover {
    color: var(--primary-color);
    background: #f1f5f9;
    border-left-color: var(--secondary-color);
    transform: translateX(2px);
}

.toc__item .toc__link:hover {
    background: #e2e8f0;
}

.toc__item--sub .toc__link:hover {
    background: #f8fafc;
}

/* ===== Active TOC Link (Current Section) ===== */
.toc__link--active {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    border-left-color: var(--secondary-color);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toc__link--active:hover {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    transform: none;
}

/* Animated checkmark indicator for active section */
.toc__link--active::before {
    content: '✓';
    display: inline-block;
    margin-right: 8px;
    font-weight: bold;
    animation: fadeIn 0.3s ease-in;
}

/* ===== Completed TOC Links (Past Sections) ===== */
.toc__link--completed {
    background: #f0f9ff !important;
    color: var(--text-dark) !important;
    border-left-color: var(--primary-color);
    opacity: 0.8;
}

.toc__link--completed:hover {
    background: #e0f2fe !important;
    color: var(--text-dark) !important;
}

/* Checkmark indicator for completed sections */
.toc__link--completed::before {
    content: '✓';
    display: inline-block;
    margin-right: 8px;
    color: var(--primary-color);
    font-weight: bold;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}