/* ===== Floating TOC Button ===== */

#toc-float-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary-color, #025B97);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: background-color 0.2s, transform 0.2s;
    margin: 0;
}

#toc-float-btn:hover {
    background-color: var(--secondary-color, #FF8C42);
    transform: scale(1.08);
}

#toc-float-btn.is-open {
    background-color: var(--secondary-color, #FF8C42);
}

/* ===== Floating TOC Panel ===== */

#toc-float-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9998;
    width: 280px;
    max-height: 60vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 14px 16px;
    display: none;
    animation: toc-panel-in 0.2s ease;
}

#toc-float-panel.is-visible {
    display: block;
}

@keyframes toc-panel-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#toc-float-panel .toc-float-title {
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    color: var(--primary-color, #025B97);
}

#toc-float-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#toc-float-panel ul ul {
    margin-left: 14px;
}

#toc-float-panel li {
    margin: 0;
    padding: 2px 0;
    line-height: 1.5;
}

#toc-float-panel a {
    font-size: 13px;
    color: #333;
    text-decoration: none;
    display: block;
    padding: 2px 0;
    transition: color 0.15s;
}

#toc-float-panel a:hover {
    color: var(--primary-color, #025B97);
    text-decoration: underline;
}

/* Ẩn trên màn hình nhỏ nếu không cần */
@media (max-width: 480px) {
    #toc-float-panel {
        width: calc(100vw - 40px);
        right: 20px;
    }
}