/* BLOCS PRINCIPAUX */
.form-grid {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 24px; /* même que gutter de Masonry */
}

.form-block {
    width: 100%;
    max-width: 900px;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.form-block.large{
    max-width: 1200px!important;
}
.form-block.xlarge{
    max-width: 1500px!important;
}
.form-block > label{
    font-size: 1.5rem !important;
    font-weight: bold;
    color: dimgray;
}
form p{
    margin: 0px;
}
#main-container > label{
    font-size: 1.5rem !important;
    font-weight: bold;
    color: dimgray;
    margin-left: 1rem;
}
/* form popup up */
.floating-form {
    position: absolute;
    top: 100px;
    left: 50px;
    z-index: 1000;
    background: white;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    min-width: 800px;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    border: none;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #888;
}
.close-btn:hover {
    color: #000;
}
/* Style des erreurs Django Forms */
.errorlist {
    list-style-type: none;  /* Supprime les puces */
    padding: 0;
    color: #d9534f;  /* Rouge Bootstrap */
    font-size: 0.875rem;
}

.errorlist li {
    background-color: #f8d7da;  /* Fond rouge clair */
    color: #721c24;  /* Texte rouge foncé */
    border-left: 4px solid #d9534f;  /* Barre rouge sur le côté */
    padding: 5px 10px;
    margin-bottom: 5px;
    border-radius: 3px;
}
/* idem que alert-danger de bootstrap*/
.alert-error {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
  }
a{
    text-decoration: none;
  }
button:disabled,
a.disabled {
    pointer-events: auto !important;
    cursor: not-allowed !important;
    opacity: 0.6;
  }
fieldset{
    padding-left: 15px;
    padding-right: 15px;
    padding-bottom: 0px !important;
    margin-bottom: 5px !important;
    margin-top: 0px !important;
}
legend{
    color: #721c24;
    font-size: 1rem !important;
    margin-bottom: 0px !important;
}
label{
    color: #721c24;
    font-size: 0.9rem !important;
}
.table{
    margin-top: 0.5rem;
}
input:required:invalid,
textarea:required:invalid,
select:required:invalid,
select:required:invalid + .select2-container--default .select2-selection--single {
    border: 1px solid #cc0000 !important;  /* 🔹 Bordure rouge */
    background-color: #fff5f5 !important; /* 🔹 Fond légèrement rosé */
}

input:required:focus,
select:required:invalid:focus,
select:required:invalid:focus + .select2-container--default .select2-selection--single  {
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5); /* 🔹 Effet lumineux rouge */
}

.flatpickr-day.weekend {
    background-color: #f0f0f0 !important; /* Gris clair */
    color: #888 !important; /* Texte assombri */
}
.date{
    width: 120px;
    text-align: center;
}
/* SELECT2 */
.select2-results__option:nth-child(odd) {
    background-color: #eeeeee !important; /* Gris clair */
}

.select2-results__option:nth-child(even) {
    background-color: #ffffff !important; /* Blanc */
}
/* Style pour les select2 required invalid 
select:required:invalid,
select:required:invalid + .select2-container--default .select2-selection--single {
    border: 1px solid #cc0000 !important;
    background-color: #fff5f5 !important;
}*/

/* Ajoute un hover plus visible aussi avec les flêches */
.select2-results__option:hover,
.select2-container--default .select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted[aria-selected="true"],
.select2-container--default .select2-results__option:hover {
    background-color: #007bffc9 !important;
    color:#f0f0f0
}

.select2-results ,
.select2-container--default .select2-results > .select2-results__options {
	height: 400px !important;
	max-height: 400px !important;
}
  
/*select2 au style bootstrap*/
    /* Ajuster la hauteur et le padding du select2 pour correspondre à un input Bootstrap */
    .select2-container--default .select2-selection--single {
        height: calc(2.25rem + 2px) !important; /* 🔹 Même hauteur qu'un input Bootstrap */
        padding: .375rem .75rem !important;  /* 🔹 Même padding qu'un input Bootstrap */
        border-radius: .375rem !important;  /* 🔹 Même arrondi que Bootstrap */
        border: 1px solid #ced4da !important;  /* 🔹 Même bordure que Bootstrap */
    }

    /* Ajuster l'alignement du texte */
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: calc(2.25rem - 15px) !important; /* 🔹 Centrer le texte */
        padding-left: 0 !important;  /* 🔹 Supprimer le padding interne */
    }

    /* Ajuster l'icône du dropdown */
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: calc(2.25rem - 2px) !important;  /* 🔹 Même hauteur que le champ */
        top: 50% !important;
        transform: translateY(-50%);
    }


#popup-message {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050; /* S'assure qu'il est au-dessus des autres éléments */
    width: auto;
    max-width: 90%;
    padding: 10px 20px;
    text-align: center;
    border-radius: 5px;
    display: none; /* Caché par défaut */
    font-weight: bold;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

td.editable, 
td.ajaxupdate {
    cursor: pointer;
    position: relative;
}
td.editable:hover:after,
td.ajaxupdate:hover:after {
    content: "🖊️";
    font-size: 1em;
    position: absolute;
    top: 0px;
    left: -2px;
    pointer-events: none;
}
td.editable:hover,
td.ajaxupdate:hover {
    border-bottom: 1px solid black;
}
.description-content-truncated {
    max-height: 100px;
    overflow: hidden;
    position: relative;
}
input[readonly] {
  background-color: #e0e0e0;
  color: #666;
  cursor: not-allowed;
}
