.festival-toc-container {
    position: fixed;
    top: 210px;
    left: 20px;
    width: 250px;
    margin-left: 60px;
    max-height: 70vh;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 100;
    transition: max-height 0.5s ease-in-out, opacity 0.3s ease;
    cursor: move;
    user-select: none;
}

body.likhun-dark .festival-toc-container {
    background-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#festival-toc-container .toc-reset-position button:focus {
    outline: none !important;
    box-shadow: none !important;
}


.festival-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eaeaea;
    background-color: #f9f9f9;
    cursor: move;
}

body.likhun-dark .festival-toc-header {
    background-color: #292929;
    border-bottom: 1px solid #444;
}

.festival-toc-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

body.likhun-dark .festival-toc-title {
    color: #fff;
}

#festival-toc-toggle {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
}

.toc-icon-bar {
    display: block;
    width: 18px;
    height: 2px;
    background-color: #666;
    transition: all 0.3s ease;
    margin: 2px 0;
}

body.likhun-dark .toc-icon-bar {
    background-color: #ccc;
}

.festival-toc-container.collapsed .toc-icon-bar:first-child {
    transform: rotate(45deg) translate(3px, 3px);
}

.festival-toc-container.collapsed .toc-icon-bar:last-child {
    transform: rotate(-45deg) translate(3px, -3px);
}

.festival-toc-content {
    padding: 15px 0;
    overflow-y: auto;
    max-height: calc(70vh - 54px);
    transition: all 0.5s ease-in-out;
    opacity: 1;
}

.festival-toc-container.collapsed .festival-toc-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

#festival-toc-list {
    list-style: none;
    padding: 0 20px;
    margin: 0;
}

#festival-toc-list li {
    margin-bottom: 12px;
    line-height: 1.4;
    font-size: 14px;
}

#festival-toc-list li:last-child {
    margin-bottom: 0;
}

#festival-toc-list a {
    color: #555;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    padding: 3px 0;
    border-left: 2px solid transparent;
    padding-left: 10px;
    margin-left: -12px;
}

body.likhun-dark #festival-toc-list a {
    color: #ccc;
}

#festival-toc-list a:hover {
    color: #0af8c5;
}

#festival-toc-list a.active {
    color: #0af8c5;
    border-left: 2px solid #0af8c5;
    font-weight: 600;
}

#festival-toc-list li.active a {
    color: #0af8c5;
    border-left-color: #0af8c5;
}

.festival-toc-container.dragging {
    opacity: 0.8;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.toc-reset-position {
    background: none;
    border: none;
    color: #666;
    padding: 2px 5px;
    margin-left: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.toc-reset-position:hover {
    color: #0af8c5;
    transform: rotate(90deg);
}

body.likhun-dark .toc-reset-position {
    color: #ccc;
}

body.likhun-dark .toc-reset-position:hover {
    color: #0af8c5;
}

@media (min-width: 1600px) {
    .festival-toc-container {
        left: calc((100vw - 1400px) / 2 - 270px);
    }
}

@media (min-width: 1300px) and (max-width: 1599px) {
    .festival-toc-container {
        left: 20px;
    }
}

@media (min-width: 993px) and (max-width: 1299px) {
    .festival-toc-container {
        left: 10px;
        width: 230px;
    }
    
    .festival-toc-title {
        font-size: 15px;
    }
}

@media (max-height: 800px) {
    .festival-toc-container {
        top: 150px;
        max-height: 65vh;
    }
    
    .festival-toc-content {
        max-height: calc(65vh - 54px);
    }
}

@media (max-width: 992px) {
    .festival-toc-container {
        display: none;
    }
}