/* TOC Container */
.toc-container {
    display: none; /* Initially hidden */
    position: relative;
    background: #F9F9F9;
    padding: 1.75em;
    margin-bottom: 20px;
    border: 1px solid var(--primary-light);
    border-radius: 1em;
    max-height: 0; /* For slide-down effect */
    opacity: 0; /* For fade-in effect */
    overflow: hidden; /* Prevent content overflow during animation */
    transition: max-height 0.5s ease, opacity 0.5s ease; /* Smooth animation */
}

.toc-container.visible {
    display: block; /* Make the container visible */
    max-height: 100%; /* Adjust to fit content size; use a large value to allow sliding */
    opacity: 1; /* Fully visible */
}

/* TOC List */
ul.table-of-contents {
    padding-left: 0px;
    margin-left: 0px;
}

.table-of-contents li {
    margin: 0.5em 0;
}

.table-of-contents li a {
    text-decoration: none;
    color: var(--primary-dark);
    font-size: 0.95em;
}

.table-of-contents li a:hover {
    text-decoration: underline;
    color: var(--primary);
}
/* Keyframes for Ring Pulse Animation */
@keyframes subtle-ring-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.4); /* Expands outward */
        opacity: 0;
    }
}

/* TOC Trigger Button */
.toc-main-toggle {
    position: absolute;
    top: -10px;
    right: 10px;
    background-color: var(--primary);
    padding: 10px;
    border-radius: 50%;
    border: 2px solid var(--primary-dark-trans-60);
    cursor: pointer;
    z-index: 50;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px; /* Adjust for button size */
    height: 50px;
    overflow: visible; /* Ensures the animation is not clipped */
}

/* SVG Icon Inside the Button */
.toc-main-toggle .toc-icon img {
    width: 24px; /* Adjust icon size */
    height: 24px;
    display: block;
}

/* Expanding Ring Effect */
.toc-main-toggle::after {
    content: '';
    position: absolute;
    width: 100%; /* Match button size */
    height: 100%;
    border-radius: 50%; /* Circular ring */
    border: 2px solid var(--primary-dark-trans-60); /* Subtle ring color */
    animation: subtle-ring-pulse 2.5s infinite; /* Slow and subtle */
    z-index: -1; /* Ensure it appears behind the button */
    transform-origin: center;
    transform: scale(1); /* Start at button size */
    opacity: 0.6; /* Slightly visible at the start */
}

/* Floating Toggle Button in Content Area */
.toc-main-toggle i {
    margin-right: 8px; /* Space between the icon and text */
    font-size: 1.2em; /* Adjust icon size */
}


.toc-main-toggle img {
    width: 20px; /* Adjust size of the SVG icon */
    height: 20px;
    display: inline-block;
    color:#FFFFFF;
}

/* Hover Effect Overrides Pulse */
.toc-main-toggle:hover {
    animation: none; /* Stop pulsing on hover */
    background-color: var(--primary-dark);
    box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.15);
}
/* Hover Effect - Remove Animation */
.toc-main-toggle:hover::before {
    animation: none;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .toc-main-toggle {
        width: 42px;
        height: 42px;
        font-size: 1.2em;
        line-height: 42px;
    }
    .toc-main-toggle .toc-icon img {
        width: 30px; /* Adjust icon size */
        height: 30px;
        display: block;
    }
}