body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Fira Sans, Droid Sans, Helvetica Neue, Sans-Serif;
  background: linear-gradient(to right, #2c3e50, #4ca1af);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

a {
  color: #0088cc;
  font-weight: bold;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background-color: #233040;
    color: white;
    border-bottom: 1px solid #ccc;
}

.chat-logo {
    height: 40px;
    width: 40px;
    margin-right: 12px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-title {
    font-size: 18px;
    font-weight: bold;
}


.chat-container {
  position: relative;
  background-color: #ffffff !important;
  width: 100%;
  max-width: 600px;
  height: 95vh;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.hauteur {
  height: 200px;
}

.haut {
  height: 50px;
}

.chat-box {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  height: 100%;
  flex-direction: column;
  background-color: #f5f5f5;
}

.userbot.username {
  display: flex;
  position: absolute;
  /*top: 100px;*/
  width: 100%;
  max-width: 300px;
  border-radius: 10px 18px 10px 18px;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.5);
  flex-direction: column;
  z-index: 1;
  padding: 10px 15px;
  font-weight: bold;
  
  justify-content: center;
  align-items: center;     /* centre verticalement */
  gap: 10px;               /* espace entre Hello et le bouton */
  flex-direction: row;     /* en ligne */
  text-align: center;
}

.message {
  position: relative;
  margin-top: 40px;
  width: 70%;
  max-width: 70%;
  padding: 5px 10px;
  margin-bottom: 0px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 15px;
  word-wrap: break-word;
}

#closeModal, #closeLoginModal, #closeUserModal, #closeVerifModal, #closePubModal, #closePubChoiceModal {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 32px;
    font-weight: bold;
    color: #233040;
}

#closeModal:hover, #closeLoginModal:hover, #closeUserModal:hover, #closeVerifModal:hover, #closePubModal:hover, #closePubChoiceModal:hover {
    color: #8c4b64; /* Couleur quand la croix est survolée */
}

.bot {
  align-self: flex-start;
  background-color: #ffffff;
  color: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.username {
  align-self: center;
  background-color: #0088cc;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.user {
  align-self: flex-end;
  background-color: #dcf8c6;
  color: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Classe pour la surbrillance des champs en erreur */
.input-error {
    border: 2px solid red !important; 
}

.input-area {
  display: flex;
  padding: 10px;
  border-top: 2px solid #333;
  background-color: #233040;
  position: relative;
  z-index: 999;
  align-items: center;
}

.attach-button {
  cursor: pointer;
  font-size: 20px;
  padding: 6px;
  gap: 8px;
}

#pubModal h2 {
    font-weight: bold;
    width: 96%;
    font-size: 18px;
    text-align: center;
}

.modal-content img {
    width: 100%;
}


#pubChoiceModal {
  text-align: center;
}

#pubChoiceModal button {
  background-color: #233040;
  border: none; 
  color: white;
  font-weight: bold;
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  justify-content: center;
  align-items: center;
}

#pubChoiceModal h2 {
  width: 96%;
  font-size: 20px;
}

#pubChoiceModal p {
  margin: auto;
  font-weight: bold;
}

#pubChoiceModal .pub-icone {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

#pubChoiceModal .pubchoice-modal {
  width: 60%;
  margin-bottom: 20px;
}


.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #233040;
    color: #FFF;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Effet au survol du bouton */
.delete-btn:hover {
    background-color: #8c4b64;
    transform: scale(1.1);
}

/* Effet au clic du bouton */
.delete-btn:active {
    transform: scale(0.95);
}


/* Icône du menu hamburger */
.menu-button {
  border: none;
  cursor: pointer;
  margin-right: 0px;
  display: flex;
  align-items: center;
  background-color: #0088cc;
  padding: 10px 18px;
  color: white;
  border-radius: 25px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}


/* Le menu du chat qui se cache par défaut */
.chat-menu {
  position: absolute;
  bottom: 70px;
  width: 100%;
  max-width: 600px;
  background-color: #2c2c2e;
  border-radius: 10px 18px 0 0;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.5);
  flex-direction: column;
  padding: 0;

  max-height: 300px;          /* ou ce que tu veux selon l'écran */
  overflow-y: auto;
  scroll-behavior: smooth;

  transform: translateY(100%);
  transition: transform 0.4s ease-in-out;
  display: none;
}

.chat-menu::-webkit-scrollbar {
  width: 6px;
}

.chat-menu::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

.chat-menu.active {
  transform: translateY(0%);
  display: flex;
}

/* Quand le menu est visible */
.chat-menu.open {
  max-height: 200px; /* hauteur que tu veux pour le menu */
}

/* Liste dans le menu */
.chat-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chat-menu li {
  width: 100%;
}

.chat-menu li:last-child {
  border-bottom: none;
}

.chat-menu a {
  display: block;
  width: 95%;
  padding: 12px;
  border-bottom: 1px solid #333;
  text-decoration: none;
  color: #FFF;
  font-size: 14px;
  font-weight: normal;
  cursor: pointer;
}

.chat-menu button {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #ff3333;
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  border-radius: 50%;
}

/* Icône Hamburger (☰) */
.hamburger-icon {
  display: block;
}

/* Icône X (✖) */
.close-icon {
  display: none;
}

.telegram-link-btn {
  background-color: #233040;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.3s ease;
  font-weight: bold;
}

.telegram-link-btn:hover {
  background-color: #465b71;
}


input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 25px;
  font-size: 15px;
  outline: none;
  background: #ffffff;
}

button.send-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  margin-left: 10px;
  background-color: #0088cc;
  color: white;
  font-weight: bold;
  /*transition: background-color 0.3s ease;*/
  font-size: 25px;
  cursor: pointer;
  box-sizing: border-box;
}

button.send-btn:hover {
  background-color: #0077b3;
}

button.send-btn:active,
button.send-btn:focus {
    outline: none; /* Empêche un éventuel contour au clic */
    margin-left: 10px; /* Assure que le margin ne change pas */
}

.input-area input[type="text"] {
  background: #233040 !important;
  color: #fff !important;
}

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.quick-buttons button {
  padding: 6px 12px;
  border: none;
  background-color: #dfeefc;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.quick-buttons button:hover {
  background-color: #cde4f9;
}

.modal {
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  background-color: #ffffff;
  padding: 24px;
  border-radius: 12px;
  width: 80%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content h2 {
  margin-top: 0;
  color: #0088cc;
}

.modal-content input,
.modal-content select,
.modal-content button {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 16px;
}

.modal-content input {
  width: 94% !important;
}

.modal-content button {
  background-color: #0088cc;
  color: white;
  border: none;
  cursor: pointer;
  transition: 0.3s ease;
}

.modal-content button:hover {
  background-color: #0077b3;
}

.telegram-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
  }

  .telegram-header {
    margin-bottom: 0px;
    text-align: center;
  }

  .telegram-header-text {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    text-align: left;
    margin: 0px;
  }

  .telegram-content-text {
    font-size: 14px;
    color: #333;
    text-align: left;
    margin: 5px 0px;
  }
  
  .telegram-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }

  .telegram-row a {
    text-decoration: none;
  }
  
  .telegram-button {
    flex: 1;
    padding: 12px;
    background-color: #0088cc;
    color: white;
    text-align: center;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }

  .telegram-button:hover {
    background-color: #0077b3;
  }

  .message a {
    text-decoration: none;
  }

  .link-preview {
    display: flex;
    align-items: flex-start;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: 100%;;
    background: #dfeefc;
    color: #233040;
    cursor: pointer;
  }

  .link-preview .image-preview img {
      width: 80px;
  }

  .link-preview .desc-preview h4 {
      margin-top: 5px;
      margin-bottom: 5px;
      text-align: left;
      color: #0077b3;
  }

  .link-preview .desc-preview p {
      margin-top: 0px;
      margin-bottom: 5px;
      font-size: 12px;
      text-align: left;
      color: #333 !important;
      font-weight: normal;
  }

  .link-preview img {
    width: 120px;
    height: 100%;
    object-fit: cover;
  }

  .link-preview img.responsive {
    width: 200px;
  }
  .link-preview-content {
    padding: 10px;
    flex: 1;
  }

  .link-preview-content h4 {
    margin: 0;
    font-size: 14px;
    color: #333;
  }

  .link-preview-content p {
    margin: 5px 0 0;
    font-size: 12px;
    color: #666;
  }

  .showLink {
    font-size: 12px;
  }

  .preview-image {
    display: block;
    margin-top: 8px;
    border-radius: 6px;
    max-width: 100%;
    height: auto;
  }

  .responsive {
    width: 100%;
    height: auto;
  }

  .context-menu {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 5px;
    z-index: 9999;
  }

  .context-menu button {
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    width: 100%;
  }

  .context-menu button:hover {
    background: #f0f0f0;
  }

  .hidden {
    display: none;
  }

  #chatTitle {
    font-size: 14px;
  }

  .start-button {
    border-top: 1px solid #ccc;
    background: #fff;
    border-top: 2px solid #333;
    background-color: #233040;
    position: relative;
    display: none; 
    text-align: center; 
    padding: 10px;
  }

  .start-btn {
    background-color: #0088cc;
    color: white;
    border: none;
    width: 60%;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
    transition: 0.3s ease;
    font-weight: bold;
  }

   .start-btn:hover {
      background-color: rgb(0, 136, 204);
   }

  .deleteMsg-btn {
    background-color: #0088cc;
    color: white;
    border: none;
    width: 80%;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: 0.3s ease;
    font-weight: bold;
  }

   .deleteMsg-btn:hover {
      background-color: #8c4b64;
   }


    /* Style pour le menu déroulant */
    .dropdown {
      position: relative;
      display: inline-block;
    }

    .dropbtn {
      background: none;
      color: white;
      padding: 10px;
      font-size: 18px;
      border: none;
      cursor: pointer;
    }

    .dropdown-content {
      display: none;
      position: absolute;
      background-color: #233040;
      min-width: 220px;
      right: 0;
      box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
      z-index: 9999;
    }

    .dropdown-content.show {
      display: block;
    }

    .dropdown-content a {
      color: white;
      padding: 7px 8px;
      font-weight: 600;
      font-size: 14px;
      text-decoration: none;
      display: block;
      border-bottom: 1px solid #333;
      cursor: pointer;
    }

    .dropdown-content a:hover {
        background-color: #f5f5f5;
        color: #233040;
    }

    .dropdown:hover .dropdown-content {
      display: block;
    }

    #deleteChoiceContainer {
      margin-top: 20px;
      background-color: #f0f0f0;
      padding: 10px;
      border-radius: 10px;
    }

    #cancelSelectedMessages {
      display: none;
    }

    .select-msg {
      padding: 20px;
      display: block;
      position: absolute;
      top: 50%;
      left: -1px;;
      border: 1px solid #233040;
      width: 16px;
      height: 16px;
      border-radius: 5px;
    }

    .select-msg:hover {
      transition: all 0.3s ease;
    }

    .select-msg:checked {
      transition: all 0.3s ease;
    }

    .show-input-select {
        padding-left: 30px;
    }

    .grecaptcha-badge {
        width: 70px !important;
        height: 60px;
        top: 13%;
        left: 0;
        visibility: hidden;
    }


  .hidden-under {
      position: absolute;
      top: 120px; /* Ajuste selon ton besoin */
      width: 100%;
      clip-path: inset(0 0 100px 0); /* Coupe l’élément lorsqu’il dépasse */
  }

  .telegram-row.file-message {
      display: flex;
      align-items: center;
      background-color: #f1f1f1;
      padding: 10px;
      border-radius: 8px;
      margin-bottom: 10px;
  }

  .file-icon {
      font-size: 30px;
      margin-right: 10px;
  }

  .file-details {
      display: flex;
      flex-direction: column;
  }

  .file-name {
      font-weight: bold;
      margin-bottom: 5px;
  }

  audio {
      width: 100%;
      outline: none;
      margin-top: 10px;
      border-radius: 10px;
      background: #f4f4f4;
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  }

  /* Style pour le conteneur du message */
  .telegram-row.file-message {
      background: #ffffff;
      border-radius: 12px;
      padding: 12px;
      margin: 10px 0;
      box-shadow: 0 2px 4px rgba(0,0,0,0.06);
      display: flex;
      align-items: flex-start;
  }

  /* Icône musicale */
  .file-icon {
      font-size: 24px;
      margin-right: 10px;
  }

  /* Détails du fichier */
  .file-details {
      flex: 1;
  }

  /* Nom du fichier */
  .file-name {
      font-weight: bold;
      margin-bottom: 5px;
      color: #333;
  }

  .download-button {
      background-color: #0088cc;
      color: white;
      padding: 6px 12px;
      border-radius: 5px;
      text-decoration: none;
      font-size: 14px;
  }

  .download-button:hover {
      background-color: #006699;
  }

  .notif-firebase {
    position: absolute;
    top: 80px;
    right: 15px;
    z-index: 10;
  }

  .pub-notice {
    position: absolute;
    top: 75px;
    left: 15px;
    z-index: 10;
  }

  .pub-notice img {
    width: 60px;
    border-radius: 50%;
  }
  
  .pub-btn {
    border: none;
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
  }

  .pub-btn:hover {
    background-color: #0088cc; 
    color: #333; 
    transform: scale(1.1);
  }

  .subscribe-btn {
    background-color: #333; 
    border: none;
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
  }

  .subscribe-btn:hover {
    background-color: #ffd700; 
    color: #333; 
    transform: scale(1.1);
  }

  .subscribe-btn i {
    pointer-events: none; 
  }

@media (max-width: 768px) {
  body, html {
    height: 100%;
    /*overflow: hidden;
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;*/
    overflow-y: auto;
    touch-action: auto;
    -webkit-overflow-scrolling: touch;
  }

  #pubModal h2 {
      font-size: 15px;
  }

  .modal-content {
    padding: 16px;
  }

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

  .chat-box {
    flex: 1;
    min-height: 0; 
    overflow-y: auto;
  }

  .show-input-select {
      padding-left: 20px !important;
  }
  .chat-header {
    position: sticky; 
    top: 0;
    z-index: 10;
  }

  .message {
    width: 90% !important;
    max-width: 90%;
  }

  .telegram-button {
    font-size: 12px;
  }

  .chat-menu {
    bottom: 70px;
  }

  /*.userbot.username {
      top: 80px;
    }*/

  .chat-container {
    height: 100dvh; /* Fonctionne sur la plupart des navigateurs modernes */
    max-height: 100dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    border-radius: 0px;
    height: calc(var(--vh, 1vh) * 100);
  }

  button.send-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
    margin-left: 5px;
  }

  #chatTitle {
    font-size: 12px;
  }

  .dropdown-content {
    z-index: 999;
  }

  .pub-notice {
    left: 5px;
  }

  .notif-firebase {
    right: 5px;
  }

}

@media screen and (max-width: 480px) {
  .message {
    width: 90% !important;
    max-width: 90%;
    font-size: 12px;
    padding: 5px 10px;
  }

  input[type="text"] {
    font-size: 12px;
  }

  .quick-buttons button {
    font-size: 12px;
  }

}

@media screen and (max-width: 400px) {
  .input-area {
    padding: 6px;
  }

  #chatTitle {
      font-size: 12px;
  }

  .menu-button {
    padding: 5px 10px;
  }

  .chat-menu {
        bottom: 40px;
    }

  .chat-menu a {
    font-size: 12px;
  }

  .chat-menu li {
      padding: 7px;
  }
}

@media screen and (max-width: 378px) {
  #chatTitle {
      display: none;
  }

  .hamburger-icon, .close-icon {
      padding: 5px 10px;
  }
}