body {
  font-family: Arial, sans-serif;
  background-color: #f4f6f8;
  margin: 0;
  padding: 0;
}

.chat-container {
  max-width: 600px;
  margin: 40px auto;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

/* Messages box */
#messages-list {
  list-style: none;
  padding: 10px;
  height: 350px;
  overflow-y: auto;
  border-radius: 10px;
  background: #fafafa;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Each message bubble */
#messages-list {
  list-style: none;
  padding: 10px;
  height: 350px;
  overflow-y: auto;
  background: #fafafa;
  border: 1px solid #eee;
}

/* Header (username + time) */
.message-header {
  display: flex;
  justify-content: space-between; /* THIS pushes time to right */
  align-items: center;
  font-size: 0.85em;
  margin-bottom: 5px;
  color: #555;
}

/* Username styling */
.username {
  font-weight: bold;
  color: #2c3e50;
}

/* Time styling (right side) */
.timestamp {
  font-size: 0.75em;
  color: #999;
  margin-left: auto;
}

/* Message text */
.message-text {
  font-size: 1em;
  color: #222;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Form styling */
form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1em;
}

button {
  padding: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1em;
}

button:hover {
  background-color: #0056b3;
}

/* Empty state */
.empty {
  text-align: center;
  color: #888;
  padding: 20px;
}