.error {
  color: red;
  font-weight: bold;
}

#errorMessage {
  margin-top: 2em;
  width: auto;
  text-align: center;
}
.invisible {
  display: none;
}
.visible {
  display: block;
}
/* permet placement footer */
body,
html {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.content {
  flex: 1;
}
/* */
a {
  text-decoration: none;
}
h2 {
  margin-bottom: 1em;
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: #000; /* Couleur du texte */
}

.invisible {
  display: none;
}
h4 {
  padding: 1em;
}

/*Ajout d'un pseudo-élément pour créer l'effet de soulignement */
h2:before {
  content: "";
  position: absolute;
  width: 0;
  height: 2px; /* Hauteur du soulignement */
  bottom: 0;
  left: 0;
  background-color: #000; /* Couleur du soulignement */
  animation: underline 0.5s ease forwards; /* Utilisation de l'animation avec keyframes */
}
.bold-text {
  font-weight: bold;
}
.main-container {
  width: 90vw;
  text-align: center;
  margin: auto;
}

/* Définition des keyframes pour l'animation */
@keyframes underline {
  to {
    width: 100%;
  }
}

.main-logo {
  height: 3em;
  width: 3em;
  margin-right: 1em;
}
.terra-text {
  font-weight: bold;
  color: #064606;
}
.main {
  margin: 2em 0.5em;
}
/* Home Page*/
.main-content-home section div {
  margin-bottom: 2em;
  border: 1px solid rgba(6, 70, 6, 0.3);
  border-radius: 1em;
  padding: 2em;
}
.intro-text {
  font-size: 1.2em; /* Taille de police plus grande */
  font-weight: bold; /* Texte en gras */
  color: #333; /* Couleur du texte */
}
.multiple-line-img {
  width: 100%;
  display: flex;
  justify-content: center;
}
.logo-text-home {
  max-width: 5em;
  height: auto;
}
.highlight {
  color: #006600; /* Couleur de mise en surbrillance */
  font-size: 1.5em;
}
.home-examples::before {
  content: "";
  display: block;
  border-top: 1px solid #ccc; /* Trait de séparation */
  margin-top: 20px; /* Marge supérieure pour l'espace */
  margin-bottom: 20px; /* Marge inférieure pour l'espace */
}
.example-response {
  font-style: italic; /* Texte en italique */
  color: #064606; /* Couleur du texte */
  background-color: #f4f4f4; /* Couleur de fond */
  padding: 10px; /* Espacement intérieur */
  border-radius: 5px; /* Bord arrondi */
  display: inline-block;
}
/**/
.title-and-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-right: 7em;
}
.my-messages-btn span {
  background-color: blue;
  color: wheat;
  padding: 1em;
  border-radius: 1em;
}
.my-messages-btn {
  background-color: rgb(223, 180, 99);
}
.mes-annonces-btn {
  background-color: rgb(87, 189, 87);
}
nav {
  text-align: center;
}
.navbar-nav {
  text-align: center;
  border-bottom: 1px solid #ccc; /* couleur et style de la barre */
}
.nav-btns {
  display: flex;
  flex-direction: column;
}
.nav-btns a {
  margin-top: 1em !important;
  margin-right: 1em;
}
.nav-item {
  margin-right: 0;
}
.fa-user {
  font-size: 1.5em;
}
.btn-user:hover {
  color: rgb(213, 232, 208);
  background-color: transparent;
}

.title-and-logo a {
  margin-right: 0 !important;
}
form {
  width: 80%;
  margin: auto;
}
.post-ad-main {
  text-align: center;
  margin: auto;
}
.department-choice,
.city-choice {
  display: flex;
  width: 80vw;
  flex-direction: column;
  align-content: center;
  margin: auto;
}
.list-ads {
  width: 90%;
  list-style-type: none;
  margin: 0;
  padding: 0;
}
.list-ads a {
  text-decoration: none;
}
.city-name {
  font-weight: bold;
}
.each-ad {
  display: grid;
  grid-template-columns: 1fr; /* Deux colonnes pour chaque élément .each-ad */
  grid-template-rows: (1fr, 1fr);
  gap: 10px;
  width: 100%;
  padding: 1em;
  margin: 1em;
  border: 1px solid black;
  background-color: rgba(35, 35, 74, 0.2);
  border-radius: 2em;
  align-items: flex-start;
}
.each-ad div {
  height: 50%;
}

.each-ad img {
  width: 100%;
  object-fit: cover;
}
.status,
.type,
.transaction {
  display: inline;
}
.form-filter-ads {
  margin: auto;
  width: 80%;
  display: flex;
  flex-direction: column;
  margin-bottom: 2em;
}
/* .form-filter-ads div */
.block-department,
.block-price,
.block-transaction,
.block-type {
  text-align: center;
  display: flex;
  flex-direction: column;
  margin-top: 1em;
}
.form-filter-ads button,
.form-filter-ads div {
  margin-top: 1em;
}
.form-filter-ads button {
  width: 10em;
  margin: 1em auto;
}
.text-container {
  max-height: 50%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.price-input {
  width: 15em;
}
.img-ad {
  width: 10em;
  height: 10em;
  cursor: pointer;
}
.img-container img {
  height: 200px;
}
.each-user-ad {
  width: 80%;
  margin: auto;
  text-align: center;
  border: 1px solid black;
  border-radius: 1em;
  margin-bottom: 1em;
}
.buttons-dl-up .btn-delete-ad,
.buttons-dl-up .btn-success {
  display: block;

  margin: 1em auto;
}
.by-id {
  margin: auto;
  text-align: center;
}
.list-existing-photos {
  text-align: center;
}
.existing-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  width: 70%;
}

.buttons-edit-ad {
  display: flex;
  flex-direction: column;
  text-align: center;
  margin-top: 1em;
}
.buttons-edit-ad button {
  margin-top: 1em;
}
.btn-add-photo,
.btn-delete-photo,
.btn-update-ad {
  width: 12em;
  margin: auto;
  margin-bottom: 1em;
}
.registration-form div {
  width: 80%;
  margin: auto;
}
.registration-form button {
  border: 1px solid black;
  color: wheat;
}
.login-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 80%;
  height: 30vh;
  margin: auto;
}
.block-password,
.block-email {
  display: flex;
  flex-direction: column;
  height: 4em;
  justify-content: space-around;
  align-items: center;
  margin: auto;
}
.block-password input,
.block-email input {
  height: 50%;
}
.btns-mailbox {
  display: flex;
  flex-direction: column;
  width: 15em;
  margin: auto;
}
.btns-mailbox > * {
  margin-bottom: 0.5em;
}
.btn-send-message a {
  text-decoration: none;
}
.each-message-conv {
  width: 80vw;
  margin: auto;
  margin-bottom: 1em;
}
.btn-reduce-text {
  width: 100%;
}
#message_text {
  height: 10em;
}
.received-message {
  background-color: #f0f0f0;
  border: 1px solid blue;
}
.sent-message {
  background-color: #add8e6;
  border: 1px solid blue;
}
.btn-send-message {
  margin-top: 1em;
}

#popup {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}
#popupImageContainer {
  text-align: center;
}

.popup-image {
 width: 80%;
 height: auto;
  margin: auto;
}

.arrow {
  color: white;
  font-size: 24px;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

#prevArrow {
  left: 70px;
}

#nextArrow {
  right: 70px;
}

.footer {
  margin-top: 1em;
  padding: 2em;
  width: 100%;
  display: flex;
  justify-content: center;
}
.footer > a {
  margin-right: 2em;
  color: whitesmoke;
}
@media screen and (min-width: 992px) {
  .main {
    margin: 2em;
  }
  .navbar-nav {
    text-align: initial;
    border-bottom: none;
  }
  .nav-btns {
    flex-direction: row;
    justify-content: flex-end;
  }
  .nav-btns a {
    width: 50%;
    margin-top: auto;
    width: auto;
  }

  form {
    width: 50%;
  }
  .department-choice,
  .city-choice {
    display: flex;
    width: 50%;
    flex-direction: column;
    justify-content: space-between;
  }
  #departments,
  #city-search {
    width: 20em;
    margin: auto;
  }
  .login-form {
    display: flex;
    flex-direction: row;
    width: 60vw;
    height: 6em;
    justify-content: center;
    align-items: center;
  }
  .block-password,
  .block-email {
    justify-content: space-evenly;
    width: 40%;
    flex-direction: row;
  }
  .block-password input,
  .block-email input {
    width: 60%;
  }
  .list-ads {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-gap: 20px 25px;
    padding: 20px;
  }

  .each-ad {
    height: 450px;
    overflow: hidden;
    text-overflow: ellipsis; /* Affiche "..." pour indiquer du contenu caché */
  }
  .each-ad img {
    max-height: 200px;
  }
  .popup-image {
    max-width: 50%;
  }

  .each-user-ad {
    width: 50%;
  }

  .list-existing-photos {
    width: 80%;
    display: flex;
    justify-content: space-evenly;
    margin: auto;
  }
  .form-filter-ads {
    width: 50%;
  }
  .registration-form div {
    width: 50%;
  }
  .each-message-conv {
    width: 60vw;
  }
  .received-message {
    width: 50%;
    margin: auto;
  }
  .sent-message {
    width: 50%;
    margin: auto;
  }
}
