:root {
    --zoom-factor: 1;
}

.Document-Wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2000;
}

.Document-Wrapper::-webkit-scrollbar {
    width: 8px;
}

.Document-Wrapper::-webkit-scrollbar-track {
    background: rgba(var(--rgb-scroll-track), 0.8);
    border-left: 1px solid var(--color-primary);
}

.Document-Wrapper::-webkit-scrollbar-thumb {
    background: var(--color-primary);
}

.Cale-Bas {
    min-height: 120px;
    width: 100%;
    flex-shrink: 0;
}

.Document-A4 {
    width: 100%;
    max-width: 1050px;
    margin-top: 60px;
    margin-bottom: 120px;
    flex-shrink: 0;
    height: auto;  
    min-height: 800px;
    
    background: 
        linear-gradient(180deg, rgba(0, 15, 5, 0.95) 0%, rgba(0, 10, 3, 0.98) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(var(--rgb-primary), 0.03) 2px, rgba(var(--rgb-primary), 0.03) 4px);
    border: 1px solid var(--color-primary);
    border-top: 4px solid var(--color-primary);
    border-bottom: 4px solid var(--color-primary);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), inset 0 0 50px rgba(var(--rgb-primary), 0.1);
    padding: 80px 100px;
    position: relative;
    transition: background 0.3s ease;
}

body[data-theme="bleu"] .Document-A4 { 
    background: 
        linear-gradient(180deg, rgba(0, 10, 25, 0.95), rgba(0, 5, 15, 0.98)),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(var(--rgb-primary), 0.03) 2px, rgba(var(--rgb-primary), 0.03) 4px);
}

body[data-theme="jaune"] .Document-A4 { 
    background: 
        linear-gradient(180deg, rgba(25, 25, 0, 0.95), rgba(15, 15, 0, 0.98)),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(var(--rgb-primary), 0.03) 2px, rgba(var(--rgb-primary), 0.03) 4px);
}

body[data-theme="rouge"] .Document-A4 { 
    background: 
        linear-gradient(180deg, rgba(25, 5, 5, 0.95), rgba(15, 3, 3, 0.98)),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(var(--rgb-primary), 0.03) 2px, rgba(var(--rgb-primary), 0.03) 4px);
}

body.lecture-pure .calque-cathodique {
    display: none !important;
}

body.lecture-pure .Document-A4 {
    background: rgba(10, 10, 10, 0.98) !important;
    box-shadow: none !important;
}

.Document-A4::before, .Document-A4::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-primary);
    opacity: 0.6;
    pointer-events: none;
}

.Document-A4::before { 
    top: 20px; 
    left: 20px; 
    border-right: none; 
    border-bottom: none; 
}

.Document-A4::after { 
    bottom: 20px; 
    right: 20px; 
    border-left: none; 
    border-top: none; 
}

.Document-Header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-family: 'VT323', monospace;
    color: var(--color-primary);
    margin-bottom: 25px;
}

.En-Tete-Gauche {
    display: flex;
    flex-direction: column;
    font-size: 20px;
    gap: 5px;
    opacity: 0.8;
}

.En-Tete-Droite {
    font-size: 26px;
    text-shadow: 0 0 8px rgba(var(--rgb-primary), 0.5);
    letter-spacing: 2px;
}

.Ligne-Document {
    border: 0;
    height: 2px;
    background: var(--color-primary);
    margin-bottom: 50px;
    box-shadow: 0 0 5px var(--color-primary);
    opacity: 0.7;
}

.Article-Section {
    margin-bottom: 45px;
}

.Article-Titre {
    font-family: 'VT323', monospace;
    font-size: calc(26px * var(--zoom-factor));
    color: var(--color-bg-main);
    background: var(--color-primary);
    display: inline-block;
    padding: 5px 15px;
    margin-bottom: 25px;
    box-shadow: 0 0 10px rgba(var(--rgb-primary), 0.3);
    letter-spacing: 1px;
    transition: font-size 0.2s ease;
}

.Article-Paragraphe {
    font-family: 'VT323', monospace;
    font-size: calc(22px * var(--zoom-factor));
    line-height: calc(1.7 * var(--zoom-factor));
    color: #efefef;
    text-align: justify;
    margin: 0 0 20px 0;
    transition: font-size 0.2s ease, line-height 0.2s ease;
}

.Panneau-Controles {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 3000;
}

.Panneau-Titre {
    color: var(--color-primary);
    font-family: 'VT323', monospace;
    font-size: 24px;
    text-align: center;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 5px;
    text-shadow: 0 0 5px var(--color-primary);
}

.Panneau-Categorie {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.Categorie-Titre {
    color: var(--color-primary);
    font-family: 'VT323', monospace;
    font-size: 16px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.Btn-Controle {
    background: rgba(0, 0, 0, 0.8);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 10px 15px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
}

.Btn-Controle:hover {
    background: rgba(var(--rgb-primary), 0.2);
    box-shadow: 0 0 15px var(--color-primary);
    transform: translateX(-5px);
}

.Document-Footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px dashed var(--color-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.Page-Number {
    color: var(--color-primary);
    font-family: 'VT323', monospace;
    font-size: 22px;
    opacity: 0.6;
    letter-spacing: 1px;
}

.bouton-retour-document {
    background: transparent;
    color: var(--color-primary);
    font-family: 'VT323', monospace;
    font-size: 24px;
    border: 2px solid var(--color-primary);
    outline: 1px solid var(--color-primary);
    outline-offset: 4px;
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    text-decoration: none;
    text-shadow: 0 0 8px var(--color-primary);
    transition: all 0.2s ease;
    box-shadow: inset 0 0 10px rgba(var(--rgb-primary), 0.1);
    text-transform: uppercase;
}

.bouton-retour-document:hover {
    background: rgba(var(--rgb-primary), 0.15);
    color: var(--color-primary);
    box-shadow: 0 0 20px var(--color-primary), inset 0 0 15px var(--color-primary);
    transform: scale(1.02);
}