/* =========================================
   MODALS.CSS — Toutes les modales
   ========================================= */

/* === Modal base === */
.modal-dialog { }

.modal-fullscreen {
    max-width: 100vw;
}

.modal-title {
    word-break: break-all;
}

.modal .modal-header,
.modal .modal-body,
.modal .modal-footer {
    padding-left: 35px;
    padding-right: 35px;
    background-color: white;
}

.modal .modal-header {
    padding-top: 30px;
}

.modal .large .modal-header {
    padding-top: 40px;
}

.modal .modal-body {
    padding-bottom: 0px;
}

.modal .modal-header {
    border-bottom: none;
}

/* BS5 : .modal-header est display:flex, le conteneur interne doit prendre toute la largeur */
.modal .modal-header > .container {
    flex: 1;
}

/* Espacement entre les boutons du header */
.modal .modal-header .btn + .btn,
.modal .modal-header .btn + .dropdown,
.modal .modal-header .dropdown + .btn {
    margin-left: 0.5rem;
}

.modal .modal-header .btn-close-modal {
    font-size: 26px;
}

.modal .large .modal-header .btn-close-modal {
    margin-top: 0px;
}

.modal .modal-header .modal-fil-ariane {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.modal .modal-title {
    margin-bottom: 0;
}

.modal .modal-subtitle {
    font-size: 14px;
    font-weight: 600;
    margin-top: 5px;
}

.modal .modal-body .modal-category {
    margin-top: 11px;
}

.modal .modal-body .modal-category .modal-category-title {
    background-color: var(--neutral-20-color);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 10px;
}

.modal .modal-body .modal-category .modal-category-content {
    padding: 20px 20px 10px;
}

.modal .modal-body .modal-category .modal-category-content .row {
    margin-bottom: 10px;
}

.modal .modal-body .modal-category .modal-category-content .title {
    font-weight: 600;
}

.modal .modal-body .modal-category .modal-category-content .information {
    text-align: right;
}

.modal .modal-body .modal-category .modal-category-content .description {
    opacity: 0.5;
    margin-top: -7px;
    margin-bottom: 10px;
    font-size: 13.33px;
    font-weight: 600;
}

.modal .modal-body .modal-category .modal-category-content .textarea {
    background-color: var(--neutral-20-color);
    padding: 14px 18px;
    font-size: 13.33px;
    font-weight: 500;
    border-radius: 7px;
    margin-bottom: 12px;
}

/* Switches dans les modales : flex pour aligner à droite sans débordement */
.modal .modal-category-content .form-check.form-switch {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 0;
    margin-bottom: 0;
}

/* Annuler le margin-left négatif BS5 qui cause le débordement */
.modal .modal-category-content .form-check.form-switch .form-check-input {
    margin-left: 0;
    margin-right: 0;
    float: none;
}

.modal hr {
    margin-bottom: 14px;
    margin-top: 6px;
    height: 0.5px;
    color: var(--neutral-30-color);
}

.modal .modal-body {
    overflow: visible;
    padding-top: 38px;
}

.modal .modal-infos .content {
    font-weight: 500;
    margin-left: 5px;
    text-align: right;
}

.modal .modal-body .modal-content {
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 40px;
    height: auto;
}

.modal .modal-category .modal-subcategory .modal-subcategory-title {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -0.5px;
    opacity: 0.65;
    margin-bottom: 17px;
    margin-top: 5px;
}

.modal .modal-body .modal-content .main-content {
    font-weight: 600;
}

.modal .modal-body .modal-content .secondary-content {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.4);
}

.modal .modal-body .modal-content table tr td,
.modal .modal-body .modal-content table tr th {
    overflow-wrap: break-word;
}

.modal .modal-footer {
    border-top: none;
}

.modal .modal-footer a {
    margin: auto;
    font-weight: 600;
}

.modal .dropdown-menu.dropdown-more-informations {
    width: 300px;
    font-size: 13px;
    padding: 20px 10px 10px;
}

.modal .dropdown-menu.dropdown-more-informations .row {
    margin-bottom: 10px;
}

.modal .dropdown-menu.dropdown-more-informations .title {
    font-weight: 600;
    font-size: 16px;
}

.modal .dropdown-menu.dropdown-more-informations .information {
    font-weight: 400;
}

.modal .modal-return-btn {
    -ms-flex: 0 0 25px;
    flex: 0 0 25px;
}

/* === SubModal === */
.modal.sub-modal-large .modal-dialog {
    max-width: 900px;
}

.modal.sub-modal .modal-header {
    border-bottom: 1px solid var(--neutral-40-color);
    padding: 23px 20px;
}

.modal.sub-modal .modal-main-title {
    margin-bottom: 0;
}

.modal.sub-modal .btn-close {
    margin-top: -3px;
}

.modal.sub-modal .modal-body {
    overflow: visible;
    padding-top: 30px;
    padding-bottom: 20px;
    padding-left: 20px;
    padding-right: 20px;
}

.modal.sub-modal .form-container {
    margin-bottom: 19px;
}

.modal.sub-modal .form-label {
    margin-bottom: 0px;
}

.modal.sub-modal .form-description {
    margin-bottom: 10px;
}

.modal.sub-modal .modal-footer {
    background-color: var(--neutral-20-color);
    padding: 11px 16px;
}

/* === Status Modal === */
.modal.status-modal .modal-dialog {
    max-width: 500px;
}
.modal.status-modal .modal-header {
    padding: 45px 30px 10px;
}
.modal.status-modal .modal-body {
    padding: 5px 20px 26px;
}

/* === Site Modal === */
.modal .site-map {
    width: 100%;
    object-fit: contain;
}

.plan-container {
    overflow: hidden;
}

.modal.site-modal .modal-header {
    padding-top: 0px;
}

/* === Modal Tabs === */
.modal ul.nav.nav-pills {
    background-color: var(--neutral-30-color);
    padding: 4px;
    border-radius: 5px;
    display: flex;
    align-items: stretch;
}

.modal li.nav-item {
    width: 60%;
    display: flex;
}
.modal li.nav-item:first-child {
    width: 40%;
}
.modal li.nav-item button.nav-link {
    width: 100%;
    height: 100%;
    border: none !important;
    background-color: transparent;
    color: var(--neutral-70-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal li.nav-item button.nav-link.active,
.modal li.nav-item button.nav-link.active:hover .modal li.nav-item button.nav-link.active:focus {
    background-color: white !important;
    color: var(--neutral-900-color) !important;
}

/* === User Modal === */
.user-modal .modal-header {
    background-color: var(--neutral-100-color);
    height: 132px;
    border-radius: 15px;
    margin: 15px;
    padding-top: 20px;
    align-items: flex-start;
    z-index: 3;
}

.user-modal .modal-header .profile-picture {
    margin-top: -19px;
    margin-left: auto;
    margin-right: auto;
    width: 144px;
    height: 144px;
    border: 5px solid white;
    border-radius: 50%;
    object-fit: cover;
}

.user-modal .user-informations {
    margin-bottom: 30px;
}

.modal .user-modal .modal-body .modal-category .modal-category-content {
    padding-top: 10px;
    padding-bottom: 10px;
}

.modal .user-modal .modal-body .modal-category .modal-category-content.presence-container {
    padding: 10px;
}

/* === Modal header background (profile) === */
.modal-header {
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

/* === Modal Relance === */
.modal-bodyRelance {
    padding-bottom: 0px !important;
    padding-left: 0px !important;
    padding-right: 0px !important;
}

/* === z-index overrides (AdminTY) === */
.modal {
    z-index: 1055 !important;
}
.modal-backdrop {
    z-index: 1050 !important;
}

/* === Modale affectation : hauteur fixe dans le viewport === */
#affectation-modale .modal-dialog {
    max-height: 90vh;
    height: 90vh;
}
#affectation-modale .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#affectation-modale .modal-content > .d-flex {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sub-modales empilées — z-index géré dynamiquement par page_init_controller.js (setupModalStacking) */

/* === Modal overflow === */
.modal { overflow-y: auto; }

/* === Side modal (custom.css) === */
.side-modal {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
    width: 500px;
}

/* Slide-in depuis la droite (override Bootstrap translate(-50px)) */
.modal.fade .modal-dialog.side-modal {
    transform: translateX(100%);
    transition: transform 0.35s ease;
}

.modal.show .modal-dialog.side-modal {
    transform: translateX(0);
}

.side-modal.large {
    width: 63vw;
}

.side-modal.extra-large {
    width: 75vw;
}

.other-side-modal {
    width: 500px;
    position: absolute;
    left: 0;
}

/* === Referentiel modal (custom.css) === */
.referentiel-modal .modal-header,
.referentiel-modal .modal-body,
.referentiel-modal .modal-footer {
    padding-left: 35px;
    padding-right: 35px;
    background-color: white;
}

.referentiel-modal .modal-header {
    padding-top: 30px;
}

.referentiel-modal .modal-header,
.referentiel-modal .modal-body {
    padding-bottom: 0px;
}

.referentiel-modal .modal-title {
    font-weight: 700;
    font-size: 24px;
    line-height: 29px;
}

.referentiel-modal .modal-header {
    border-bottom: none;
}

.referentiel-modal .modal-header .btn-close-modal {
    margin-top: 21px;
    font-size: 26px;
}

.referentiel-modal .modal-header .modal-fil-ariane {
    color: #2667ff;
    font-weight: 600;
    margin-bottom: 5px;
}

.referentiel-modal .modal-subtitle {
    font-size: 14px;
    font-weight: 600;
    margin-top: 5px;
}

.referentiel-modal .modal-body .modal-category {
    margin-top: 11px;
}

.referentiel-modal .modal-body .modal-category .modal-category-title {
    background-color: rgba(0, 0, 0, 0.07);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
}

.referentiel-modal .modal-body .modal-category .modal-category-content {
    padding: 20px 20px 10px;
}

.referentiel-modal .modal-body .modal-category .modal-category-content .row {
    margin-bottom: 10px;
}

.referentiel-modal .modal-body .modal-category .modal-category-content .title {
    font-weight: 600;
}

.referentiel-modal .modal-body .modal-category .modal-category-content .info {
    text-align: right;
    color: var(--dark-color) !important;
}

.referentiel-modal .modal-body .modal-category .modal-category-content .description {
    opacity: 0.5;
    margin-top: -7px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
}

.referentiel-modal .modal-body .modal-category .modal-category-content .textarea {
    background-color: rgba(0, 0, 0, 0.03);
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 7px;
    margin-top: -10px;
    margin-bottom: 12px;
}

.referentiel-modal hr {
    margin-bottom: 30px;
    margin-top: 15px;
    height: 0.5px;
    color: rgba(0, 0, 0, 0.3);
}

.referentiel-modal .modal-body {
    overflow: visible;
    padding-top: 38px;
}

.referentiel-modal .modal-infos .content {
    font-weight: 500;
    margin-left: 5px;
    text-align: right;
}

.referentiel-modal .modal-body .modal-content {
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 40px;
    height: auto;
}

.referentiel-modal .modal-category .modal-subcategory .modal-subcategory-title {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -0.5px;
    opacity: 0.65;
    margin-bottom: 17px;
    margin-top: 5px;
}

.referentiel-modal .modal-body .modal-content .main-content {
    font-weight: 600;
}

.referentiel-modal .modal-body .modal-content .secondary-content {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.4);
}

.referentiel-modal .modal-body .modal-content table tr td,
.referentiel-modal .modal-body .modal-content table tr th {
    overflow-wrap: break-word;
}

.referentiel-modal .modal-footer {
    border-top: none;
}

.referentiel-modal .modal-footer a {
    margin: auto;
    font-weight: 600;
    margin-bottom: 20px;
}

.referentiel-modal .dropdown-menu.dropdown-more-informations {
    width: 300px;
    font-size: 13px;
    padding: 20px 10px 10px;
}

.referentiel-modal .dropdown-menu.dropdown-more-informations .row {
    margin-bottom: 10px;
}

.referentiel-modal .dropdown-menu.dropdown-more-informations .title,
#dm-modal-general .dropdown-menu.dropdown-more-informations .title {
    font-weight: 600;
    font-size: 16px;
}

/* Neutralise le bleu de l'utilitaire global `.info` dans le dropdown d'infos (bouton « i »).
   La modale Donnée Métier n'ayant pas la classe .referentiel-modal, on l'ajoute explicitement. */
.referentiel-modal .dropdown-menu.dropdown-more-informations .info,
#dm-modal-general .dropdown-menu.dropdown-more-informations .info {
    font-weight: 400;
    color: var(--dark-color) !important;
}

/* Site Modal (referentiel) */
.referentiel-modal .site-map {
    width: 100%;
}

.referentiel-modal .degrade {
    background: rgb(255, 255, 255);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 90%);
    width: 100%;
    height: 75px;
    position: absolute;
    top: 106px;
}

.referentiel-modal.site-modal .modal-header {
    padding-top: 0px;
}

/* === Edit modal (custom.css) === */
.edit-modal {
    top: -50px;
}

.modal-sm {
    max-width: 450px;
}

.edit-modal .modal-header {
    display: inline-block;
    padding: 25px 20px 0px;
}

.edit-modal .modal-header .btn-close {
    position: absolute;
    top: 25px;
    right: 25px;
}

.edit-modal .modal-main-title {
    font-weight: 800;
    font-size: 24px;
}

.edit-modal .modal-body {
    padding-top: 0;
    padding-bottom: 0;
}

.edit-modal .modal-footer {
    padding-top: 10px;
    padding-bottom: 10px;
    background-color: rgba(0, 0, 0, 0.03);
}
