html {
    position: relative;
    min-height: 100%;
}

/* Correction de donnees, mode file : visionneuse et formulaire cote a cote,
   chaque colonne defilant independamment afin que l'image reste visible
   pendant la saisie. Ces regles sont ici et non dans DataCorrection.cshtml.css
   car ce dernier est isole par Blazor : ses selecteurs sont reecrits avec un
   attribut de portee que le balisage emis par Html.Raw ne porte pas. */
.dc-split {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.dc-split-viewer {
    flex: 1 1 79%;
    min-width: 0;
    position: sticky;
    top: 0;
}

.dc-split-form {
    flex: 1 1 21%;
    min-width: 0;
    max-height: 100vh;
    overflow-y: auto;
    /* CSS interdit de combiner overflow-y:auto avec overflow-x:visible : la
       valeur visible est alors forcee a auto, ce qui faisait apparaitre une
       barre horizontale residuelle meme sans debordement reel. Elle
       disparaissait au moindre reflow, d'ou son caractere intermittent. */
    overflow-x: hidden;
}

    /* Les conteneurs internes de la page sont en flex 100% par defaut : en
       colonne etroite ils doivent repasser en bloc pour ne pas ecraser les champs. */
    .dc-split-viewer .container,
    .dc-split-form .container {
        display: block;
        height: auto;
        width: 100%;
    }

    /* Les .row de Bootstrap portent des marges negatives destinees a compenser
       la gouttiere du conteneur parent. Nos conteneurs etant en width:100% sans
       cette gouttiere, ces marges debordaient et provoquaient une barre de
       defilement horizontale dans la colonne du formulaire. */
    .dc-split-form .row {
        margin-left: 0;
        margin-right: 0;
    }

    .dc-split-form .btn-bar {
        width: auto;
    }

    /* .input-group de Bootstrap autorise le retour a la ligne : dans une colonne
       etroite, le champ prend toute la largeur et repousse le symbole monetaire
       en dessous. On force la ligne unique comme la recherche.
       Les autres champs ne sont pas en width:100% mais a la taille par defaut
       d'un input : le groupe doit donc s'ajuster a son contenu, sinon il devient
       plus large qu'eux. La regle vaut pour les deux modes (file et unitaire). */
.dc-money-group {
    flex-wrap: nowrap;
    width: fit-content;
    max-width: 100%;
}

    .dc-money-group > .form-control {
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
    }

.dc-readonly-block {
    border: 1px solid #ccc;
    padding: 10px;
    margin-top: 10px;
}

    .dc-readonly-block summary {
        cursor: pointer;
        font-weight: bold;
    }

@media (max-width: 1200px) {
    .dc-split {
        flex-direction: column;
    }

    .dc-split-viewer {
        position: static;
    }

    .dc-split-form {
        max-height: none;
    }
}

body {
    margin-bottom: 60px;
}

.userguide-section {
    margin-bottom: 5px;
    border-bottom: 2px solid #e0e0e0;
}

    .userguide-section:last-child {
        border-bottom: none;
    }

.training-confirmation {
    padding: 25px;
    margin-top: 40px;
    border-top: 2px solid #ccc;
    background-color: #f8f9fa;
    border-radius: 6px;
}

    .training-confirmation .form-check-label {
        font-size: 1rem;
    }

#btnTrainingConfirm[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.userguide-image {
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.guide-title {
    margin-bottom: 1.5rem;
    padding-bottom: 0.25rem;
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
}

.guide-text p {
    margin-bottom: 10px;
}

.guide-text ul {
    margin-top: 10px;
}

#slider {
    display: none !important;
}

.spinner {
    width: 26px;
    height: 26px;
    border: 3px solid rgba(0, 0, 0, 0.18);
    border-top-color: rgba(0, 0, 0, 0.60);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.image-series {
    height: 80vh;
    min-height: 350px;
    overflow: auto;
    background: #e5e5e5;
    border: 1px solid #b8b8b8;
    padding: 20px;
}

.image-series:fullscreen {
    height: 100vh;
}

.image-series-page {
    width: max-content;
    min-width: 100%;
    margin: 0 0 24px;
    text-align: center;
}

.image-series-frame {
    position: relative;
    width: 100%;
    height: 500px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 2px 6px #0003;
}

.image-series-frame img {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: none;
}

.thumbs-zone {
    position: relative;
}

.thumbs-spinner {
    position: absolute;
    z-index: 5;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
}

    .thumbs-spinner.is-hidden {
        display: none;
    }

.viewer-spinner {
    position: absolute;
    z-index: 10;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.65);
}

    .viewer-spinner.is-hidden {
        display: none;
    }

.pdf-container {
    width: 100%;
    height: 85vh;
    min-height: 700px;
    overflow: hidden;
    border: 1px solid #b8b8b8;
    background-color: #f5f5f5;
}

.pdf-viewer {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.container.pdf-layout {
    display: block !important;
    width: 100% !important;
    max-width: none;
    float: none !important;
    clear: both;
}

    .container.pdf-layout > .pdf-viewer-section {
        display: flex !important;
        width: 100% !important;
        max-width: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        float: none !important;
        clear: both;
    }

.pdf-viewer-section > .btn-bar {
    width: fit-content;
    flex: 0 0 auto;
}

.pdf-main-viewer {
    position: relative;
    display: block !important;
    width: 100% !important;
    height: 70vh;
    min-height: 600px;
    flex: none !important;
    overflow: hidden;
    float: none !important;
    clear: both;
    border: 1px solid #ccc;
    background-color: #f5f5f5;
}

    .pdf-main-viewer .pdf-viewer {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 100%;
        border: 0;
    }

.pdf-thumbs-zone {
    position: relative;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin-top: 1rem;
    flex: 0 0 100% !important;
    float: none !important;
    clear: both !important;
}

.container.pdf-layout
.pdf-viewer-section
#pdfThumbsContainer {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0.5rem;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 0.5rem;
    float: none !important;
    clear: both !important;
}

.pdf-thumbnail {
    display: flex !important;
    width: 170px;
    min-width: 170px;
    max-width: 170px;
    min-height: 135px;
    margin: 0;
    padding: 0;
    flex: 0 0 170px !important;
    flex-direction: column !important;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 2px;
    background-color: #fff;
    color: inherit;
    text-align: center;
}

    .pdf-thumbnail:hover {
        border-color: #777;
    }

    .pdf-thumbnail:focus {
        outline: 3px solid #1c578a;
        outline-offset: 2px;
    }

    .pdf-thumbnail.selected {
        border: 2px solid #26374a;
    }

.pdf-thumbnail-icon {
    display: flex;
    width: 100%;
    height: 95px;
    flex: 0 0 95px;
    align-items: center;
    justify-content: center;
    background-color: #f1f1f1;
}

    .pdf-thumbnail-icon i {
        color: #c41230;
        font-size: 2.5rem;
    }

.pdf-thumbnail-name {
    display: block;
    width: 100%;
    padding: 0.4rem;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 2px;
    position: relative;
    top: -7px;
}

#selectedPdfName {
    display: block;
    width: 100%;
    overflow-wrap: anywhere;
    text-align: center;
}

@media (max-width: 767.98px) {
    .pdf-container,
    .pdf-main-viewer {
        height: 75vh;
        min-height: 500px;
    }

    .container.pdf-layout
    .pdf-viewer-section
    #pdfThumbsContainer {
        justify-content: center !important;
    }

    .pdf-thumbnail {
        width: 145px;
        min-width: 145px;
        max-width: 145px;
        flex-basis: 145px !important;
    }
}
