/* Styles for the general layout */

body {
  background-color: #ffffff;
  font-family: "Lato", sans-serif;
}

header {
  text-align: center;
}

.title {
  width: 100%;
  font-size: 4em;
  font-weight: 1000;
  display: flex;
  justify-content: center;
  font-family: "Montserrat", serif;
}

#title2 {
  color: #4d047e;
}

main {
  min-height: 80vh;
}

footer {
  padding: 30px;
  margin-top : 30px;
}

/* MENU */

#menu {
  width: 100%;
  display: flex;
  flex-direction: row;
  margin: 20px 0;
}

.menu {
  list-style-type: none;
  display: flex;
  flex-direction: row;
  width: 100%;
  min-width: 500px;
  justify-content: space-evenly;
  background-color: #4d047e;
  padding : 10px;
  border : 1px solid #4d047e;
  border-radius: 10px;
  margin-right : 40px;
}

.menu li {
  cursor: pointer;
  font-size : 2em;
  font-weight: 600;
  color : white;
  font-family: "Roboto", serif;
}



.menu li:hover {
  color: #23527c;
}

.account {
  list-style-type: none;
  display: flex;
  flex-direction: row;
  width: 100%;
  justify-content: center;
  align-items: center;
}

.account li {
  color: black;
  font-size: 1em;
  margin: 0 10px;
  cursor: pointer;
}

#register-main {
  border: #23527c 7px solid;
  border-radius: 15px;
  background-color: #23527c;
  color: white;
}

#register-main:hover {
  border: black 7px solid;
  background-color: black;
}

.connected {
  display: flex;
  flex-direction: row;
  list-style-type: none;
  justify-content: center;
  height: 100%;
  align-items: center;
  width: 100%;
}

.connected li {
  margin: 0 10px;
  cursor: pointer;
}

#logout {
  border: #23527c 7px solid;
  border-radius: 15px;
  background-color: #23527c;
  color: white;
}

.disconnected {
  text-align: center;
  margin: 20px auto;
  margin-top: 0px;
}

.menu-mobile {
  display: none;
}

/* HOME */
.home {
  display: flex;
  flex-direction: row;
  width: 80%;
  overflow: hidden;
  margin: 100px auto;
}



.home-title {
  display: flex;
  flex-direction: column;
  color : white;
  font-size: 3em;
  font-weight: 600;
  width: 40%;
  padding : 20px;
  margin-right : 40px;
  align-items: center;
  justify-content: center;
  margin : 0 auto;
  font-family: "Montserrat", serif;
}

.home-more {
  width: 100%;
  font-size: 1.8em;
  font-weight: 600;
  white-space: pre-line;
  margin : 100px auto;
  height: fit-content;
  align-self: center;
  overflow: hidden;
  word-wrap: break-word;
}

.grid-home{
  display: grid;
  grid-template : 1fr 1fr / 1fr 1fr;
}

.grid-item:nth-child(2n+1){
  background-color : #4d047e;
  padding : 100px;
}

.grid-item:nth-child(7){
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.grid-item:nth-child(1){
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

#click-appart{
  align-self : center;
  color : #4d047e;
  cursor: pointer;
}

#click-appart:hover{
  color : #23527c;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: 100%;
  margin-bottom: 30px;
}

.wide-image {
  display: flex;
  align-items: center;
  margin: 0 auto;
  width: 80%;
  overflow: hidden;
}

.home.photos {
  display : flex;
  position: relative;
  width: 1200px;
  height : 750px;
  align-items: center;
  justify-content: center;
}

.home.photos a {
  display : flex;
  position: absolute;
  width: 60%;
  height : 60%;
}

.home.photos img {
  position: absolute;
  width: 100%;
  height: 100%;
}

.home.photos a:nth-child(1) img {
  z-index: 3;
  top : -10%;
  left : -10%
}

.home.photos a:nth-child(2) img {
  z-index: 2;
  top : 0%;
  left : 0%
}

.home.photos a:nth-child(3) img {
  z-index: 1;
  top : 10%;
  left : 10%
}

.home.photos img:hover {
  filter: brightness(50%); /* Adjust the opacity as desired */
}

.crop-wide {
  width: 100%;
  display: flex;
  height: 200px;
  object-fit: cover;
}

/* APPARTEMENT */

#appartement-list {
  width: 80%;
  max-width: 60em;
  margin: 30px auto;
}

.crop-image {
  width: 150px;
  height: 150px;
  object-fit: cover;
  object-position: 50% 50%;
}

.appartement {
  position : relative;
  display: flex;
  flex-direction: row;
  margin: 20px;
  padding: 10px;
  background-color: #e4e3e3;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  max-height: 150px;
  cursor: pointer;
}

.appartement:hover {
  background-color: #d1d0d0;
}

.appartement-image {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.appartement-content {
  display: flex;
  flex-direction: column;
  margin-left: 1.5em;
  margin-right: 1.5em;
  width: 55%;
  overflow: hidden;
}

.appartement-title {
  font-weight: 600;
  font-size: 1.5em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.appartement-hr {
  border: none; /* remove the default line style */
  border-top: 1px solid black; /* set the style and color of the line */
  margin: 10px 0; /* add some margin above and below the line */
}

.appartement-description {
  word-wrap: break-word;
  font-size: 1em;
  white-space: pre-line;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.appartement-infos {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  min-width: 10%;
  margin: 0 auto;
}

.appartement-price {
  font-size: 1.2em;
  font-weight: 600;
  overflow: hidden;
  word-wrap: break-word;
}

/* REGISTER */

.register-main {
  display: flex;
  text-align: center;
  justify-content: center;
  align-items: center;
  margin-top: 50px;
}

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="checkbox"],
input[type="tel"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

button#register {
  background-color: #4caf50;
  color: #ffffff;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
/* LOGIN */

.login-main {
  display: flex;
  text-align: center;
  justify-content: center;
  align-items: center;
  margin-top: 50px;
}

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

button#login {
  background-color: #4caf50;
  color: #ffffff;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* DOCUMENT */

.document-main {
  text-align: center;
  display: flex;
  margin: 30px auto;
  flex-direction: column;
  padding-bottom: 40px;
}

.document-menutitle {
  margin: 40px auto;
  font-size: 2em;
  font-weight: 600;
}

.document-list{
  margin-bottom : 50px;
}

.document{
  margin : 20px auto;
  text-align: center;
  font-size: 20px;
}


#document-form {
  display: flex;
  flex-direction: column;
  margin: 50px auto;
}

#send-doc {
  border: none;
  outline: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;

  background-color: #23527c;
  border: 5px solid #23527c;
  box-shadow: none;
  color: white;
}

/* ADMIN */

.admin-menu {
  margin: 0 auto;
  flex-direction: column;
  display: flex;
  align-items: center;
  width: 70%;
}

.admin-title {
  font-weight: 600;
  margin-bottom: 20px;
  margin-top: 30px;
}

#selected-photos img{
  width: 100px;
  height: 100px;
  object-fit: cover;
  object-position: 50% 50%;
  margin: 10px;
}

#show-edit img{
  width: 100px;
  height: 100px;
  object-fit: cover;
  object-position: 50% 50%;
  margin: 10px;
}

.edit-form {
  display: flex;
  flex-direction: column;
  width: 100%;
}

#ajout-annonce{
  display: flex;
  flex-direction: column;
  width: 100%;
}

#liste-annonces{
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* MESSAGERIE */

.messagerie-main {
  display: flex;
  flex-direction: column;
  margin: 30px auto;
  max-width: 60%;
}

.messagerie-contacts {
  display: flex;
  flex-direction: column;
}

#messagerie-list {
  list-style-type: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid black;
  height: 70vh;
}

.messagerie-user {
  display: flex;
  flex-direction: row;
  padding: 10px;
  border-bottom: 1px solid black;
  cursor: pointer;
}

.messagerie-user:hover {
  background-color: #e4e3e3;
  color: #440000;
}

.messagerie-title {
  margin: 40px auto;
  text-align: center;
  font-size: 2em;
}

.messagerie-messages {
  display: flex;
  flex-direction: column;
}

#messagerie-messages-list {
  display: flex;
  flex-direction: column;
  border: 1px solid black;
  height: 70vh;
  overflow-y: scroll;
}

.write-send {
  display: flex;
  align-items: center;
  margin-top: 20px;
}

.write-send input[type="text"] {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
}

.write-send button {
  margin-left: 10px;
  padding: 10px 20px;
  background-color: #337ab7;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.write-send button:hover {
  background-color: #23527c;
}

.received {
  width: fit-content;
  background-color: rgb(50, 0, 131);
  padding: 10px;
  border: 1px solid rgb(50, 0, 131);
  border-radius: 10px;
  margin: 10px 10px;
  max-width: 40%;
  color : white;
  word-wrap: break-word;
}

.sent {
  width: fit-content;
  background-color: #23527c;
  color: white;
  padding: 10px;
  border: 1px solid #23527c;
  border-radius: 10px;
  margin: 10px 10px;
  align-self: flex-end;
  max-width: 40%;
  word-wrap: break-word;
}

/* SPECIAL */

@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  -webkit-animation: fadeIn 1s;
  animation: fadeIn 1s;
}

.back-button {
  display: flex;
  margin-bottom: 30px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.back-button::before {
  content: "";
  position: absolute;
  transform: translate(-50%, -50%) rotate(45deg);
  rotate: 180deg;
  width: 10px;
  height: 10px;
  border-top: 2px solid black;
  border-right: 2px solid black;
}

.back-button:hover::before {
  border-color: #23527c; /* Modifier la couleur de la flèche au survol */
}

.hidden {
  display: none;
}

@media only screen and (max-width: 1240px) {
  /* MENU */
  .title {
    display: flex;
    font-size: 1.5em;
  }

  #menu {
    display: flex;
    flex-direction: column;
  }

  .menu {
    display: flex;
    padding: 0;
    min-width: 0;
    flex-wrap: wrap;
    background-color: white;
    border : none
  }

  .menu li{
    color : #4d047e;
  }

  .account {
    display: flex;
    width: 100%;
    padding: 0;
  }

  .connected {
    display: flex;
    width: 100%;
    padding: 0;
  }

  /* HOME */
  .home {
    display: flex;
    margin : 20px auto;
    flex-direction: column;
    width: 100%;
  }

  .home-main{
    background-image: none;
  }

  .home-more {
    margin: 40px auto;
    text-align: center;
    width : 80%
  }

  .home-title{
    color : #4d047e;
    background-color: white;
  }

  #click-appart{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .home .photos {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .home .photos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .home.photos {
    display : flex;
    position: relative;
    width: 100%;
    height : 100%;
    justify-content: center;
  }
  
  .home.photos a {
    display : flex;
    position: relative;
    width: 100%;
    height : 100%;
  }
  
  .home.photos img {
    position: relative;
    width: 100%;
    height: 100%;
  }

  .home.photos a:nth-child(1) img {
    z-index: 3;
    top : 0%;
    left : 0%
  }
  
  .home.photos a:nth-child(2) img {
    top : 0%;
    left : 0%
  }
  
  .home.photos a:nth-child(3) img {
    top : 0%;
    left : 0%
  }

  .grid-item:nth-child(2n+1){
    background-color : white;
    padding : 100px;
  }

  .grid{
    margin-top: 100px;
  }

  .crop-wide {
    width: 100%;
    display: flex;
    height: 150px;
    object-fit: cover;
  }

  /* APPARTEMENTS */
  .wide-image {
    width: 100%;
  }

  #appartement-list {
    width: 100%;
  }

  .appartement {
    display: flex;
    flex-wrap: wrap;
    max-height: fit-content;
    overflow: hidden;
  }

  .appartement-image{
    width: 100%;
    margin-bottom: 20px;
  }

  .crop-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    object-position: 50% 50%;
  }

  .appartement-content {
    width : 100%;
  }

  .appartement-title {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .appartement-infos {
    margin-top : 20px;
    display: flex;
    flex-direction: row;
    border: 1px solid black;
    width: 100%;
    justify-content: center;
    align-items: center;
  }
}
