@font-face {
    font-family: 'AA Cursive';
    src: url('polices/ABcursive-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'Open Dyslexic';
    src: url('polices/OpenDyslexic-Regular.otf') format('truetype');
}

@font-face {
    font-family: 'Belle Allure GS';
    src: url('polices/BelleAllureGS-Gros.otf') format('truetype');
}


@font-face {
    font-family: 'Belle Allure CE';
    src: url('polices/BelleAllureCE-Gros.otf') format('truetype');
}

@font-face {
    font-family: 'Belle Allure CM';
    src: url('polices/BelleAllureCM-Gros.otf') format('truetype');
}

@font-face {
    font-family: 'Belle Allure script';
    src: url('polices/BelleAllureScript2i-Gros.otf') format('truetype');
}

@font-face {
    font-family: 'Luciole';
    src: url('polices/Luciole-Regular.woff') format('woff');
}

@font-face {
    font-family: 'Marelle';
    src: url('polices/Marelle-Regular.woff2') format('woff');
}

@font-face {
    font-family: 'Marelle bâton';
    src: url('polices/MarelleBaton-Regular.woff2') format('woff');
}

* {
    box-sizing: border-box;
}

.wait * {
    cursor: wait !important;
}

:root {
    --fond-appli: #113957;
    --format-print: portrait;
    --display-maj: block;
    --display-min: block;
    --display-cursive: block;
    --couleur-bordures: #31b4ff;
    --largeur-carte: 33%;
    --hauteur-carte: 33%;
    --taille-police-carte: calc(((100vw - 245px - 40px) * 93 / 100) / 30 );
    --taille-police-initiale: calc(((100vw - 245px - 40px) * 93 / 100) / 9 );
    --taille-police-tag: calc(((100vw - 245px - 40px) * 93 / 100) / 45 );    
    --taille-police-carte-impression: 0.6cm;
    --taille-police-tag-impression: 0.45cm;
    --coins-cartes: 5% / 3.53%;
    --epaisseur-bordures: 5px;
    --taille-police-texte: calc(((100vw - 245px - 40px) * 93 / 100) / 30 );
    --taille-police-texte-impression: 0.6cm;
    --police-cursive: Marelle;
    --police-script: Luciole;
    --padding-cursive: 0em;
    --height-cursive: auto;
    --padding-cursive-impression: 0em;
    --height-cursive-impression: auto;

}
  
html {
    height: 100%;
    display: flex;
    flex-direction: column;
}

body {
    height: 100%;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--fond-appli);
    color: #ffffff;
}

header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    color: white;
    padding: 5px;
    text-align: center;
    height: 50px;
    flex-shrink: 0;
}

.primtux header {
    height: 80px;
}

#educajou {
    float: left;
    height: 100%;
}

#educajou>img {
  height: 100%;  
}

.primtux #educajou {opacity: 0;}

#logo {
    height: 100%;
    margin-right: 10px;
}

#titre {
    font-size: 36px;
    height: 100%;
    display: flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 60px;
}

#spanBoutons {
    height: 90%;
    flex-direction: row;
    gap: 5px;
    justify-content: space-between;
    align-items: center;
    float: right;
    margin-right: 10px;
    margin-top: 2.5px;
    position: relative;  
}

button {
    box-sizing: border-box !important;
    background-color: #ffffff;
    color: #315570;
    font-weight: bold;
    border-radius: 5px;
    border: none;
    vertical-align: middle;
}

#zoneBoutons {
    margin: 10px auto 5px 10px;
}

#zoneBoutons button {
    display: inline-block;
    width: 35px;
    height: 35px;
    margin : 3px;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    background-size: contain;
    vertical-align: middle;
}

#nouveau {
    background-image: url(images/nouveau.svg);
}

#ouvrir {
    background-image: url(images/ouvrir2.svg);
}

#codi {
    background-image: url(images/cloud.svg);
}

#nextcloud {
    background-image: url(images/nextcloud.svg);
}

#enregistrer {
    background-image: url(images/enregistrer.svg);
}

#spanBoutons>button>img {
    height: 75%;
    vertical-align: middle;
}

button:hover {
    background-color: #a0dcfd;
    cursor: pointer;
}

#spanBoutons button {    
    height: 100%;
}

main {
    flex: 1;
    display: flex !important;
    flex-direction: row;
    overflow: hidden;
}

#gauche {
    height: 100%;
    width: 245px;
    overflow-y: auto;
}

.zoneOption {
    padding: 25px 10px 20px 10px;
    margin: 20px 10px;
    border: 1px #ffffff solid;
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.boutonReplier {
    position: absolute;
    top: -10px;
    right: 5px;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background-image: url(images/fleche.svg);
    background-size: 80%;
    background-repeat: no-repeat;
    background-position: center;
}

.zoneOption.repliee>.boutonReplier {
    transform: rotate(180deg);
}

.zoneOption.repliee {
    padding: 0 0 0 10px !important;
    margin: 20px 10px 35px 10px !important;
}

.zoneOption.repliee>.sous-zone {
    display: none !important;
}

.titreZoneOption {
    position: absolute;
    bottom: 100%;
    transform: translateY(50%);
    background-color: var(--fond-appli);
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #ffffff;
}

.sous-zone {
    display: flex;
    font-size: 1.2em;
}

.horizontale {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1em;
}

.verticale {
    flex-direction: column;
}

.padding {
    padding-left: 1em;;
}

.sous-zone button {
    font-size: inherit;
    line-height: 1em; /* même hauteur que l’image */
    padding: 0.2em 0.5em; /* ajuste pour un peu d’espace */
    display: inline-flex;
    align-items: center;
    gap: 0.4em; /* espace entre image et texte */
}

.sous-zone button img {
    height: 1em;
    vertical-align: middle;
    display: inline-block;
}

.sous-zone input[type=number] {
    width: 3em;
    font-size: inherit;
    text-align: center;    
}

.sous-zone select {
    font-size: inherit;
    text-align: left; 
}



#paysage::first-letter {
    transform: rotate(90deg);
}

button.actif {
    background-color: rgb(246, 252, 211);
    color: #000000;
}

.inputCouleur {
    width: 2em;
    height: 2em;
    border-width: 1px;
}

.caseCouleur {
    display: inline-block;
    height: 20px;
    width: 20px;
    border: 1px #000000 solid;
    border-radius: 3px;

}

#apercu {
    background-color: rgb(169, 187, 197);
    flex: 1;
    max-height: 100%;
    padding: 20px;
    overflow: auto;
    border-left: 4px gray solid;
    border-top: 4px gray solid;
    border-radius: 10px 0px 0px 0px;
}

#conteneurFeuilles {
    transform: scale(1);
    transform-origin: top center;
    transition: transform 0.1s linear;
}

.feuille {
    background-color: #ffffff;
    color: #000000;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2);
    padding: 7%;
    margin: auto;
    border: 1px #296be4 solid;    
    position: relative;
    width: 100%;
}

.feuille.portrait {
    height: auto;
    width: 100%;
    aspect-ratio: 210 / 296;
}

.feuille.paysage {
    width: auto;
    height: 100%;
    aspect-ratio: 297 / 210;
}

.credits {
    position: absolute;
    top: 2%;
    left: 2%;
    width: 98%;
    font-size: calc(((100vw - 245px - 40px) * 93 / 100) / 60 );
    color: gray;
    text-align: center;
}

.credits img {
    height: 1.2em;
    vertical-align: middle;
}

.credits.bas {
    top: auto;
    bottom: 2%;
}

.zoneCentrale {
    width: 100%;
    height: 100%;
}

.portrait>.zoneCentrale {
    gap: 10%
}

.paysage>.zoneCentrale {
    gap: 16%;
}


.carte {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    border: var(--epaisseur-bordures) var(--couleur-bordures) solid;
    border-radius: var(--coins-cartes);
    padding: 1%;
    width: var(--largeur-carte);
    height: var(--hauteur-carte);
    margin-right: 0.2% !important;
    margin-bottom: 0.2% !important;
    vertical-align: middle;
    overflow: hidden;
    position: relative;
    transition: width 0.25s linear;
}

.tag {
    font-size: var(--taille-police-tag);
    color: #000000;
    background-color: #a0dcfd;   
    border-radius: 1em;
    width: fit-content;
    min-width: 1.2em;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    padding: 0 0.5em 0 0.5em;
    white-space: pre;
}

.showTag .tag {
    display: inline-block !important;
}

.carte.selectionnee {
    background-color: rgb(245, 245, 136);
    box-shadow: 0px 0px 5px rgb(0, 0, 0) inset;
}

.cadreIllustration {
    flex: 1;
    border: 1px #000000 solid;
    border-radius: 10px;
    background-color: antiquewhite;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    position: relative;
    overflow: hidden;
}

body:not(.deuxImages) .cadreIllustration.deuxieme {
    display: none !important;
}

.cadreIllustration.contientImage {
    border: none;
    background-color: transparent;
}

.cadreIllustration>.image {

    max-width: 100%;
    max-height: 100%;
    border-radius: 5%;

}


.inputImage, #inputImporterImages {
    display: none;
}

.cadreIllustration>div {
    width: 80%;
    min-height: 25%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    background-color: #ccd6db;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5) inset;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.cadreIllustration>div:hover {
    background-color: #eef3f5;

}

.boutonnav {
    position: absolute;
    top: 50%;
    height: 20px;
    width: 20px;
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #000000;
    border-radius: 50%;
    transform: translateY(-50%);
    display: none;
}

.contientImageDistante:hover>.boutonnav {
    display: block;
}

.precedent {
    right: calc(100% - 20px);
}

.suivant {
    left: calc(100% - 20px);
}

.labelInputImage {

    background-image: url(images/ouvrir.svg);

}

.boutonRecherche {
    background-image: url(images/internet.svg);
}

.boutonsBasLightbox{
    text-align: center;
}

.boutonsBasLightbox button {
    border: 1px black solid;
    border-radius: 0.5em;
}

#selectApi, #selectApi2, #selectLangueFenetre {
    font-size: 1em;
    color: #315570;
    font-weight: bold;
}

body:not(.deuxImages) #selectApi2 {
    display: none;
}

.textes {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: inherit;
}

.inputExpression {
    border: none;
    color: #000000;
    background-color: #ffffff;
    font-size: var(--taille-police-carte);
    text-align: center;
    border-radius: 5px;
    width: 100%;
    height: 1.5em;
}

.titrequia, .titrejai {
    margin: 0;
    text-align: center;
    font-size: var(--taille-police-carte);
    font-weight: bold;
}

.boutonSupprimer {
    position: absolute;
    height: 20px;
    width: 20px;
    top: 2px;
    right: 2px;
    background-image: url(images/supprimer.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    visibility: hidden;
    background-color: transparent;
    border: none;
    outline: none;
}

.boutonSupprimerCarte {
    position: absolute;
    height: 20px;
    width: 20px;
    bottom: 2px;
    right: 2px;
    background-image: url(images/supprimer.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    visibility: hidden;
    background-color: transparent;
    border: none;
    outline: none;
}

.carte:hover>.boutonSupprimerCarte {
    visibility: visible;
}

.cadreIllustration:hover>.boutonSupprimer {
    visibility: visible;
}


.maj {
    text-transform: uppercase !important;
    font-family: var(--police-script);
    display: var(--display-maj);
}

.min {
    text-transform: none;
    font-family: var(--police-script);
    display: var(--display-min);
}

.cursive {
    text-transform: none;
    font-family: var(--police-cursive) !important;
    display: var(--display-cursive);
}

.inputExpression.cursive {
    height: var(--height-cursive);
    padding-bottom: var(--padding-cursive);
}

.initiale.cursive {
    height: 1.2em;
}

.majLongue .initiale.cursive {
    height: 2.25em;
}

.minLongue .initiale.cursive {
    line-height: 1.2em;
}

.texte {
    border-radius: 5px;
    border: none;
    font-size: var(--taille-police-texte);
    text-align: center;
    resize: none;
    overflow: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 0;
    min-height: 1.2em;
    transition: height 0.2s ease;
    height: auto !important;
    margin: 0;
}

.initialeRouge .texte::first-letter {
    color: red;;
}

#conteneurFeuilles:not(.initialeRouge) .initiale, .pdf:not(.initialeRouge) .initiale {
    display: none;
}


.initialeRouge .initiale {
    color: red;
    background-color: white;
    font-size: var(--taille-police-initiale);
    font-family: var(--police-script);
    margin: 0;
    text-align: center;
}


.multiTexteVide .texte {
    background-color: #c9e9fa;
}


body:not(.zoneTexte) .texte, body.zoneTexte input.min, body.zoneTexte input.maj, body.zoneTexte input.cursive, body:not(.quia) .jeuquia {
    display: none;
}

body:not(.quia) #zonecustomjeaiquia {
    display: none;
}



body.zoneTexte .texte {
    display: block;
}

body:not(.zoneTexte) input.maj {
    display: var(--display-maj);
}

body:not(.zoneTexte) input.min {
    display: var(--display-min);
}

body:not(.zoneTexte) input.cursive {
    display: var(--display-cursive);
}

body:not(.quia) .jeuquia {
    display: none;
}

@media print {

    body {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        height: fit-content !important;
    }

    
    

    @page {
        size: var(--format-print);
        margin: 0; /* Définit les marges à 0 */
    }
   
    
    .hidePrint {
        display: none !important;
    }

    body {
        background-color: #ffffff;
        margin: 0;
        padding: 0;
    }

    main {
        margin: 0;
        padding: 0cm;
        background-color: transparent;
        flex-direction: column;
        height: fit-content;
    }

    #apercu {
        padding: 0cm;
        margin: 0cm;
        background-color: transparent !important;
        border-radius: 0px 0px 0px 0px !important;
        height: fit-content !important;
        width: 100% !important;
        border: none !important;
    }

    .feuille {
        width: 100% !important;
        margin: 0;
        border: none !important;
    }
    
    .portrait>.zoneCentrale {
        gap: 2cm;
    }
    
    .paysage>.zoneCentrale {
        gap: 2.6cm;
    }

    .credits {
        font-size: 0.4cm;
        top: 8mm
    }
    
    .credits.bas {
        top: auto;
        bottom: 8mm;
    }


    .inputExpression {
        font-size: var(--taille-police-carte-impression);
    }

    .texte {
        font-size: var(--taille-police-texte-impression);
    }
    .cadreIllustration:not(.contientImage) {
        display: none;
    }
    input:placeholder-shown {
        display: none;
    }

    body:not(.zoneTexte) .textevide .textes{
        display: none;
    }

    body.zoneTexte .multiTexteVide .textes {
        display: none;
    }

    .tag {
        font-size: var(--taille-police-tag-impression);
    }

}



#darkbox {
/* Elle doit prendre toute la largeur et toute la hauteyr  */
    position: absolute;
    z-index: 999; /* O la place sous la lightbox */
    width: 100%;
    height: 100%;
    top: 0px;
    left: 0px;
    background-color: rgba(0,0,0,0.5);
}
        
.lightbox {
    position: absolute;
    z-index: 1000; /* O la place sur la lightbox */
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 20px);
    max-height: calc(100% - 40px);
    top: 50%;
    left: 50%;
    padding: 10px; /* Marge intérieure */
    border-radius: 20px; /* Coins arrondis */
    box-shadow: 0px 0px 15px #ffffff; /* Ombre transparente blanche */
    border: 2px solid #000000; /* Bordure de 2px noire */
    transform: translateX(-50%) translateY(-50%); /* Pour centrer dans la page */
    background-color: #ffffff; /* Couleur de fond */
    color: #000000;

}

#waitPdf {
    position: absolute;
    top: 50px;
    right: 20px;
    color: #ffffff;
    background-color: #812104;
    padding: 1em;
    border: 2px #ffffff solid;
    border-radius: 2em;
}

#divTuto {
    width: 80vw;
    height: 45vw; /* Pour respecter un ratio 16:9 */
    max-width: 100vw;
    max-height: 100vh;
    padding-top: 45px;
    overflow: hidden;
}


#divTuto::before {
    height: 35px;
    width: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
    background: linear-gradient(to bottom, #8a8d8f, #d9e5ec);
}

#titreTuto {
    position: absolute;
    left: 10px;
    top: 5px;
    font-size: 24px;
}

#herve {
    padding-left: 30px;
    background-image: url(images/herve.png);
    background-repeat: no-repeat;
    background-position: left center;
    background-size: auto 100%;
}


#videoTuto {
    aspect-ratio: 16/9;
}



.contenu-lightbox {
    flex: 1;
    font-size: 16px;
    font-family: Arial, Helvetica, sans-serif;
    overflow-y: auto;
    text-align: left;
    width: fit-content;
    width: 100%;


}

.bouton-fermer {
    position : fixed;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-image: url(images/bouton_fermer.svg);
    background-size: contain;
    background-color: transparent;
    border: none;
    outline: none;
}

#divTuto .bouton-fermer {
    top: 3px;
    right: 5px;
}

.cartouche {
    padding-left: 20px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: left;
}

.code {
    background-color: #000000;
    color: #ffffff;
    padding: 0.5em;
    font-family: 'Courier New', Courier, monospace;
    width: 90%;
    border-radius: 5px;
    border: 1px gray outset;
}

#divCodi, #DivNextcloud {
    background-color: #d1e8f7 !important;
}

#divListe {
    width: 45em;
    max-width: 100%;
    height: 25em;
    max-height: 100%;
}

#inputListe {
    flex: 1;
    resize: none;
    margin-bottom: 1em;
}

#boutonListe {
    margin: 1em auto;
    font-size: 1em;
    border: 1px solid #000000;
}

#inputCodi, #inputNextcloud {
    width: 90%;
    padding: 0.5em;
}

#inputCodi, #inputNextcloud {
    width: calc(100% - 6px);
    box-sizing: border-box;
    border-radius: 5px;
    height: 2em;
    padding: 3px;
    margin-top: 10px;
    margin-bottom: 10px;
    display: inline-block;
}

#resultatCodi, #resultatNextcloud {
    padding: 3px;
    border-radius: 3px;
}

#resultatCodi.correct, #resultatNextcloud.correct {
    background-color: greenyellow;
}

#resultatCodi.incorrect, #resultatNextcloud.incorrect {
    background-color: orange;
}

@keyframes loadingBackground {
    0% { background-color: #f0f0f0; }
    50% { background-color: #d0d0d0; }
    100% { background-color: #f0f0f0; }
}

#resultatCodi.waiting, #resultatNextcloud.waiting {
    display: block;
    border-radius: 0.5em;
    border: 1px solid #000000;
    text-align: center;
    padding: 10px;
    animation: loadingBackground 1.5s infinite ease-in-out;
}

#lienCodi, #lienNextcloud {
    font-family: 'Courier New', Courier, monospace;
    color:rgb(41, 40, 40);
    font-size: 0.8em;
    padding: 1em;
    border: 1px #000000 solid;
    border-radius: 5px;
    margin-top: 1em;
    margin-bottom: 1em;
}

#divMD .contenu-lightbox {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#conteneurCodeMD {
    flex: 1;
    background-color: #000000;
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    padding: 1em 0.5em;
    border: 2px gray outset;
    border-radius: 0.5em;
    min-height: 3em;
    height: 100%;
    position: relative;
    width: calc(100% - 1em - 4px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#contenuCodeMD {
    width: 100%;
    height: 100%;
    flex: 1;
    max-height: 100%;
    overflow-y: scroll;  /* Change from auto to scroll if you want scrollbars always visible */
    overflow-x: auto;  /* Keep this for horizontal scrolling if content overflows horizontally */
    padding-right: 17px;  /* Optional: to compensate for scrollbar width */
}


.boutonCopier {
    position: absolute;
    top: 0.2em;
    right: 0.2em;
}

.hide {
    display: none !important;
}

.pdf {
    border: none !important; /* Supprime la bordure */
    background-color: white !important; /* (Optionnel) Ajuste le fond si nécessaire */
    opacity: 1 !important;
    box-shadow: none !important;
}

.pdf label {
    display: none;
}

.pdf .inputExpression{
    font-size: var(--taille-police-carte-impression);    
}

.pdf .inputExpression.cursive{
    height: var(--height-cursive-impression);
    padding-bottom: var(--padding-cursive-impression);
}

.pdf .texte {
    font-size: var(--taille-police-texte-impression);
}


.pdf .maj {
    text-transform: uppercase !important;
}

.pdf .tag {
    font-size: var(--taille-police-tag-impression);
}

.pdf .cadreIllustration:not(.contientImage) {
    display: none;
}

.pdf input:placeholder-shown {
    display: none;
}

.pdf .credits {
    font-size: 0.4cm;
    top: 8mm;
}

.pdf .credits.bas {
    top: auto;
    bottom: 8mm;
}

body:not(.zoneTexte) .pdf .textevide .textes {
    display: none;
}

body.zoneTexte .pdf .multiTexteVide .textes {
    display: none;
}

body:not(.zoneTexte) .pourZoneTexte {
    display: none;
}