/* Table of Contents Sidebar Styles */
.toc-overlay {
    display: none; /* Ẩn overlay */
}

.table-of-contents-sidebar {
    position: fixed;
    top: 120px; /* Sẽ được tính toán động bằng JavaScript */
    right: -100%;
    width: 100%; /* Chiếm hết chiều rộng màn hình */
    height: calc(100vh - var(--header-height, 120px)); /* Chiều cao trừ đi chiều cao header */
    z-index: 9999;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.table-of-contents-sidebar.active {
    right: 0;
}

.toc-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    justify-content: flex-end; /* Đẩy container sang bên phải */
}

.toc-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.toc-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.toc-container {
    position: relative;
    z-index: 2;
    width: 100%; /* Chiếm 40% chiều rộng của sidebar */
    max-width: 900px; /* Giới hạn chiều rộng tối đa */
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 40px 0px;
    margin-left: auto; /* Đẩy sang bên phải */
}

.toc-header {
    position: relative;
    margin-bottom: 40px;
}

.toc-close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #003366;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toc-close-btn:hover {
    background: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toc-title-banner {
    background: linear-gradient(135deg, #d4af37 0%, #e6c759 50%, #d4af37 100%);
    padding: 15px 30px;
    display: inline-block;
    position: relative;
    clip-path: polygon(0% 0%, calc(100% - 20px) 0%, 100% 50%, calc(100% - 20px) 100%, 0% 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toc-title-banner span {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Arial', sans-serif;
    letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.toc-body {
    flex: 1;
    overflow-y: auto;
    /* padding-right: 10px; */
}

.toc-body::-webkit-scrollbar {
    width: 6px;
}

.toc-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.toc-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.toc-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 12px;
}

.toc-item a {
    color: #fff;
    text-decoration: none;
    display: block;
    padding: 8px 0;
    transition: all 0.3s ease;
    font-family: 'Arial', sans-serif;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.toc-item a:hover {
    color: #FFF696;
    padding-left: 10px;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.toc-main a {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.toc-part a {
    font-size: 15px;
    font-weight: 700;
    margin-top: 25px;
    margin-bottom: 15px;
}

.toc-sub {
    margin-left: 20px;
}

.toc-sub a {
    font-size: 15px;
    font-weight: 600;
}

.toc-subsub {
    margin-left: 40px;
}

.toc-subsub a {
    font-size: 15px;
    font-weight: 600;
}

.toc-section {
    margin-bottom: 20px;
    position: relative;
}

/* Ẩn mục lục con mặc định */
.toc-subsection {
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

/* Hiển thị mục lục con khi hover vào mục lục cha (sibling selector) */
.toc-part:hover ~ .toc-subsection {
    max-height: 1000px; /* Giá trị đủ lớn để chứa nội dung */
    opacity: 1;
    margin-top: 10px;
}

/* Đảm bảo mục lục con vẫn hiển thị khi hover vào chính nó */
.toc-subsection:hover {
    max-height: 1000px;
    opacity: 1;
    margin-top: 10px;
}

/* Ẩn mục lục con cấp 2 mặc định */
.toc-subsection.toc-subsub {
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

/* Hiển thị mục lục con cấp 2 khi hover vào mục lục con cấp 1 chứa nó */
.toc-subsection:hover .toc-subsub {
    max-height: 1000px;
    opacity: 1;
    margin-top: 10px;
}

/* Toggle button icon styles */
#toggleTableOfContents .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

#toggleTableOfContents.active .toggle-icon {
    transform: rotate(180deg);
}

#toggleTableOfContents .icon-sort {
    display: inline-block;
}

#toggleTableOfContents .icon-close {
    display: none;
}

#toggleTableOfContents.active .icon-sort {
    display: none;
}

#toggleTableOfContents.active .icon-close {
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .toc-container {
        width: 50%; /* Rộng hơn trên màn hình nhỏ */
        padding: 30px 20px;
    }
    
    .toc-title-banner span {
        font-size: 20px;
    }
    
    .toc-main a {
        font-size: 15px;
    }
    
    .toc-part a {
        font-size: 14px;
    }
    
    .toc-sub a {
        font-size: 13px;
    }
    
    .toc-subsub a {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .toc-container {
        width: 70%; /* Rộng hơn trên màn hình rất nhỏ */
        padding: 25px 15px;
    }
    
    .toc-title-banner {
        padding: 12px 25px;
    }
    
    .toc-title-banner span {
        font-size: 18px;
    }
}
/* .tocheader123{
    background-image: url('../images/svg/Layer1111.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right;
    text-align: end ;
} */
.txtMucLuc{
    font-weight: 700;
    font-size: 32px;
    text-transform: uppercase;
    color: #00528A;
    margin-right: 10px;
}
