/*
 * Styles pour les popins et pages popins
 * 
 * @since 17 juillet 2024
 * @author Cnam by OLJ & AS
 * @copyright DSI Cnam
*/

/**************************************************/
/* Overlay                                        */
/**************************************************/
.overlay {
    background: rgba(17, 48, 76, 0.6);
    bottom: 0;
    left: 0;
    opacity: 0;
    position: fixed;
    right: 0;
    top: 0;
    transition: opacity 100ms;
    visibility: hidden;
}
.overlay:target {
    opacity: 1;
    visibility: visible;
}

.page_popin {
    backdrop-filter: blur(5px);
    background: rgba(255, 255, 255, 0.6);
    bottom: 0;
    left: 0;
    opacity: 1;
    position: fixed;
    right: 0;
    top: 0;
    transition: opacity 100ms;
    visibility: visible;
}

/**************************************************/
/* Popin                                          */
/**************************************************/
.popin {
    background: #ffffff;
    color: #11304c;
    border: solid 1px #c1002a;
    border-radius: 8px;
    font-family: "Raleway", sans-serif;
    margin: 6em auto;
    position: relative;
    transition: all 200ms ease-in-out;
    text-align: justify;
    width: 75%;
}

.popin h2 {
    background-color: #c1002a;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    color: #ffffff;
    font-size: 1.5em;
    font-family: "Raleway", sans-serif;
    font-weight: bold;
    margin: 0;
    padding: 0.5em;
}
@media (max-width: 800px) {
    .popin {
        font-size: small;
    }
    .popin h2 {
        font-size: medium;
    }
}

/* Ajuster la Popin si elle est dans une page avec les menus */
.popin_adjustable {
    width: 72%;
}
@media (max-width: 1500px) {
    .popin_adjustable {
        width: 68%;
    }
}
@media (max-width: 1300px) {
    .popin_adjustable {
        width: 62%;
    }
}
@media (max-width: 1100px) {
    .popin_adjustable {
        width: 54%;
    }
}
@media (max-width: 900px) {
    .popin_adjustable {
        width: 40%;
    }
}
@media (max-width: 700px) {
    .popin_adjustable {
        top: 4em;
        width: 80%;
    }
}

.popin .close {
    color: #ffffff;
    font-size: 45px;
    font-weight: bold;
    position: absolute;
    right: 30px;
    text-decoration: none;
    transition: all 100ms;
    top: 0.2em;
}
.popin .close:hover {
    color: #11304c;
}

.popin .popin_description {
    align-items: center;
    color: #11304c;
    display: flex;
    padding: 1em;
    padding-right: 3em;
}
.popin .popin_description img {
    margin-right: 1em;
}

.popin .popin_content {
    color: #415970;
    display: flex;
    flex-direction: column;
    max-height: max-content;
    min-height: 5em;
    overflow-y: auto;
    padding: 0.8em;
    text-align: center;
}

/* Tailles maximales en hauteur */
@media (min-height: 830px) and (max-height: 1500px) {
    .popin .popin_content {
        height: auto;
        max-height: 60vh;
    }
}
@media (min-height: 450px) and (max-height: 830px) {
    .popin .popin_content {
        height: auto;
        max-height: 45vh;
    }
}
@media (min-height: 10px) and (max-height: 450px) {
    .popin .popin_content {
        height: auto;
        max-height: 0vh;
    }
}

.popin_texte {
    padding: 0 1em;
    text-align: justify;
}

/* Les boutons dans les popins */
form.form_display {
    display: contents;
}
.popin_double_button_display {
    align-items: center;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    margin-top: 1em;
    width: 99%;
}
@media (max-width: 800px) {
    .popin_double_button_display {
        flex-direction: column;
    }
    .popin_double_button_display input {
        width: 100%;
    }
}

/*Les couleurs de l'input pour la popin est par défaut le bleu de la class "information". 
  Puisqu'il y a des appels aux classes de couleurs, cela sert principalement en cas d'oubli, puique la couleur "information" est la plus utilisée et la plus neutre. */
.popin input {
    background-color: #dde6f7;
    border-color: #93c9ff;
    border-radius: 5px;
    border-style: solid;
    border-width: 2px;
    color: #3366cc;
    cursor: pointer;
    font-size: 0.9em;
    height: 3em;
    margin-top: 1em;
    padding: 0.1em 2em;
    text-decoration: none;
    /* Effet de transition lors du hover sur bouton */
    transition: all 0.5s ease-in-out;
    -moz-transition: all 0.5s ease-in-out;
    -webkit-transition: all 0.5s ease-in-out;
    -ms-transition: all 0.5s ease-in-out;
}
.popin input:hover {
    background-color: #3366cc;
    border-color: #93c9ff;
    border-radius: 8px;
    border-style: solid;
    border-width: 2px;
    color: #ffffff;
    text-align: center;
}

/**************************************************/
/* Popin couleurs                                 */
/**************************************************/
/*Couleur Information : Bleue*/
.popin .information, .popin .information_texte {
    background-color: #dde6f7;
    border-color: #93c9ff;
    color: #3366cc;
}
.popin .information:hover {
    background-color: #3366cc;
    border-color: #93c9ff;
}

/*Couleur Correct/Valide : Vert*/
.popin .valide, .popin .valide_texte {
    background-color: #dff4df;
    border-color: #80e180;
    color: #339933;
}
.popin .valide:hover {
    background-color: #339933;
    border-color: #80e180;
}

/*Couleur Avertissement : Orange*/
.popin .avertissement, .popin .avertissement_texte {
    background-color: #ffeed5;
    border-color: #ffcc00;
    color: #ff9900;
}
.popin .avertissement:hover {
    background-color: #ff9900;
    border-color: #ffcc00;
}

/*Couleur Erreur/erreur : Rouge*/
.popin .erreur, .popin .erreur_texte {
    background-color: #ffd5de;
    border-color: #ff9396;
    color: #c50d35;
}
.popin .erreur:hover {
    background-color: #c50d35;
    border-color: #ff9396;
}
