.chat-input-container {
  display: flex;
  align-items: center;
  border-top: 1px solid #d2d2d7;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 16px;
}


.send-button {
  font-size: 20px;
  margin-left: 12px;
  padding: 15px !important;
}










/* Einzelner Chat-Eintrag */
.chat_item {
  display: flex;
  align-items: center; /* Vertikale Zentrierung */
  background-color: #FFFFFF;
  padding: 12px 16px;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px solid #f0f0f0;
  width: 100%;
  gap: 12px; /* Abstand zwischen Avatar und rechtem Bereich */
   box-sizing: border-box;
}

/* Linker Bereich: NUR der Avatar */
.chat_item_left {
  flex-shrink: 0; /* Verhindert Schrumpfen */
   box-sizing: border-box;
}

/* Rechter Bereich: Text + Ungelesen-Zähler */
.chat_item_right {
  display: flex;
  flex-direction: column;
  flex: 1; /* Nimmt den verfügbaren Platz ein */
  min-width: 0; /* Verhindert Überlauf */
   box-sizing: border-box;
}




/* Anpassungen für Mobilgeräte */
@media (max-width: 768px) {

  .chat_item {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
  }
}






/* Avatar */
/* Status-Symbole kleiner */
.message_status .icon {
  font-size: 16px; /* Standardgröße anpassen */
  transform: scale(1); /* 20% kleiner */
  display: inline-block;
  vertical-align: middle;
}

/* Avatar als blauer Kreis mit Icon */
.chat_avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #0000DE;
  color: white;
  display: inline-flex; /* WICHTIG: inline-flex statt flex */
  justify-content: center;
  align-items: center;
  flex-shrink: 0; /* Verhindert Schrumpfen */
}

.chat_avatar .icon {
  font-size: 28px;
}

/* Textbereich (Name + Nachricht) */
.chat_content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0; /* Verhindert Text-Überlauf */
}

/* Oberste Zeile: Name + Zeit */
.chat_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat_name {
  font-weight: 600;
  font-size: 16px;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat_time {
  font-size: 13px;
  color: #999;
  flex-shrink: 0;
}

/* Unterste Zeile: Nachricht + Status */
.chat_message {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.message_text {
  font-size: 14px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.message_status {
  font-size: 15px;
  color: #999;
  margin-left: 8px;
  flex-shrink: 0;
}

/* Ungelesen-Zähler  */
.unread_indicator {
  margin-left: 8px;
  background-color: #FF9800;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
}

/* Fallback für Browser ohne :has() */
.chat_item {
  padding-right: 44px; /* Platz für Ungelesen-Zähler */
}




/* Link als Block-Element (für klickbaren chat_item) */
.chat_item_link {
  text-decoration: none;
  color: inherit; /* Erbt die Textfarbe */
  display: block;
  width: 100%;
}

.chat_item_link:hover {
  background-color: #f5f5f5; /* Leichter Hover-Effekt (optional) */
}








.new_messages_notification {
  background-color: #FF8800;
  border-radius: 50%;
  font-size: 20px;
  color: #FFFFFF;
  padding: 4px;
  width: 20px;
  height: 20px;
  text-align: center;
  right: 0px;
}


.open_chat_link {
  font-size: 25px;
  color: #444444;
}





@media (prefers-color-scheme: dark)
{
  .chat_item {
    background-color: #000;
  }
  .chat_name {
    color: #eee;
  }
  .chat_time {
    color: #999;
  }
  .message_text {
    color: #999;
  }
  .message_status {
    color: #999;
  }
  .unread_indicator {
    margin-left: 8px;
    background-color: #FF9800;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
  }
}










.chat-messages-box-item {
  padding: 8px 10px;
  width: 100%;
  box-sizing: border-box;
}
/*
.message {
  max-width: 70%;
  padding: 10px 18px;
  border-radius: 25px;
  overflow-wrap: break-word;
  min-width: 0;
  box-shadow: 0 1px 2px #AAAAAA;
}

.message.received {
  margin-right: auto;
  background-color: #e5e5ea;
  color: #1c1c1e;
  border-bottom-left-radius: 4px;
}

.message.sent {
  margin-left: auto;
  background-color: #007AFF;
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: 14px;
  margin-top: 4px;
  text-align: right;
  color: rgba(255, 255, 255, 0.7);
}

.message-time > span.icon {
  font-size: 18px;
}

.message.received .message-time {
  color: rgba(28, 28, 30, 0.5);
}*/



.message {
  max-width: 70%;
  padding: 12px 20px;
  border-radius: 25px;
  overflow-wrap: break-word;
  min-width: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding-bottom: 4px;
}

.message > p {
  margin: 2px;
}

.message.received {
  margin-right: auto;
  background-color: #F5F5F5; /* Sehr helles Grau */
  color: #1c1c1e;
  border: 1px solid #E0E0E0; /* Leichter Grau-Rahmen */
  border-bottom-left-radius: 4px;
}

.message.sent {
  margin-left: auto;
  background-color: #1976D2; /* Dunkles Blau */
  color: #FFFFFF;
  border: 1px solid #1565C0; /* Leichter Blau-Rahmen */
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: 12px;
  margin: 0px;
  text-align: right;
  opacity: 0.8;
}

.message.received .message-time {
  color: rgba(28, 28, 30, 0.5); /* Grau für empfangene Nachrichten */
}

.message.sent .message-time {
  color: #FFFFFF; /* Weiß für gesendete Nachrichten */
}

.message-time > span.icon {
  font-size: 18px;
  margin-left: 4px;
}



@media (prefers-color-scheme: dark)
{
  .message {
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.3);
  }

  .message.received {
    background-color: #111;
    color: #eee;
    border: 1px solid #555555;
  }

  .message.sent {
    background-color: #001060;
    color: #FFFFFF;
    border: 1px solid #1565C0;
  }

  .message-time {
  }

  .message.received .message-time {
    color: rgba(255, 255, 255, 0.8);
  }

  .message.sent .message-time {
    color: #FFFFFF;
  }
}