/* Ultimate Dice Roll Toolkit Documentation Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

/* Header Styles with Cover Image */
.header {
    background: #000;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

.header-cover-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Navigation Styles */
.nav {
    background-color: #413768;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
}

.nav a {
    color: #ecf0f1;
    text-decoration: none;
    padding: 1rem 1.5rem;
    display: block;
    transition: background-color 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav a:hover,
.nav a.active {
    background-color: #5a4a74;
    border-bottom-color: #8e44ad;
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 { font-size: 2.5rem; border-bottom: 3px solid #8e44ad; padding-bottom: 0.5rem; }
h2 { font-size: 2rem; border-bottom: 2px solid #95a5a6; padding-bottom: 0.3rem; }
h3 { font-size: 1.5rem; color: #34495e; }
h4 { font-size: 1.25rem; color: #34495e; }
h5 { font-size: 1.1rem; color: #7f8c8d; }
h6 { font-size: 1rem; color: #7f8c8d; text-transform: uppercase; letter-spacing: 0.5px; }

p {
    margin-bottom: 1rem;
    color: #555;
}

/* Code Styles */
/* Base code font styling - no background for block contexts */
code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #e74c3c;
}

/* Inline code styling - scoped to text containers only */
p code,
li code,
td code,
th code,
span code,
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    border: 1px solid #e1e8ed;
}

pre {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
    border-left: 4px solid #8e44ad;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
}

/* Syntax Highlighting */
.keyword { color: #6c3483; font-weight: bold; }
.string { color: #2ecc71; }
.comment { color: #95a5a6; font-style: italic; }
.number { color: #f39c12; }
.type { color: #9b59b6; font-weight: bold; }
.method { color: #00d4ff; font-weight: bold; }
.property { color: #16a085; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

th {
    background-color: #34495e;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: #f8f9fa;
}

/* Lists */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.5rem;
    color: #555;
}

/* Alert Boxes */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    border-left: 4px solid;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Method Documentation */
.method-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.method-signature {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.method-title {
    color: #2c3e50;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.method-description {
    color: #555;
    margin-bottom: 1rem;
}

.parameters, .returns, .example {
    margin-top: 1rem;
}

.parameters h4, .returns h4, .example h4 {
    color: #34495e;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-list {
    background: white;
    border-radius: 4px;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

.param-item {
    display: flex;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.param-item:last-child {
    margin-bottom: 0;
}

.param-name {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    color: #e74c3c;
    font-weight: bold;
    min-width: 120px;
    margin-right: 1rem;
    border: 1px solid #e1e8ed;
}

.param-type {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #9b59b6;
    font-weight: bold;
    min-width: 80px;
    margin-right: 1rem;
}

.param-desc {
    color: #555;
    flex: 1;
}

/* Enum Documentation */
.enum-container {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 1px solid #e9ecef;
}

.enum-values {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.enum-value {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.enum-value-name {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #8e44ad;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.enum-value-desc {
    color: #555;
    font-size: 0.9rem;
}

/* Example Sections */
.example-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid #e9ecef;
}

.example-title {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.use-case {
    background: white;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 1rem 0;
    border-left: 4px solid #8e44ad;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.use-case-title {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.use-case-desc {
    color: #555;
    margin-bottom: 1rem;
    font-style: italic;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.feature-title {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.feature-desc {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Footer */
.footer {
    background-color: #413768;
    color: #ecf0f1;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

.footer p {
    color: #ecf0f1;
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
    }
    
    .nav a {
        padding: 0.75rem 1rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .content {
        padding: 1.5rem;
    }
    
    .header-cover-image {
        height: 150px;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .param-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .param-name, .param-type {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.fw-bold { font-weight: 600; }
.fw-normal { font-weight: 400; }
.fw-light { font-weight: 300; }

.text-muted { color: #7f8c8d; }
.text-primary { color: #8e44ad; }
.text-success { color: #27ae60; }
.text-warning { color: #f39c12; }
.text-danger { color: #e74c3c; }

/* ================================================
   TABLE OF CONTENTS STYLES - PROFESSIONAL & REUSABLE
   ================================================ */

.table-of-contents {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

.table-of-contents::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8e44ad 0%, #9b59b6 50%, #e74c3c 100%);
    border-radius: 12px 12px 0 0;
}

.table-of-contents h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #8e44ad;
    position: relative;
}

.table-of-contents h2::before {
    content: '📋';
    margin-right: 0.5rem;
    font-size: 1.6rem;
}

/* TOC Section Containers */
.toc-section {
    margin-bottom: 1.8rem;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #8e44ad;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

.toc-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-left-color: #6c3483;
}

.toc-section:last-child {
    margin-bottom: 0;
}

/* TOC Main Section Headers */
.toc-section h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
    position: relative;
}

.toc-section h3 a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 0.3rem 0;
    border-radius: 4px;
    position: relative;
}

.toc-section h3 a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #8e44ad, #6c3483);
    transition: width 0.3s ease;
}

.toc-section h3 a:hover {
    color: #8e44ad;
}

.toc-section h3 a:hover::after {
    width: 100%;
}

/* Clean professional section headers without arrows */

/* TOC Lists */
.toc-section ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.toc-section > ul {
    padding-left: 1rem;
}

.toc-section li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.toc-section li::before {
    content: '•';
    color: #8e44ad;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
    transition: all 0.3s ease;
}

.toc-section li:hover::before {
    color: #6c3483;
    transform: scale(1.2);
}

/* Nested Lists */
.toc-section ul ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid #ecf0f1;
    transition: border-color 0.3s ease;
}

.toc-section li:hover ul {
    border-left-color: #8e44ad;
}

.toc-section ul ul li {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.3rem;
}

.toc-section ul ul li::before {
    content: '▸';
    color: #95a5a6;
    font-size: 0.8rem;
}

.toc-section ul ul li:hover::before {
    color: #8e44ad;
}

/* TOC Links */
.toc-section a {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    margin: -0.2rem -0.4rem;
    display: inline-block;
    position: relative;
}

.toc-section li a {
    font-weight: 500;
}

.toc-section ul ul a {
    font-weight: 400;
    color: #555;
}

.toc-section a:hover {
    color: #8e44ad;
    background-color: rgba(142, 68, 173, 0.1);
    transform: translateX(4px);
}

.toc-section a:active {
    color: #6c3483;
    background-color: rgba(142, 68, 173, 0.2);
}

/* Special highlighting for important sections */
.toc-section a[href*="ai-generation"],
.toc-section a[href*="ethical-responsibility"] {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(155, 89, 182, 0.1) 100%);
    border-left: 3px solid #e74c3c;
    padding-left: 0.8rem;
    font-weight: 600;
}

.toc-section a[href*="ai-generation"]:hover,
.toc-section a[href*="ethical-responsibility"]:hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.2) 0%, rgba(155, 89, 182, 0.2) 100%);
    color: #e74c3c;
}

/* TOC Section Categories with Color Coding */
.toc-section:nth-child(1) { border-left-color: #8e44ad; } /* Overview - Purple */
.toc-section:nth-child(2) { border-left-color: #2ecc71; } /* Custom Inspectors - Green */
.toc-section:nth-child(3) { border-left-color: #9b59b6; } /* Editor Wizards - Purple */
.toc-section:nth-child(4) { border-left-color: #f39c12; } /* JSON Templates - Orange */
.toc-section:nth-child(5) { border-left-color: #1abc9c; } /* Professional Benefits - Teal */
.toc-section:nth-child(6) { border-left-color: #e74c3c; } /* AI Generation - Red */
.toc-section:nth-child(7) { border-left-color: #34495e; } /* AI Workflow - Dark Gray */

/* Badge-style indicators for tool counts */
.toc-section li:contains("(4 tools)"),
.toc-section li:contains("(3 tools)") {
    position: relative;
}

/* Responsive TOC */
@media (max-width: 768px) {
    .table-of-contents {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .table-of-contents h2 {
        font-size: 1.5rem;
    }
    
    .toc-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .toc-section h3 {
        font-size: 1.1rem;
    }
    
    .toc-section > ul {
        padding-left: 0.5rem;
    }
    
    .toc-section ul ul {
        padding-left: 1rem;
    }
}

/* Print-friendly TOC */
@media print {
    .table-of-contents {
        background: white;
        border: 2px solid #333;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .table-of-contents::before {
        display: none;
    }
    
    .toc-section {
        background: white;
        box-shadow: none;
        border-left: 2px solid #333;
    }
    
    .toc-section a {
        color: #333 !important;
    }
}

/* Smooth scroll behavior for anchor links */
html {
    scroll-behavior: smooth;
}

/* Highlight target sections when navigated to */
.content h2:target,
.content h3:target {
    background-color: rgba(142, 68, 173, 0.1);
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 6px;
    animation: highlight-flash 2s ease-in-out;
}

@keyframes highlight-flash {
    0% { background-color: rgba(142, 68, 173, 0.3); }
    100% { background-color: rgba(142, 68, 173, 0.1); }
}

/* ================================================
   SCROLL NAVIGATION BUTTONS - PROFESSIONAL & REUSABLE
   ================================================ */

.scroll-buttons {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scroll-button {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #8e44ad 0%, #6c3483 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.scroll-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(142, 68, 173, 0.4);
    opacity: 1;
    background: linear-gradient(135deg, #6c3483 0%, #8e44ad 100%);
}

.scroll-button:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 2px 10px rgba(142, 68, 173, 0.3);
}

.scroll-button.scroll-top {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.scroll-button.scroll-top:hover {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.scroll-button.scroll-bottom {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.scroll-button.scroll-bottom:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Scroll button icons */
.scroll-button.scroll-top::before {
    content: '↑';
    font-size: 20px;
    font-weight: bold;
}

.scroll-button.scroll-bottom::before {
    content: '↓';
    font-size: 20px;
    font-weight: bold;
}

/* Hide buttons when not needed */
.scroll-button.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(100px);
}

/* Professional tooltips for scroll buttons */
.scroll-button::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(44, 62, 80, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    margin-right: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.scroll-button:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(-5px);
}

/* Responsive scroll buttons */
@media (max-width: 768px) {
    .scroll-buttons {
        right: 1rem;
        bottom: 1rem;
    }
    
    .scroll-button {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .scroll-button::after {
        display: none; /* Hide tooltips on mobile */
    }
}

/* Smooth scroll animation enhancement */
@keyframes scroll-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

.scroll-button:active {
    animation: scroll-bounce 0.5s ease-in-out;
}

/* ================================================
   FLOATING MINI TABLE OF CONTENTS - PROFESSIONAL & REUSABLE
   ================================================ */

.floating-toc {
    position: fixed;
    right: 2rem;
    top: 300px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(142, 68, 173, 0.2);
    border-radius: 12px;
    padding: 1rem;
    max-width: 300px;
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 0.9;
}

.floating-toc:hover {
    opacity: 1;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transform: translateX(-5px);
}

/* Remove collapse functionality - always show full TOC */

/* Always visible - no hiding behavior */

/* Simplified header - no toggle button */
.floating-toc-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(142, 68, 173, 0.2);
}

.floating-toc-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    text-align: center;
}

/* Mini TOC Content - always visible */
.floating-toc-content {
    /* Always shown */
}

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

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

.floating-toc-item.active {
    background-color: rgba(142, 68, 173, 0.1);
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    margin: 0.2rem -0.5rem;
}

.floating-toc-link {
    display: block;
    color: #2c3e50;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 0.25rem 0;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 1rem;
}

.floating-toc-link::before {
    content: '';
    position: absolute;
    left: 0;
    width: 4px;
    height: 4px;
    background: #8e44ad;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.floating-toc-link:hover {
    color: #8e44ad;
    background-color: rgba(142, 68, 173, 0.05);
    padding-left: 1.2rem;
}

.floating-toc-link:hover::before {
    background: #6c3483;
    transform: translateY(-50%) scale(1.3);
}

.floating-toc-item.active .floating-toc-link {
    color: #6c3483;
    font-weight: 600;
}

.floating-toc-item.active .floating-toc-link::before {
    width: 6px;
    height: 6px;
    background: #6c3483;
    transform: translateY(-50%) scale(1);
}

/* Nested items (subsections) */
.floating-toc-item.level-2 .floating-toc-link {
    font-size: 0.8rem;
    padding-left: 1.5rem;
    color: #34495e;
}

.floating-toc-item.level-2 .floating-toc-link::before {
    width: 3px;
    height: 3px;
    background: #95a5a6;
    top: 50%;
    transform: translateY(-50%);
}

.floating-toc-item.level-2:hover .floating-toc-link {
    padding-left: 1.7rem;
}

/* Progress indicator */
.floating-toc-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #8e44ad, #6c3483);
    border-radius: 0 6px 6px 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}

.floating-toc-item.active .floating-toc-progress {
    transform: scaleY(1);
}

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

.floating-toc::-webkit-scrollbar-track {
    background: transparent;
}

.floating-toc::-webkit-scrollbar-thumb {
    background: rgba(142, 68, 173, 0.3);
    border-radius: 2px;
}

.floating-toc::-webkit-scrollbar-thumb:hover {
    background: rgba(142, 68, 173, 0.5);
}

/* Responsive behavior */
@media (max-width: 1200px) {
    .floating-toc {
        right: 1rem;
        max-width: 250px;
        top: 250px;
        max-height: calc(100vh - 350px);
    }
}

@media (max-width: 768px) {
    .floating-toc {
        display: none; /* Hide on mobile to avoid clutter */
    }
}

/* Integration with scroll buttons */
.floating-toc + .scroll-buttons {
    right: 2rem;
    bottom: 2rem;
}

@media (max-width: 1200px) {
    .floating-toc + .scroll-buttons {
        right: 1rem;
    }
}

/* Smooth reveal animation */
@keyframes floating-toc-reveal {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(50px);
    }
    to {
        opacity: 0.9;
        transform: translateY(-50%) translateX(0);
    }
}

.floating-toc.reveal {
    animation: floating-toc-reveal 0.5s ease-out;
}

/* Professional glass morphism effect */
.floating-toc {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}