@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f7f7f7;
  padding: 0 10px;
  color: #000;
}
.loginl path {
  fill: #007aff; /* colore logo */
}
.wrapper {
  background: #fff;
  max-width: 450px;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.1),
              0 32px 64px -48px rgba(0, 0, 0, 0.5);
}
/* Video Bg*/
.video-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;  /* Assicurati che il video sia dietro al contenuto */
  background-color: #f7f7f7; /* Colore di fallback */
}

.video-background video {
  width: 100%;
  height: 100%;
  object-fit: cover;  /* Assicura che il video copra tutta l'area */
}

/* Splash screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #082ad8;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.splash-hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-logo {
  width: 200px;
  height: 200px;
  animation: pulse 1.5s infinite ease-in-out;
  transform-origin: center center;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* Form */
.form {
  padding: 25px 30px;
}

.form header {
  font-size: 25px;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid #e6e6e6;
}

.form form {
  margin: 20px 0;
}

.form form .error-text {
  color: #721c24;
  padding: 8px 10px;
  text-align: center;
  border-radius: 5px;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  margin-bottom: 10px;
  display: none;
}

.form form .name-details {
  display: flex;
}

.form .name-details .field:first-child {
  margin-right: 10px;
}

.form .name-details .field:last-child {
  margin-left: 10px;
}

.form form .field {
  display: flex;
  margin-bottom: 10px;
  flex-direction: column;
  position: relative;
}

.form form .field label {
  margin-bottom: 2px;
}

.form form .input input,
.form form .image input {
  height: 40px;
  width: 100%;
  font-size: 16px;
  padding: 0 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  outline: none;
}

.form form .button input {
  height: 45px;
  border: none;
  color: #fff;
  font-size: 17px;
  background: #333;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 13px;
}

.form form .field i {
  position: absolute;
  right: 15px;
  top: 70%;
  color: #ccc;
  cursor: pointer;
  transform: translateY(-50%);
}

.form form .field i.active::before {
  color: #333;
  content: "\f070";
}

.form .link {
  text-align: center;
  margin: 10px 0;
  font-size: 17px;
}

.form .link a {
  color: #333;
  font-weight:bold;
}
.field.checkbox a {
  color: #333;
  font-weight: bold;
  text-decoration: none;
}

.form .link a:hover {
  text-decoration: underline;
}

/* Users */
.users {
  padding: 25px 30px;
}

.users header,
.users-list a {
  display: flex;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #e6e6e6;
  justify-content: space-between;
}

.wrapper img {
  object-fit: cover;
  border-radius: 50%;
}

.users header img {
  height: 50px;
  width: 50px;
}

:is(.users, .users-list) .content {
  display: flex;
  align-items: center;
}

:is(.users, .users-list) .content .details {
  color: #000;
  margin-left: 20px;
}

:is(.users, .users-list) .details span {
  font-size: 18px;
  font-weight: 500;
}

.users header .logout {
  display: block;
  background: #333;
  color: #fff;
  outline: none;
  border: none;
  padding: 7px 15px;
  text-decoration: none;
  border-radius: 5px;
  font-size: 17px;
}

.users .search {
  margin: 20px 0;
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
}

.users .search .text {
  font-size: 18px;
}

.users .search input {
  position: absolute;
  height: 42px;
  width: calc(100% - 50px);
  font-size: 16px;
  padding: 0 13px;
  border: 1px solid #e6e6e6;
  outline: none;
  border-radius: 5px 0 0 5px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.users .search input.show {
  opacity: 1;
  pointer-events: auto;
}

.users .search button {
  position: relative;
  z-index: 1;
  width: 47px;
  height: 42px;
  font-size: 17px;
  cursor: pointer;
  border: none;
  background: #fff;
  color: #333;
  outline: none;
  border-radius: 0 5px 5px 0;
  transition: all 0.2s ease;
}

.users .search button.active {
  background: #333;
  color: #fff;
}

.search button.active i::before {
  content: '\f00d';
}

.users-list {
  max-height: 350px;
  overflow-y: auto;
}

:is(.users-list, .chat-box)::-webkit-scrollbar {
  width: 0px;
}

.users-list a {
  padding-bottom: 10px;
  margin-bottom: 15px;
  padding-right: 15px;
  border-bottom-color: #f1f1f1;
}

.users-list a:last-child {
  margin-bottom: 0px;
  border-bottom: none;
}

.users-list a img {
  height: 40px;
  width: 40px;
}

.users-list a .details p {
  color: #67676a;
}

.users-list a .status-dot {
  font-size: 12px;
  color: #0CF21B;
  padding-left: 10px;
}

.users-list a .status-dot.offline {
  color: #ccc;
}

/* Chat Area */
.chat-area header {
  display: flex;
  align-items: center;
  padding: 18px 30px;
}

.chat-area header .back-icon {
  color: #333;
  font-size: 18px;
}

.chat-area header img {
  height: 45px;
  width: 45px;
  margin: 0 15px;
}

.chat-area header .details span {
  font-size: 17px;
  font-weight: 500;
}

.chat-box {
  position: relative;
  min-height: 500px;
  max-height: 500px;
  overflow-y: auto;
  padding: 10px 30px 20px 30px;
  background: #f7f7f7;
  box-shadow: inset 0 32px 32px -32px rgba(0, 0, 0, 0.05),
              inset 0 -32px 32px -32px rgba(0, 0, 0, 0.05);
}

.chat-box .text {
  position: absolute;
  top: 45%;
  left: 50%;
  width: calc(100% - 50px);
  text-align: center;
  transform: translate(-50%, -50%);
}

.chat-box .chat {
  margin: 15px 0;
}

.chat-box .chat p {
  word-wrap: break-word;
  padding: 8px 16px;
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.08),
              0rem 16px 16px -16px rgba(0, 0, 0, 0.1);
}

/* Incoming */
.chat-box .incoming {
  display: flex;
  align-items: flex-end;
}

.chat-box .incoming img {
  height: 35px;
  width: 35px;
}

.chat-box .incoming .details {
  margin-right: auto;
  margin-left: 10px;
  max-width: calc(100% - 130px);
}

.incoming .details p {
  background: #fff;
  color: #333;
  border-radius: 18px 18px 18px 0;
}

/* Outgoing + Avatar */
.chat-box .outgoing {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.chat-box .outgoing .details {
  margin-left: auto;
  margin-right: 10px;
  max-width: calc(100% - 130px);
  order: 1;
}

.chat-box .outgoing img {
  height: 35px;
  width: 35px;
  margin-left: 10px;
  object-fit: cover;
  border-radius: 50%;
  order: 2;
}

.outgoing .details p {
  background: #333;
  color: #fff;
  border-radius: 18px 18px 0 18px;
}
/* Assicurati che le immagini siano visibili e ben dimensionate */
.chat img {
  max-width: 150px;
  max-height: 150px;
  border-radius: 8px;
  margin-top: 5px;
  cursor: pointer;
  object-fit: cover;
  display: block;  
}
/* Aggiungi questa regola per forzare la visualizzazione */
.chat img {
  display: inline-block;
  max-width: 150px;  /* Dimensione massima immagine */
  max-height: 150px;
  object-fit: cover;  /* Assicura che l'immagine sia correttamente visualizzata senza distorsioni */
  border-radius: 8px;
  margin-top: 5px;
  cursor: pointer;
}

/* Typing area */
.typing-area {
  padding: 18px 30px;
  display: flex;
  justify-content: space-between;
}

.typing-area input {
  height: 45px;
  width: calc(100% - 58px);
  font-size: 16px;
  padding: 0 13px;
  border: 1px solid #e6e6e6;
  outline: none;
  border-radius: 5px 0 0 5px;
}

.typing-area button {
  height: 45px;
  color: #fff;
  width: 55px;
  border: none;
  outline: none;
  background: #333;
  font-size: 19px;
  cursor: pointer;
  opacity: 0.7;
  pointer-events: none;
  border-radius: 0 5px 5px 0;
  transition: all 0.3s ease;
}

.typing-area button.active {
  opacity: 1;
  pointer-events: auto;
}

/* File upload */
.file-label {
  display: inline-block;
  cursor: pointer;
  margin-left: 10px;
  color: #333;
  font-size: 18px;
}

.file-label:hover {
  color: #555;
}

/* Buttons */
.buttons a,
.buttons button {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Edit Profile */
.edit-profile-form input {
  width: 100%;
  padding: 10px;
  margin: 5px 0 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  box-sizing: border-box;
}

.edit-profile-form label {
  font-size: 14px;
  margin-bottom: 5px;
  display: block;
}

.edit-profile-form input:focus {
  border-color: #007BFF;
  outline: none;
}

.edit-profile-form button {
  padding: 10px 20px;
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 15px;
}

.edit-profile-form button:hover {
  background-color: #0056b3;
}
.outgoing .message-time {
  display: block;
  font-size: 8px;
  color: #999;
  margin-top: 5px;
  text-align: right; /* ORA allineato a destra per messaggi inviati */
}

.incoming .message-time {
  display: block;
  font-size: 8px;
  color: #999;
  margin-top: 5px;
  text-align: left; /* ORA allineato a sinistra per messaggi ricevuti */
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body {
    background: #121212;
    color: #fff;
  }
.loginl path {
  fill: #fff; /* colore in dark mode */
}
  .wrapper {
    background: #1e1e1e;
  }

  .form header,
  .users header,
  .chat-area header .details span {
    color: #fff;
  }

  .form form .input input,
  .form form .image input,
  .users .search input {
    background: #333;
    color: #fff;
    border: 1px solid #555;
  }

  .form form .button input,
  .users header .logout,
  .users .search button.active,
  .typing-area button.active {
    background: #fff;
    color: #333;
  }

  .form .link a {
    color: #fff;
    font-weight:bold;
  }
  
 .field.checkbox a {
  color: #FFF;
  font-weight:bold;
  text-decoration: none;
}

  .users-list a .details span,
  .users-list a .details p {
    color: #fff;
  }

  .chat-box {
    background: #121212;
    box-shadow: none;
  }
  
  .chat-box .outgoing .details p {
    background: #fff;
    color: #333;
  }

  .chat-box .incoming .details p {
    background: #333;
    color: #fff;
  }

  .chat-area header .back-icon {
    color: #fff;
  }

  .typing-area input {
    background: #333;
    color: #fff;
    border: 1px solid #555;
  }

  :is(.users, .users-list) .content .details {
    color: #fff;
  }
  .outgoing .message-time,
  .incoming .message-time {
    color: #bbb;
  }
}
}

/* Responsive */
@media screen and (max-width: 450px) {
  .form, .users {
    padding: 20px;
  }
  .form header {
    text-align: center;
  }
  .form form .name-details {
    flex-direction: column;
  }
  .form .name-details .field:first-child,
  .form .name-details .field:last-child {
    margin: 0;
  }
  .chat-area header {
    padding: 15px 20px;
  }
  .chat-box {
    min-height: 400px;
    padding: 10px 15px 15px 20px;
  }
  .chat-box .chat p {
    font-size: 15px;
  }
  .chat-area form {
    padding: 20px;
  }
}