/* THÈME DOCUMENTATION */
:root {
    --sidebar-width: 250px;
    --couleur-code: #383a42;
    --couleur-fond-code: #fafafa;
    --couleur-primaire: #2c3e50;
    --couleur-info: #3498db;
    --couleur-success: #27ae60;
    --couleur-warning: #f39c12;
    --couleur-danger: #e74c3c;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
}

/* Barre latérale pour TOC */
#TOC {
position: fixed;
left: 0;
top: 0;
width: var(--sidebar-width);
height: 100vh;
overflow-y: auto;
background: #f8f9fa;
border-right: 1px solid #e0e0e0;
padding: 2rem 1rem;
margin: 0;
}

#TOC::before {
content: "Table des matières";
font-weight: 700;
font-size: 0.9em;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #666;
margin-bottom: 1rem;
display: block;
}

#TOC ul {
list-style: none;
margin: 0;
padding: 0;
}

#TOC li {
margin: 0;
}

#TOC a {
display: block;
padding: 0.5rem 0.75rem;
color: #333;
text-decoration: none;
border-left: 3px solid transparent;
transition: all 0.2s;
}

#TOC a:hover,
#TOC a:focus {
background: #e9ecef;
border-left-color: var(--couleur-primaire);
padding-left: 1rem;
}

/* Titres avec ancres */
h1, h2, h3, h4 {
    position: relative;
    scroll-margin-top: 2rem;
}

h1:hover .header-anchor,
h2:hover .header-anchor,
h3:hover .header-anchor,
h4:hover .header-anchor {
    opacity: 1;
}

.header-anchor {
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 0.5rem;
    font-weight: normal;
    color: var(--couleur-info);
}

/* Blocs de code avec toolbar */
pre {
    position: relative;
    background: var(--couleur-fond-code);
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    margin: 1.5rem 0;
}

pre::before {
    content: attr(data-language);
    position: absolute;
    top: 0;
    right: 0;
    background: #e0e0e0;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0 6px 0 6px;
    color: #666;
}

/* Callouts/Admonitions */
.note, .info, .warning, .danger, .success, .tip {
    padding: 1rem 1rem 1rem 3rem;
    margin: 1.5rem 0;
    border-left: 4px solid;
    border-radius: 4px;
    position: relative;
}

.note::before, .info::before, .warning::before,
.danger::before, .success::before, .tip::before {
    position: absolute;
    left: 1rem;
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info {
    background: #e3f2fd;
    border-color: var(--couleur-info);
    color: #0d47a1;
}

.info::before {
    content: "ℹ INFO";
    color: var(--couleur-info);
}

.warning {
    background: #fff3e0;
    border-color: var(--couleur-warning);
    color: #e65100;
}

.warning::before {
    content: "⚠ ATTENTION";
    color: var(--couleur-warning);
}

.danger {
    background: #ffebee;
    border-color: var(--couleur-danger);
    color: #b71c1c;
}

.danger::before {
    content: "✖ DANGER";
    color: var(--couleur-danger);
}

.success {
    background: #e8f5e9;
    border-color: var(--couleur-success);
    color: #1b5e20;
}

.success::before {
    content: "✓ SUCCÈS";
    color: var(--couleur-success);
}

.tip {
    background: #f3e5f5;
    border-color: #9c27b0;
    color: #4a148c;
}

.tip::before {
    content: "💡 ASTUCE";
    color: #9c27b0;
}

/* Badges inline */
.badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1;
    border-radius: 3px;
    white-space: nowrap;
}

.badge-info { background: var(--couleur-info); color: white; }
.badge-success { background: var(--couleur-success); color: white; }
.badge-warning { background: var(--couleur-warning); color: white; }
.badge-danger { background: var(--couleur-danger); color: white; }

/* Responsive */
@media (max-width: 1024px) {
    body {
        margin-left: 0;
        padding: 1rem;
    }

    #TOC {
    position: static;
    width: 100%;
    height: auto;
    margin-bottom: 2rem;
    }
}
