.toc-popup-widget-wrapper {
    display: block;
}

.toc-trigger-btn {
    position: fixed;
    bottom: 50px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    background-color: #000;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transition: transform 0.2s, background-color 0.2s;
}

.toc-trigger-btn:hover {
    transform: scale(1.05);
}

.toc-pos-left {
    left: 20px;
}

.toc-pos-right {
    right: 20px;
}

/* Modal styling */
.toc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.admin-bar .toc-modal-overlay {
    top: var(--wp-admin--admin-bar--height, 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .toc-modal-overlay {
        top: 46px;
    }
}

.toc-modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: tocModalFadeIn 0.3s ease;
}

.toc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.toc-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.toc-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.toc-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* TOC structure */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 10px;
}

.toc-item a {
    color: #333;
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s;
}

.toc-item a:hover {
    color: #1e73be;
}

/* Hierarchy depths */
.toc-depth-h2 {
    padding-left: 0;
}

.toc-depth-h3 {
    padding-left: 20px;
}

.toc-depth-h4 {
    padding-left: 40px;
}

body.toc-modal-open {
    overflow: hidden;
}

@keyframes tocModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
