body {
  direction: rtl;
}

/* Réinitialiser les marges et les paddings par défaut */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Style pour le corps de la page */
body {
  font-family: Arial, sans-serif;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  min-height: 100vh;
}

.text-size {
  font-size: 14px;
}

.dimensions {
  font-size: 14px;
  line-height: 1.2;
}

#main-container {
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  padding: 20px 20px 5px 20px;
  background-color: white;
  position: relative;
  top: 0;
}

/* Styles pour les sections internes */
#header-container,
#bonsai-container
{
  margin-top: 15px;
  background-color: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  text-align: center;
}
#footer-container {
  margin-top: 15px;
  padding: 10px;
  text-align: center;
}
.imgarbre {
  margin-left: 18px;
  transform: scaleX(-1);
}
#header-container {
  margin-top: 0;
}

/* Styles pour les infos du bonsaï */
#infos-container {
  display: flex;
  justify-content: center;
  text-align: right;
  width: 100%;
}

/* Élément interne pour contrôler l'alignement du texte */
#infos-container div {
  text-align: right;
}

/* Styles supplémentaires */
h1 {
  font-size: 20px;
}
h2 {
  font-size : 16px;
}

p {
  margin-bottom: 10px;
}

select {
  padding: 5px;
  font-size: 14px;
}

.lienvers {
  text-align: left;
}

/* Styles des blocs rétractables */
.collapsible {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background-color: #f1f1f1;
  color: #444;
  cursor: pointer;
  padding: 10px;
  border: 1px solid rgb(231, 231, 231);
  text-align: right;
  outline: none;
  font-size: 15px;
  margin: 1px;
}

.collapsible .text {
  flex-grow: 1;
  text-align: right;
}

.collapsible .icon {
  flex-shrink: 0;
  margin-right: auto;
  margin-left: 5px;
}
.active,
.collapsible:hover {
  background-color: #ccc;
}
.content {
  margin: 1px;
  padding: 0 14px;
  display: none;
  overflow: hidden;
  background-color: #f9f9f9;
}
.textinfos {
  text-align: right;
}

/* Style pour le sélecteur de langue */
#language-selector {
  margin: 0px 0;
  text-align: center;
  padding: 0 0 10px 0;
}

.imgpdf {
  margin: 4px 10px 0 0;
  height: 36px;
}

/* Styles pour l'affiche du conteneur des caractéristiques */
#caracteristiques-container,
#style-container,
#proprio-container {
  cursor: pointer;
}
.textculture {
  text-align: right;
  font-size: 14px;
}

/* Styles pour la boîte de dialogue modale */
#modal,
#modal2,
#modal3 {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  padding: 20px;
  background-color: #fff;
  border: 1px solid #000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

/* Styles pour le bouton de fermeture */
#close-btn,
#close-btn2,
#close-btn3 {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
}

/* Styles pour le fond sombre lorsque la modale est affichée */
#overlay,
#overlay2,
#overlay3 {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 500;
}

/* Ajustements spécifiques pour les langues RTL */
html[dir="rtl"] #close-btn,
html[dir="rtl"] #close-btn2 {
  right: auto;
  left: 10px;
}

/* Styles pour l'affichage du style et des infos propriétaire */
#prostyle-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

#style-container {
  flex: 1;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-right: 40px;
  justify-content: flex-start;
  padding-top: 0px;
}

#proprio-container {
  flex: 1;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  justify-content: flex-end;
  padding-top: 10px;
  padding-left: 30px;
}
#propriovide-container {
  flex: 1;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  justify-content: flex-end;
  padding-top: 10px;
  padding-left: 30px;
}


/* Styles des containers des évènements */
#events-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 auto;
}

#event-container,
.event-container {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: justify;
  margin: 0;
}

.imgevent {
  margin: 7px 0 5px 5px;
  width: 100px;
}

.divimgevent {
  display: flex;
  align-items: center;
}

.divtxtevent {
  line-height: 1.2;
  font-size: 12px;
  margin: 5px;
}

.survol:hover {
  color: rgb(194, 194, 194);
}

.image-containerevent {
  display: inline-block;
  text-align: center;
}
.image-containerevent img {
  cursor: pointer;
}
.lb-close {
  top: 10px !important;
  left: 10px !important;
  right: auto !important;
  width: 30px !important;
  height: 30px !important;
  background-size: contain !important;
  position: absolute !important;
}
.lb-details {
  float: right !important;
  text-align: center !important;
  width: 100% !important;
}
.lb-caption {
  font-size: 16px !important;
}

/* Styles de base pour le formulaire */
#filter-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 20px;
}

#filter-form label {
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  flex: 1 1 auto;
  text-align: center;
  
  /* Centrage vertical et horizontal du texte */
  display: flex;
  align-items: center;
  justify-content: center;
}

#filter-form label:hover {
  background-color: #e0e0e0;
  border-color: #ccc;
}

/* Classe pour les boutons actifs */
#filter-form label.active {
  background-color: rgb(0, 157, 192);
  color: white;
  border-color: rgb(0, 157, 192);
}

#filter-form input[type="checkbox"] {
  display: none;
}
.qr-code-wrapper {
  background-color: white;
  display: inline-block;
  }

  @media print {
  .no-print {
    display: none !important;
  }
}

/* Réduire la taille des boutons sur les petits écrans */
@media (max-width: 600px) {
  #filter-form label {
      padding: 4px 8px;
      font-size: 10px;
      flex: 1 1 30%;
  }
}

@media (max-width: 400px) {
  #filter-form label {
      flex: 1 1 45%;
  }
}

/* Mode sombre automatique */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1e1e1e;
    color: #ffffff;
  }

  #bonsai-contain,
  #main-container,
  #header-container {
    background-color: #1e1e1e;
    color: #ffffff;
  }

  .collapsible {
    background-color: #333;
    color: #ddd;
    border: 1px solid #444;
  }

  .collapsible:hover {
    background-color: #444;
  }

  .content {
    background-color: #2a2a2a;
    color: #ddd;
  }

  #filter-form label {
    background-color: #333;
    border-color: #444;
    color: #ddd;
  }

  #filter-form label.active {
    background-color: #005f99;
    color: white;
    border-color: #005f99;
  }

  #modal,
  #modal2,
  #modal3 {
    background-color: #1e1e1e;
    color: #ffffff;
  }

  a {
    color: #80d8ff;
  }
  .nophoto {
    filter: invert(1);
    border-radius: 6%;
  }
  .survol:hover {
    color: #aaaaaa;
  }
  .qr-code-wrapper {
    background-color: #1e1e1e;
  }
  .qr-code {
    filter: invert(88%);
  }
  .qr-logo {
    content: url('../images/logo_dark.png');
  }
}
