/* TOC Container */
.toc-container {
    background: linear-gradient(180deg, #e7f0fd 0, rgba(231, 240, 253, 0) 100%);
    padding: 25px;
    border: 1px solid #fff;
    margin-bottom: 20px;
    border-radius: 4px;
}

/* TOC Title */
.toc-title {
    font-size: 1.25rem;
    color: #042c8a;
    text-transform: uppercase;
    margin-bottom: 18px;
    display: flex;
    position: relative;
    align-items: center;
    font-weight: 500;
    font-family: Inter, sans-serif;
}

.toc-title i {
    font-size: 1.1rem;
    color: #042c8a;
}

.toc-title:after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.toc-title::before {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 50px;
    height: 3px;
    background: #2affe8;
}

/* TOC List */
.toc-list {
    list-style: none;
    counter-reset: toc-counter;
    padding-left: 0;
    margin: 0;
}

.toc-list > li {
    counter-increment: toc-counter; 
    margin: 4px 0;
    position: relative;
}

/* Chỉ đánh số cho cấp 1 */
.toc-list > li::before {
    content: counter(toc-counter) ". "; 
    font-weight: bold;
    color: #042c8a;
    margin-right: 4px;
}

/* Cấp con (không đánh số, không dấu) */
.toc-list ul {
    list-style: none;
    padding-left: 16px; 
    border-left: 1px dashed rgba(0,0,0,0.1);
    margin: 4px 0;
}

.toc-list ul > li {
    margin: 3px 0;
    position: relative;
    padding-left: 4px;  /* chỉ thụt lề */
}

/* Loại bỏ số ở mục con */
.toc-list ul > li::before {
    content: ""; 
}

/* TOC Link */
.toc-list a {
    font-size: 0.95rem;
    color: #444;
    text-decoration: none;
    padding: 2px 0;
    display: inline-block;
    transition: color 0.2s ease;
    position: relative;
}

.toc-list a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 1px;
    width: 0;
    background-color: #2684ef;
    transition: width 0.3s ease;
}

.toc-list a:hover {
    color: #2684ef;
}

.toc-list a:hover::after {
    width: 100%;
}

/* TOC Content (Collapsible Animation) */
.toc-content {
    display: grid;
    grid-template-rows: 1fr; 
    transition: grid-template-rows 0.9s ease-in-out, opacity 0.6s ease-in-out;
    opacity: 1;
}

.toc-content > * {
    overflow: hidden;
}

.toc-content.collapsed {
    grid-template-rows: 0fr; 
    opacity: 0; 
}

@media (prefers-reduced-motion: reduce) {
    .toc-content {
        transition: none;
    }
}
