/* Fixed TOC Styles */
#fixed-toc-container {
    position: fixed;
    top: 80px;
    width: 280px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-height: calc(100vh - 100px);
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
}

/* Position variants */
#fixed-toc-container.toc-position-right {
    right: 20px;
}

#fixed-toc-container.toc-position-left {
    left: 20px;
}

/* Collapsed state */
#fixed-toc-container.collapsed {
    width: 50px;
    height: 50px;
}

#fixed-toc-container.collapsed #fixed-toc-content {
    display: none;
}

#fixed-toc-container.collapsed #fixed-toc-header {
    padding: 13px;
}

#fixed-toc-container.collapsed .toc-title {
    display: none;
}

/* Header */
#fixed-toc-header {
    padding: 15px;
    font-weight: bold;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    border-radius: 8px 8px 0 0;
}

#fixed-toc-container.collapsed #fixed-toc-header {
    border-radius: 8px;
}

/* Color schemes */
.toc-color-purple #fixed-toc-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toc-color-blue #fixed-toc-header {
    background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
}

.toc-color-green #fixed-toc-header {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.toc-color-red #fixed-toc-header {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

/* Toggle button */
#fixed-toc-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

#fixed-toc-toggle:hover {
    transform: rotate(90deg);
}

/* Content area */
#fixed-toc-content {
    padding: 15px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

/* List */
#fixed-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#fixed-toc-list li {
    margin: 8px 0;
}

#fixed-toc-list a {
    color: #555;
    text-decoration: none;
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
}

#fixed-toc-list a:hover {
    background: #f0f0f0;
    color: #667eea;
    transform: translateX(5px);
}

/* Active link */
.toc-color-purple #fixed-toc-list a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
}

.toc-color-blue #fixed-toc-list a.active {
    background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    color: white;
    font-weight: bold;
}

.toc-color-green #fixed-toc-list a.active {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    font-weight: bold;
}

.toc-color-red #fixed-toc-list a.active {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
    font-weight: bold;
}

/* Hierarchical levels */
#fixed-toc-list .toc-h1 {
    padding-left: 10px;
    font-weight: bold;
}

#fixed-toc-list .toc-h2 {
    padding-left: 10px;
}

#fixed-toc-list .toc-h3 {
    padding-left: 30px;
    font-size: 13px;
}

#fixed-toc-list .toc-h4 {
    padding-left: 50px;
    font-size: 12px;
}

#fixed-toc-list .toc-h5 {
    padding-left: 70px;
    font-size: 11px;
}

#fixed-toc-list .toc-h6 {
    padding-left: 90px;
    font-size: 11px;
}

/* Scrollbar */
#fixed-toc-content::-webkit-scrollbar {
    width: 6px;
}

#fixed-toc-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#fixed-toc-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

#fixed-toc-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* Responsive - Tablet */
@media (max-width: 1200px) {
    #fixed-toc-container {
        width: 250px;
    }
    
    #fixed-toc-container.toc-position-right {
        right: 10px;
    }
    
    #fixed-toc-container.toc-position-left {
        left: 10px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    #fixed-toc-container {
        position: fixed;
        bottom: 20px;
        top: auto;
        right: 20px;
        left: auto;
        width: 60px;
        height: 60px;
        border-radius: 50%;
    }
    
    #fixed-toc-container.collapsed {
        width: 60px;
        height: 60px;
    }
    
    #fixed-toc-container:not(.collapsed) {
        width: 90%;
        max-width: 350px;
        height: auto;
        max-height: 70vh;
        border-radius: 8px;
        right: 5%;
        left: 5%;
    }
    
    #fixed-toc-header {
        border-radius: 50%;
        padding: 18px;
        justify-content: center;
    }
    
    #fixed-toc-container:not(.collapsed) #fixed-toc-header {
        border-radius: 8px 8px 0 0;
        padding: 15px;
        justify-content: space-between;
    }
    
    .toc-title {
        display: none;
    }
    
    #fixed-toc-container:not(.collapsed) .toc-title {
        display: inline;
    }
    
    #fixed-toc-content {
        max-height: calc(70vh - 60px);
    }
}

/* Print styles */
@media print {
    #fixed-toc-container {
        display: none;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#fixed-toc-container {
    animation: slideIn 0.3s ease-out;
}

/* Accessibility */
#fixed-toc-toggle:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

#fixed-toc-list a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #fixed-toc-container {
        background: #2d3748;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
    
    #fixed-toc-list a {
        color: #e2e8f0;
    }
    
    #fixed-toc-list a:hover {
        background: #4a5568;
        color: #667eea;
    }
    
    #fixed-toc-content::-webkit-scrollbar-track {
        background: #1a202c;
    }
}

#fixed-toc-container {
    animation: slideIn 0.3s ease-out;
}

/* Accessibility */
#fixed-toc-toggle:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

#fixed-toc-list a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
#fixed-toc-container {
    animation: slideIn 0.3s ease-out;
}

/* Accessibility */
#fixed-toc-toggle:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

#fixed-toc-list a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
.fixed-toc-shortcode.toc-position-inline {
    border: 1px solid #CCB271;
    border-radius: 4px;
    background: #fff;
    padding: 12px;
    position: sticky;
    top: 115px;
}

.toc-shortcode-list li {
    list-style: none;
    margin-bottom: 8px;
}

.toc-shortcode-list li a {
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px;
}

h3.toc-shortcode-title {
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 24px; /* 150% */
    font-family: "Open Sans";
    color: #CCB271;
    text-transform: uppercase;
}

.toc-shortcode-header {
    display: flex;
    justify-content: center;
    align-items: center;
    align-content: center;
}

.toc-shortcode-header h3.toc-shortcode-title svg {position: absolute;top: 14px;left: 12px;}

.toc-shortcode-header h3.toc-shortcode-title {
    padding-left: 30px;
}