/**
 * Table des matières dynamique
 */

/* ========================================
   CONTENEUR PRINCIPAL TOC
   ======================================== */

.toc-container {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: row;
    padding: 1rem 0 0 0.5rem;
    flex: 1;
    min-height: 0;
    gap: 0.5rem;
    align-items: stretch;
}

/* ========================================
   COLONNE DES TITRES
   ======================================== */

.toc-titles-column {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

/* ========================================
   BARRE VERTICALE AVEC CARRÉS
   ======================================== */

.toc-track {
    position: relative;
    width: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    flex: 0 0 4px;
    min-height: 0;
    align-self: stretch;
    margin-bottom: 10px;
    margin-right:30px;
}

.toc-unit {
    width: 100%;
    background: #d0d0d0;
    border-bottom: 1px solid #fff;
    transition: background 0.2s;
    cursor: pointer;
    position: relative;
}

/* Zone de clic élargie */
.toc-unit::before {
    content: '';
    position: absolute;
    left: -10px;
    right: -10px;
    top: -2px;
    bottom: -2px;
}

.toc-unit:hover {
    background: #4a90e2;
}

/* ========================================
   TITRES DE CHAPITRES
   ======================================== */

.toc-chapter {
    position: absolute;
    left: 0;
    transform: translateY(-50%);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    width: 100%;
}

.toc-chapter-title {
    font-size: 0.75rem;
    color: #333;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    padding: 0.2rem 0;
    transition: all 0.2s;
    text-align: right;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}

.toc-chapter:hover .toc-chapter-title {
    color: #000;
    font-weight: 600;
}

.toc-chapter.active .toc-chapter-title {
    font-weight: bold;
    color: #000;
}

/* ========================================
   INDICATEUR DE SCROLL
   ======================================== */

.toc-scroll-indicator {
    position: absolute;
    left: -2px;
    width: 8px;
    height: 20px;
    background: #2c3e50;
    border-radius: 4px;
    transition: top 0.1s ease-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 5;
    pointer-events: none;
}

/* ========================================
   POINTS D'INTÉRÊT - SYSTÈME GÉNÉRIQUE
   ======================================== */

.toc-unit[data-poi] {
    position: relative;
}

/* Badge générique sur le côté droit */
.toc-unit[data-poi]::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--poi-color, #999);
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: 0 0 0 1px var(--poi-color, #999);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

/* Les styles spécifiques pour chaque POI sont générés dynamiquement par JavaScript
   dans poi-dynamic-styles depuis poi-config.js */

.toc-unit[data-poi]:hover::after {
    transform: translateY(-50%) scale(1.3);
}