/* Table of Contents - Athletic Energy Theme */

/* Hide TOC on mobile/tablet, show only on desktop */
.toc-sidebar {
    display: none;
}

@media (min-width: 1200px) {
    .toc-sidebar {
        display: block;
        position: fixed;
        top: 8rem;
        left: calc(50% + 430px);
        width: 280px;
        max-height: calc(100vh - 10rem);
        overflow-y: auto;
        z-index: 100;
    }

    /* Glassmorphic container */
    .toc-nav {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(34, 211, 238, 0.3);
        border-radius: 20px;
        padding: 1.5rem;
        backdrop-filter: blur(10px);
    }

    .toc-title {
        font-size: 0.9rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.9);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin: 0 0 0.75rem 0;
        padding-left: 0.75rem;
    }

    /* Reading Progress Bar */
    .toc-progress-container {
        position: relative;
        height: 3px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
        margin: 0 0.75rem 1rem 0.75rem;
        overflow: hidden;
    }

    .toc-progress-bar {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, #22D3EE, #06B6D4);
        border-radius: 2px;
        transition: width 0.1s ease-out;
    }

    .toc-progress-text {
        position: absolute;
        right: -3rem;
        top: -0.4rem;
        font-size: 0.75rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.6);
        min-width: 2.5rem;
        text-align: right;
    }

    .toc-list {
        list-style: none;
        margin: 0;
        padding: 0 0 0 0.75rem;
    }

    .toc-item {
        margin-bottom: 0.5rem;
    }

    /* Level 2 headings (##) - main sections */
    .toc-level-2 .toc-link {
        font-size: 0.9rem;
        font-weight: 500;
    }

    /* Level 3 headings (###) - subsections */
    .toc-level-3 .toc-link {
        font-size: 0.85rem;
        font-weight: 400;
        padding-left: 1rem;
        opacity: 0.8;
    }

    .toc-link {
        display: block;
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        padding: 0.4rem 1.75rem 0.4rem 1rem;
        border-left: 2px solid transparent;
        transition: all 0.2s ease;
        line-height: 1.4;
    }

    .toc-link:hover {
        color: #22D3EE;
        border-left-color: rgba(34, 211, 238, 0.3);
        background: rgba(34, 211, 238, 0.05);
        border-radius: 8px;
    }

    /* Active section highlighting */
    .toc-link.active {
        color: #22D3EE;
        border-left-color: #22D3EE;
        background: rgba(34, 211, 238, 0.1);
        border-radius: 8px;
    }

    /* Scrollbar styling for TOC */
    .toc-sidebar::-webkit-scrollbar {
        width: 4px;
    }

    .toc-sidebar::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 2px;
    }

    .toc-sidebar::-webkit-scrollbar-thumb {
        background: rgba(34, 211, 238, 0.3);
        border-radius: 2px;
    }

    .toc-sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(34, 211, 238, 0.5);
    }
}

/* Keep article centered, TOC positioned to the side */
@media (min-width: 1200px) {
    .article-container {
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1400px) {
    .article-container {
        max-width: 750px;
    }
}

@media (min-width: 1600px) {
    .article-container {
        max-width: 800px;
    }
}
