body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    height: 100%;
    overflow-y: auto;
}

.container {
    max-width: 1200px; /* Augmenté pour plus d'espace autour des éléments */
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin: 40px; /* Plus d'espace en haut et en bas */
}

h1 {
    font-size: 24px;
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 5%;
    flex-direction: column;
    align-items: center;
    z-index: 0;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.form-group {
    flex: 0 0 45%; /* Réduit pour augmenter l'espace entre les éléments */
    margin-bottom: 20px; /* Espacement vertical accru */
    position: relative;
}

#jsonListContainer input[type="text"] {
    width: 21em;
    text-align: left;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="checkbox"],
input[type="password"],
select,
button {
    width: calc(100% - 20px); /* Calculé pour ajouter de l'espace autour des éléments */
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    box-sizing: border-box; /* Inclut padding et bordure dans la largeur */
}

input[type="checkbox"] {
    width: auto; /* La case à cocher ne doit pas être étendue */
    margin-top: 5px; /* Alignement vertical avec le label */
}

#tabs-container {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
}

#response {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10%;
}

button {
    background-color: #0056b3;
    color: white;
    width: 13em;
    font-size: 16px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

button[type="submit"] {
    width: 15em;
}

button:hover {
    background-color: #003d82;
}

#error-message {
    margin: 20px;
    text-align: center;
    color: red;
}

textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    box-sizing: border-box; /* Inclut le padding et la bordure dans la largeur */
    width: calc(100% - 20px); /* S'il y a des styles de padding ou de margin spécifiques dans votre CSS */
    resize: vertical; /* Permet aux utilisateurs de redimensionner la zone verticalement */
}

input[name="login"],
input[name="pass"] {
    width: 300px;
}

form[hx-post="/api/login"] {
    display: flex;
    flex-wrap: wrap;
    margin: 5%;
    flex-direction: column;
    align-content: center;
    align-items: center;
}

@media (max-width: 768px) {
    .form-group {
        flex: 0 0 100%; /* Passe à une seule colonne sur petits écrans */
        margin-bottom: 15px; /* Ajustement de l'espacement */
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    input[type="checkbox"],
    input[type="password"],
    button {
        width: 100%; /* Les éléments s'étendent à la pleine largeur sur petits écrans */
    }
}

input[type="date"] {
    width: calc(100% - 50px);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid lightgrey;
    font-family: arial, serif;
}

#pagination {
    display: inline-block;
    margin: 20px 0;
    width: 100%;
    text-align: center;
}

#pagination button {
    background-color: #e9ecef;
    color: #007bff;
    border: 1px solid #dee2e6;
    padding: 5px 10px;
    margin: 0 2px;
    width: 39px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
    font-size: 14px;
    text-decoration: none;
}

#pagination button.active {
    background-color: #007bff;
    color: white;
}

#pagination button:not(.active):hover {
    background-color: #d0d4d9;
}

#pagination-choice {
    display: flex;
    justify-content: space-around;
    font-size: 12px;
    color: darkmagenta;
}

#response-table {
    width: 52em;
    text-align: center;
    border: 1px solid lightgrey;
    margin: 2em;
    border-radius: 20px;
    border-spacing: 0;
}

#response-table th {
    padding: 2%;
}

#response-table td {
    border-top: 1px solid lightgray;
    padding: 2%;
}

.details-row, .editable-row {
    background-color: #eeeeee;
}

.table.table-sm {
    width: 100%;
}

table.table-sm td {
    border-top: none !important;
}

td img {
    cursor: pointer;
}

div[role="dialog"] {
    position: relative;
    height: auto;
    width: 30em !important;
    top: -872.016px;
    left: 780px;
    background-color: inherit;
    padding: 2em;
    border: 1px solid lightgray;
    border-radius: 10px;
    text-align: center;
    z-index: 3;
    max-height: 25em;
    overflow-y: auto;
}

div[role="dialog"] button {
    width: 45%;
    margin: 2%;
}

#custom-overlay {
    display: none; /* Hidden by default */
    position: fixed; /* Cover the whole screen */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Dark background */
    z-index: 2; /* Ensure it sits above other content */
}

footer {
    text-align: center;
}

#search-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 42em;
    margin-top: 1em;
}

#search-bar {
    width: 25em;
    height: 3em;
    margin-top: 3em;
    margin-left: 1em;
}

#filters-container {
    text-align: center;
    display: flex;
    flex-flow: column wrap;
    align-items: center;
    border: 1px solid lightgrey;
    border-radius: 10px;
    padding: 1em;
}

#filters-container {
    display: none;
}

#apply-filters {
    width: 8em;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-items: center;
}

.f-val {
    width: 16em !important;
    margin-left: 1em;
}

#filter-icon {
    width: 20px;
    margin-bottom: -0.5em;
    padding: 0.3em;
    border-radius: 5px;
    cursor: pointer;
}

.filter-icon-active {
    background-color: #ffa94c;
    filter: invert(1);
}

.result-row td {
    width: 4em;
}

#del-select {
    background-color: #4ac462;
}

#arch-select {
    background-color: #4ac462;
}

#arch-select:hover {
    background-color: #4ac462;
}

#del-select:hover {
    background-color: #c03337;
}

.siret {
    width: 6em !important;
}

.inuav {
    width: 6em !important;
}

#response a:not(.leaflet-control-zoom-in):not(.leaflet-control-zoom-out) {
    margin-top: 2em;
}

i {
    cursor: pointer;
}

#password-field {
    position: relative;
}

#password-field i {
    position: absolute;
    top: 18px;
    right: 6px;
}

#map {
    height: 400px;
    display: none;
}

#dropdownBtn {
    cursor: pointer;
}

.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0.3em;
    background-color: #f9f9f9;
    min-width: 160px;
    max-height: 14em;
    overflow-y: scroll;
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.dropdown-content div {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    cursor: pointer;
}

.dropdown-content div:hover {
    background-color: #f1f1f1;
}

.selected {
    background-color: #f1f1f1;
}

.show {
    display: block;
}

#addEntryBtn {
    background-color: #d7d7d7;
}

#delete-btn, #erase-btn {
    background-color: #e33030;
}

#editables-form-btn {
    display: flex;
    width: 100%;
    justify-content: space-around;
}

#jsonListContainer div {
    display: flex;
    align-items: baseline;
    justify-content: space-around;
}

#jsonListContainer label {
    width: 10em;
    text-align: left;
}

#jsonListContainer p {
    width: 10em;
    text-align: left;
}

#criteres-container {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem;
    grid-auto-rows: 1fr;
    box-sizing: border-box;
}

.critere-card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    align-items: center;
    /* un peu d’espace et cadre sympa */
    padding: 0.75rem 1rem;
    border: 1px solid #dde2e6;
    border-radius: 8px;
    background-color: #fff;
    /* hauteur minimale homogène */
    min-height: 3rem;
    transition: transform 0.2s;
}

.critere-label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.critere-value {
    font-weight: 400;
    color: #555;
    overflow-wrap: anywhere;
}

label {
    display: block;
    margin-bottom: 5px;
}

#error-entry {
    color: #a50303;
}

#download-csv {
    color: black;
    background: none;
    border: none;
    box-shadow: none;
}

.ui-dialog[aria-describedby="transfert"] {
    width: 600px !important;
}

.ui-dialog[aria-describedby="individus-restants"] {
    width: 450px !important;
}

.ui-dialog[aria-describedby="createJsonList"] {
    width: 420px !important;
}

.ui-dialog[aria-describedby^="createJsonList-"] { /* Dialogue pour éditer les critères */
    max-height: 34em !important;
}

.ui-dialog[aria-describedby="criteresBox"] {
    width: 50em  !important;
    max-height: calc(100vh - 4em) !important;
    padding: 1.5em;
}


#transfert-block {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    flex-direction: row;
    justify-content: space-evenly;
}

.select-lot-trans {
    width: 125px;
}

#indiv-transfert-prov, #indiv-transfert-desti, #indiv-non-transferes {
    background-color: white;
    padding: 1em;
    border-radius: 1em;
    border: 1px solid lightgray;
    margin: 1em;
    width: 13em;
    max-height: 12em;
    overflow: hidden auto;
}

#found-indiv {
    background-color: white;
    padding: 1em;
    border-radius: 1em;
    border: 1px solid lightgray;
    margin: 1em;
    width: 18em;
    max-height: 12em;
    overflow: hidden auto;
}

.indiv-block {
    display: flex;
    width: 100%;
    justify-content: space-between;
    margin-left: -1em;
    padding: 0 1em;
}

.indiv-row {
    cursor: pointer;
}

.indiv-row:hover {
    background-color: #f4f4f4;
}

.indiv-row:active {
    background-color: #f4f4f4;
}

#kill-select {
    width: 4em;
    background-color: #ad1010;
}

#eleveur-pick, #lot-pick, #individu-pick {
    width: 11em;
}

#search-individu-histo {
    width: 11em;
}

#indiv-non-transferes {
    width: auto;
}

#histo-provenance {
    width: 38em;
    display: flex;
    justify-content: space-between;
}

.radio-select {
    display: flex;
    justify-content: space-between;
    width: 6em;
    margin: auto;
}

.sex-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#dialog-ajout-masse {
    width: 35em !important;
}

.race-title-div {
    display: flex;
    justify-content: space-between;
}
