/* Import de la police Academy Sans */
@import url('fonts.css');

/* Application de la police Academy Sans à tout le site */
body,
html {
    font-family: 'Academy Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Application à tous les éléments texte */
*,
input,
textarea,
select,
button {
    font-family: 'Academy Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Les polices d'icones ne doivent pas etre ecrasees */
.fa,
.fa::before,
.fa::after {
    font-family: FontAwesome !important;
}

.bi::before {
    font-family: bootstrap-icons !important;
}


.navbar-nav .nav-link {
    padding-top: calc(0.5rem + 5px);
    padding-bottom: calc(0.5rem - 5px);
}

/* Styles utilitaires centralises */
.document-link {
    cursor: pointer;
}

.note-input {
    max-width: 100px;
}

.moyenne-display {
    font-size: 1.5rem;
    font-weight: bold;
}

.candidats-list-scroll {
    max-height: 70vh;
    overflow-y: auto;
}

.candidats-list .list-group-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.candidats-list .list-group-item:hover:not(.active) {
    background-color: #f8f9fa;
}

.candidats-list .list-group-item.active {
    font-weight: bold;
}

.sort-btn.active {
    background-color: #0d6efd !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}

.sort-btn:hover:not(.active) {
    background-color: #f8f9fa !important;
}

.sort-header {
    opacity: 0.7;
    transition: all 0.2s;
    display: inline-block;
}

.sort-header:hover {
    opacity: 1;
    color: #0d6efd !important;
    transform: scale(1.2);
}

.sort-header.active {
    color: #0d6efd !important;
    opacity: 1;
}

.sort-header-inline-button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 4px;
    color: #6c757d;
    font-size: 0.9rem;
}

.sort-header-link {
    text-decoration: none;
    vertical-align: middle;
}

.sort-header-link .sort-header-icon {
    font-size: 0.75rem;
}

.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #0d6efd;
    background-color: #f8f9fa;
}

.upload-area.dragover {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

#candidatsTable thead th {
    background-color: #f8f9fa;
    font-weight: 600;
}

#candidatsTable thead tr:first-child th {
    border-bottom: 2px solid #dee2e6;
}

#candidatsTable thead tr:first-child th[colspan] {
    text-align: center;
    font-weight: 700;
}

/* Utilitaires de presentation pour remplacer les styles inline */
.th-nowrap {
    white-space: nowrap;
}

.text-center-cell {
    text-align: center;
}

.border-left-divider {
    border-left: 2px solid #dee2e6;
}

.align-middle-cell {
    vertical-align: middle;
}

.jury-comment-cell {
    text-align: left !important;
    vertical-align: top !important;
    white-space: pre-wrap;
}

.jury-status-item {
    min-width: 260px;
    max-width: 100%;
}

.jury-status-item .text-truncate {
    max-width: 260px;
}

.jury-phase-inline-wrap {
    display: flex;
    flex-direction: row;
    gap: 0.35rem;
}

.jury-phase-inline-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.jury-phase-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    line-height: 1.1;
}

.jury-phase-chip-name {
    background: transparent;
    color: #212529;
    font-weight: 600;
    font-size: 2rem; /* proche de la taille d'un h2 Bootstrap */
    line-height: 1.2;
    padding: 0;
    border-radius: 0;
}

.jury-phase-chip-count {
    background: #cfe2ff;
    color: #084298;
}

.jury-phase-chip-closed {
    background: #e2e3e5;
    color: #41464b;
}

.jury-phase-close-btn {
    padding-top: 0.1rem;
    padding-bottom: 0.1rem;
}

@media (max-width: 768px) {
    .jury-phase-inline-wrap {
        width: 100%;
        flex-direction: column;
    }

    .jury-phase-inline-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

.admin-jury-card-header {
    min-height: 72px;
}

.admin-jury-card-title-wrap {
    min-width: 0;
    flex: 1 1 auto;
}

.admin-jury-card-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cursor-pointer {
    cursor: pointer;
}

.display-none {
    display: none !important;
}

.media-view-slot {
    min-width: 86px;
    display: inline-flex;
    justify-content: center;
}

.media-view-placeholder {
    color: #6c757d;
}

.modal-body-80vh {
    height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.iframe-full {
    width: 100%;
    height: 100%;
    border: none;
}

/* Visualiseur PDF (PDF.js) */
.pdfjs-toolbar {
    /* Ancrée en bas (hors du flux), ne doit pas suivre le scroll */
    position: absolute;
    bottom: 0;
    z-index: 3;
    background: #212529; /* gris foncé (Bootstrap dark) */
    color: #fff;
    width: fit-content; /* évite la pleine largeur */
    max-width: calc(100% - 1rem);
    margin: 0 auto 0 auto;
    border-color: rgba(255, 255, 255, 0.15) !important;
    left: 50%;
    transform: translateX(-50%);
}

#pdfjsPageInfo {
    color: rgba(255, 255, 255, 0.9);
}

.pdfjs-toolbar .btn-outline-secondary,
.pdfjs-toolbar .btn-outline-info {
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.pdfjs-toolbar .btn-outline-secondary:hover,
.pdfjs-toolbar .btn-outline-info:hover {
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

#pdfjsCanvas {
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #fff;
}

/* Viewer PDF.js dédié : la toolbar ne doit pas suivre le scroll */
.pdfjs-modal-body {
    display: flex;
    flex-direction: column;
    overflow: hidden; /* empêche la toolbar de scroller */
    position: relative; /* support pour positionnement absolu de la toolbar */
}

/* Empêche le scroll sur la modale externe :
   le scroll doit se faire uniquement dans .pdfjs-scroll-area. */
.pdfjs-modal-body.modal-body-80vh {
    overflow-y: hidden !important;
    overflow-x: hidden !important;
}

/* Cas générique (ordre des classes) */
.modal-body-80vh.pdfjs-modal-body {
    overflow-y: hidden !important;
    overflow-x: hidden !important;
}

.pdfjs-scroll-area {
    flex: 1;
    min-height: 0; /* important pour flex overflow */
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 72px; /* évite que la toolbar absolue recouvre le canvas */
}

/* Admin : éviter que la scroll de modal-body fasse bouger la toolbar */
#modalDocument .modal-body-80vh {
    overflow-y: hidden !important;
    overflow-x: hidden !important;
}

.navbar-brand-link {
    text-decoration: none;
    gap: 0.5rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.navbar-brand-logo {
    height: 32px;
    width: auto;
    filter: invert(1);
    margin-right: 0;
    display: block;
}

.navbar-brand-text {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    display: block;
    position: relative;
    top: 5px;
}

.icon-4rem {
    font-size: 4rem;
}

/* Liste filtrable des enseignants (modales jury admin) */
.jury-enseignants-picker__list {
    max-height: min(50vh, 320px);
    overflow-y: auto;
}

.jury-enseignants-picker__item:last-child {
    border-bottom: 0 !important;
}

/* Harmonisation : rendre plus visible la plus petite moyenne (brute vs harmonisée) */
.badge-moyenne-lowest {
    /* On conserve la teinte Bootstrap d'origine via la classe bg-* (success/warning/danger/primary/...) */
    /* On ajoute juste un halo/contour pour repérer facilement la valeur la plus basse. */
    font-weight: 700 !important;
    position: relative;
    z-index: 0;
}

.badge-moyenne-lowest::after {
    content: '';
    position: absolute;
    inset: 0;
    /* Overlay translucide pour augmenter la visibilité sans changer la teinte d'origine */
    background: rgba(255, 255, 255, 0.28);
    border-radius: inherit;
    pointer-events: none;
    z-index: -1; /* place l'overlay derrière le texte */
}
