/* ------------- */
/*     HTML      */
/* ------------- */

html,
body {
  font-family: "Inter", sans-serif;
  background-color: #1e1e1e;
  color: #eff1f3;
  margin: 0;
  padding: 0;
  overflow: auto;
  height: 100%; /* Définit la hauteur de la page à 100% */
  display: flex; /* Flexbox sur le body */
  flex-direction: column; /* Aligne le contenu du body en colonne */
}

/* --------------- */
/*     Header      */
/* --------------- */

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 10px 40px;
}

header a {
  text-decoration: none;
  color: #eff1f3;
}

header ul {
  list-style: none;
  display: flex;
  align-items: center;
}

header li {
  cursor: pointer;
}

.header_text {
  display: flex;
  flex-grow: 1; /* Le conteneur des liens prend toute la place disponible */
  justify-content: center; /* Centre les liens horizontalement */
  gap: 15%; /* Espace entre les liens */
  font-weight: 600;
}

.header_text a {
  padding: 0 10px;
}

.bouton_connexion {
  padding: 10px 20px;
  border-radius: 900px;
  font-size: 16px; /* Taille de la police */
  border-color: #00a8e8;
  color: #eff1f3;
  background-color: #00a8e8;
  margin-top: 0;
  cursor: pointer;
}

.bouton_connexion:hover {
  border-color: #eff1f3;
  color: #00a8e8;
  background-color: #eff1f3; /* Changer la couleur au survol */
}

#smart_building {
  width: 13%;
  margin-left: -40px;
  height: auto;
}

/* --------------- */
/*     Objets      */
/* --------------- */

main {
  display: flex;
  flex-grow: 1; /* Permet à la section principale d'occuper l'espace restant */
  justify-content: center; /* Centre verticalement le contenu */
  align-items: center; /* Centre horizontalement le contenu */
  padding-bottom: 50px;
  gap: 30px; /* Espace entre les 2 sections */
}

.left-panel {
  flex: 3; /* 30% de la largeur totale */
  display: flex;
  justify-content: center; /* Centrer l'image horizontalement */
  align-items: center; /* Centrer l'image verticalement */
}

.left-panel img {
  width: 100%; /* L'image prend toute la largeur de son conteneur */
  max-width: 450px; /* Maximum de 300px de largeur */
  height: auto; /* La hauteur de l'image s'ajuste automatiquement */
  border-radius: 32px;
}

.right-panel {
  flex: 7; /* 70% de la largeur totale */
}

.right-panel h1 {
  font-size: 60px;
  margin-bottom: 60px;
}

.header-objets {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 70px;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.header-objets h1 {
  font-size: 60px;
  margin: 0;
  color: #eff1f3;
}

#objets-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 cartes par ligne */
  gap: 20px;
  justify-items: center;
  padding: 20px 60px;
}

.objet {
  width: 100%;
  max-width: 300px; /* Limite la largeur des cartes pour que ça soit plus joli */
  padding: 20px;
  background-color: #2c2c2c;
  color: #eff1f3;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background-color 0.3s ease;
  text-align: center;
}

.objet:hover {
  transform: translateY(-5px);
  background-color: #dfe3e6;
  color: #2c2c2c;
  cursor: pointer;
}

.objet h3 {
  font-size: 22px;
  margin: 10px 0 5px;
}

.etat-point {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: absolute;
  bottom: 5px;
  right: 5px;
}

.etat-point.actif {
  background-color: rgb(100, 236, 100);
}

.etat-point.inactif {
  background-color: rgb(240, 84, 84);
}

.setting-btn {
  background: none;
  border: none;
  text-align: center;
  cursor: pointer;
}

.setting-btn i {
  font-size: 20px;
  color: #a8a3a3;
}

.setting-btn:hover i {
  transform: scale(1.4);
  transition: transform 0.2s ease;
}

.objet:hover i {
  color: #2c2c2c;
}


.info_objet{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info_objet h2{
  margin-bottom: 100px;
}

.info_objet h4{
  margin:0px;
}

.actions{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.edit-button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.edit-button i {
  font-size: 14px;
  color: #eff1f3;
  transition: transform 0.2s ease;
  transform: translateY(-2px);
}

.edit-button:hover i {
  transform: scale(1.3) translateY(-2px);
}

.inline-edit {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-edit h2,
.inline-edit p {
  margin: 0;
}

[contenteditable="true"] {
  border: 1px solid #eff1f3; /* Bordure fine autour de l'élément modifiable */
  border-radius: 4px; /* Bords arrondis pour un style plus doux */
  padding: 3px 5px; /* Un peu de padding pour l'esthétique */
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); /* Ombre légère autour de l'élément */
}

/* Style modal */
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(60, 60, 60, 0.98); /* Plus clair que le fond de base */
  backdrop-filter: blur(12px); /* Plus de flou = plus de séparation */
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8); /* Ombre plus forte */
  color: #eff1f3;
  max-width: 450px;
  width: 90%;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1); /* Léger contour clair */
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #eff1f3;
}

.modal p {
  font-size: 16px;
  line-height: 1.4;
}

.modal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  font-weight: bold;
  color: #eff1f3;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
}

.modal .close:hover {
  color: #ff4d4d;
  transform: scale(1.2);
}

/* -------------------- */
/*   Barre Recherche    */
/* -------------------- */

.form {
  width: 300px;
  margin: 0;
  font-size: 0.9rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  position: relative;
  isolation: isolate;
  --input-text-color: #363636;
  --input-bg-color: #eff1f3;
  --focus-input-bg-color: transparent;
  --text-color: #2a2a2a;
  --active-color: #eff1f3;
  --width-of-input: 250px;
  --inline-padding-of-input: 1.2em;
  --gap: 0.9rem;
}

.fancy-bg {
  position: absolute;
  width: 100%;
  inset: 0;
  background: var(--input-bg-color);
  border-radius: 30px;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px;
}

label {
  padding: 0.2em;
  height: 40px;
  padding-inline: var(--inline-padding-of-input);
  display: flex;
  align-items: center;
}

.search,
.close-btn {
  position: absolute;
}

.search {
  fill: var(--text-color);
  left: var(--inline-padding-of-input);
}

svg {
  width: 17px;
  display: block;
}

.input {
  color: var(--input-text-color); /* La couleur du texte par défaut */
  width: 100%;
  margin-inline: min(2em, calc(var(--inline-padding-of-input) + var(--gap)));
  background: none;
  border: none;
}

.input:focus {
  outline: none;
  color: #eff1f3;
}

/* input background change in focus */
.input:focus ~ .fancy-bg {
  border: 1px solid var(--active-color);
  background: var(--focus-input-bg-color);
}

/* search icon color change in focus */
.input:focus ~ .search {
  fill: var(--active-color);
}

/* showing close button when typing */
.input:valid ~ .close-btn {
  visibility: visible;  /* Si l'input est valide, rendre le bouton visible */
  color: #eff1f3;       /* Garde l'icône en blanc */
}

.close-btn {
  right: var(--inline-padding-of-input);
  background: none;
  border: none;
  box-shadow: none;
  width: auto;
  height: auto;
  padding: 0;
  opacity: 1;
  color: #eff1f3;
  visibility: hidden;
  font-size: 20px;
  cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
  background: none;
  font-weight: bold;
  transform: scale(1.2); /* Légèrement agrandit l'icône pour la rendre plus évidente */
}

.input:not(:focus):not(:placeholder-shown) {
  color: #2a2a2a; /* Couleur texte sombre si champ rempli mais pas focus */
}

.input:not(:focus):not(:placeholder-shown) ~ .search {
  fill: #2a2a2a; /* Loupe sombre quand input rempli mais pas focus */
}

.input:not(:focus):not(:placeholder-shown) ~ .close-btn {
  color: #2a2a2a; /* Croix sombre également */
}

/* --------------- */
/*     Footer      */
/* --------------- */

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  text-transform: uppercase;
  padding: 20px;
  margin-top: auto; /* Cela force le footer à se pousser vers le bas */
}

.copyright {
  padding: 10px 20px;
}

footer a {
  text-decoration: none;
  color: #eff1f3;
}

.footer_link {
  display: flex;
  flex-grow: 1;
  gap: 10%;
}

.footer_link a {
  padding: 0 10px;
}

.copyright {
  padding: 10px 20px;
}