/*--------------------------------------------------------------
## Utility Classes (from user request)
--------------------------------------------------------------*/
.qstoc-d-flex {
    display: flex !important;
}

.qstoc-align-items-center {
    align-items: center !important;
}

.qstoc-justify-content-between {
    justify-content: space-between !important;
}

.quicksite-toc-content-area {
    display: contents !important;
}

/*--------------------------------------------------------------
## Toc Container
--------------------------------------------------------------*/
.toc-content {
    overflow-y: auto;
}

.toc-content>.toc-list {
    overflow: hidden;
    position: relative;
}

/* Base Reset: Hide bullets by default for standard lists, overridden below */
.toc-content>.toc-list li {
    list-style: none;
}

.js-toc {
    overflow-y: hidden;
}

.toc-list {
    margin: 0 !important;
    padding-left: 18px;
}

a.toc-link {
    color: currentColor;
    height: 100%;
    text-decoration: none;
}

.is-collapsible {
    max-height: 1000px;
    overflow: hidden;
    transition: all 300ms ease-in-out;
}

.is-collapsed {
    max-height: 0;
}

.is-position-fixed {
    position: fixed !important;
    top: 0;
}

.is-active-link {
    font-weight: 700;
}

/*--------------------------------------------------------------
## Popup & Layout
--------------------------------------------------------------*/
body {
    --toc-shadow: #81d742;
    --toc-header-bg: #ffffff;
    --toc-header-color: #fff;
    --toc-side-btn-bg: #fff;
    --toc-side-btn-color: #222;
}

.toc-content-side {
    margin-bottom: 30px;
    border-radius: var(--toc-border-radius, 12px);
    border: var(--toc-border-width, 1px) var(--toc-border-style, solid) var(--toc-border-color, #eee);
    box-shadow: var(--toc-box-shadow, 0 4px 15px rgba(0, 0, 0, 0.05));
    background: #fff;
    will-change: height;
    overflow: hidden;
    /* Fix clipping issues for rounded corners */
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.toc-content-side:not(.toc-hidden):hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: #e0e0e0;
}

#toc-side-btn {
    position: fixed;
    top: 50%;
    border: none;
    outline: none;
    cursor: pointer;
    display: none;
    padding: 10px;
    border-radius: 10px;
    transition: left 0.3s linear, right 0.3s linear;
    color: var(--toc-side-btn-color);
    background-color: var(--toc-side-btn-bg);
    box-shadow: var(--toc-floating-box-shadow, 0 0 10px rgba(0, 0, 0, 0.1));
    z-index: 9999;
}

.btn-right #toc-side-btn {
    right: 10px;
    left: auto;
}

.btn-left #toc-side-btn {
    left: 10px;
    right: auto;
}

.toc-hidden .toc-body.visible #toc-side-btn {
    position: unset;
    border: none;
    box-shadow: none;
    color: var(--toc-header-color);
    background-color: var(--toc-header-bg);
}

.admin-bar .toc-hidden .toc-body {
    top: 35px;
}

@media screen and (max-width: 782.9px) {
    .admin-bar .toc-hidden .toc-body {
        top: 49px;
    }
}

.toc-body {
    padding: 0;
    position: relative;
    background: #fff;
    border-radius: inherit;
    /* Follow parent radius if applicable */
}

.toc-hidden .toc-body {
    position: fixed;
    z-index: 10002;
    top: 20px;
    bottom: 20px;
    width: var(--toc-width, 300px);
    height: auto;
    max-height: calc(100% - 40px);
    overflow-y: auto;
    transition: right 0.3s linear, left 0.3s linear;
    border: var(--toc-floating-border-width, 1px) var(--toc-floating-border-style, solid) var(--toc-floating-border-color, #eee);
    border-radius: var(--toc-floating-border-radius, 10px);
    box-shadow: var(--toc-floating-box-shadow, 0 0 10px rgba(0, 0, 0, 0.1));
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
    /* Firefox */
}

/* Custom Webkit Scrollbar for elegant look */
.toc-hidden .toc-body::-webkit-scrollbar {
    width: 5px;
}

.toc-hidden .toc-body::-webkit-scrollbar-track {
    background: transparent;
    margin: 10px 0;
    /* Vertical breathing room */
}

.toc-hidden .toc-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.toc-hidden .toc-body:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
}

.panel-right.toc-hidden .toc-body {
    right: var(--toc-width-neg, -303px);
    left: auto;
}

.panel-left.toc-hidden .toc-body {
    left: var(--toc-width-neg, -303px);
    right: auto;
}

.toc-hidden .toc-body.visible {
    transition: right 0.3s linear, left 0.3s linear;
}

.panel-right.toc-hidden .toc-body.visible {
    right: 5px;
    left: auto;
}

.panel-left.toc-hidden .toc-body.visible {
    left: 5px;
    right: auto;
}

.toc-body.visible .toc-header {
    position: sticky;
    top: 0;
    z-index: 2;
    color: var(--toc-header-color);
    background-color: var(--toc-header-bg);
}

.toc-hidden .toc-body .toc-header {
    border-radius: 0;
}

.toc-header {
    padding: 15px 25px;
    font-size: 20px;
    font-weight: 700;
    color: var(--toc-header-color);
    border-bottom: 1px solid #f1f1f1;
    background-color: var(--toc-header-bg);
}

.hidden-content:not(.visible) .toc-header {
    border-color: transparent;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

button.toc-toggle {
    color: currentColor;
    padding: 5px 10px;
    line-height: 1.5;
    background: transparent;
    border: 1px solid transparent;
}

.hidden-content .toc-toggle {
    -webkit-transform: rotate(-180deg);
    -ms-transform: rotate(-180deg);
    transform: rotate(-180deg);
}

.toc-body .icon-close,
.hidden-content .toc-content,
.toc-hidden .toc-body.visible .icon-list,
.toc-hidden .toc-body.visible .toc-toggle {
    display: none;
}

.toc-hidden #toc-side-btn,
.toc-hidden .toc-body.visible .icon-close {
    display: inline-flex;
}

.toc-content,
.toc-hidden .toc-body .toc-content {
    padding: 25px 35px;
    display: block;
}

.toc-hidden .toc-body .toc-content {
    padding: 20px 25px 20px 20px;
    /* More padding on the right for scrollbar */
}

/*--------------------------------------------------------------
## See More & Height Limit
--------------------------------------------------------------*/
.toc-content-container {
    position: relative;
    overflow: hidden;
}

.toc-content-container.has-see-more {
    max-height: var(--toc-max-height, 300px);
    transition: max-height 0.4s ease;
}

.toc-content-container.is-expanded {
    max-height: none !important;
}

.toc-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
    pointer-events: none;
    z-index: 10;
    display: none;
}

.has-see-more:not(.is-expanded) .toc-fade {
    display: block;
}

.toc-see-more-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0 30px;
    position: relative;
    z-index: 11;
}

.toc-see-more-btn {
    position: relative;
    background: var(--toc-see-more-bg, #f5f5f5);
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 8px 25px;
    font-size: 14px;
    font-weight: bold;
    color: var(--toc-see-more-color, #444);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.toc-see-more-btn::before,
.toc-see-more-btn::after {
    content: "";
    display: block;
    height: 1px;
    position: absolute;
    top: calc(50% - 1.5px);
    width: 30px;
    border-top: 3px dotted #ccc;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.toc-see-more-btn::before {
    right: calc(100% + 15px);
}

.toc-see-more-btn::after {
    left: calc(100% + 15px);
}

.toc-see-more-btn:hover {
    background: var(--toc-see-more-hover-bg, #eee);
    border-color: #ccc;
    color: var(--toc-see-more-hover-color, #444);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.toc-see-more-btn:hover::before,
.toc-see-more-btn:hover::after {
    opacity: 0;
    transform: scaleX(0.5);
}

.is-expanded+.toc-see-more-wrapper {
    padding-top: 5px;
}

/* Hide see more on floating sidebar */
.toc-hidden .has-see-more {
    max-height: none !important;
}

.toc-hidden .toc-fade,
.toc-hidden .toc-see-more-wrapper {
    display: none !important;
}

/*--------------------------------------------------------------
## List Styles
--------------------------------------------------------------*/

/* None Lists */
.none-lists .toc-list {
    padding-left: 0;
    list-style-type: none;
}

/* Decimal Lists - Explicitly enable decimals */
.decimal-lists .toc-list {
    list-style-type: decimal;
}

.decimal-lists .toc-list li {
    list-style: decimal;
}

/* Circle Lists */
.circle-lists .toc-list {
    list-style-type: circle;
}

.circle-lists .toc-list li {
    list-style: circle;
}

/* Nested Lists (Counters) */
.nested-lists .toc-list {
    counter-reset: item;
    list-style-type: none;
    position: relative;
    z-index: 1;
}

.nested-lists .toc-list>.toc-list-item {
    display: list-item;
    counter-increment: item;
}

.nested-lists .toc-list>.toc-list-item::before {
    content: counters(item, ".") ".";
    margin-right: 5px;
    position: absolute;
    left: 0;
}

.nested-lists .toc-list .toc-list {
    counter-reset: subitem;
    list-style-type: none;
    padding-left: 30px;
}

.nested-lists .toc-list .toc-list .toc-list {
    padding-left: 42px;
}

.nested-lists .toc-list .toc-list .toc-list .toc-list {
    padding-left: 54px;
}

.nested-lists .toc-list .toc-list-item .toc-list-item {
    display: list-item;
    counter-increment: subitem;
}

.nested-lists .toc-list .toc-list-item .toc-list-item::before {
    content: counters(item, ".") "." counters(subitem, ".") ".";
    margin-right: 5px;
}