body {
  background: #0f172a;
  font-family: Arial;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-size: 21px;
}

.chat-container {
  width: 95%;
  height: 95%;
  max-width: 700px;
  background: #1e293b;
  border-radius: 15px;
  padding: 15px;

  display: flex;
  flex-direction: column;  /* 🔥 important */
}

#chat {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 10px;

  display: flex;            /* 🔥 enable flex for column stacking */
  flex-direction: column;   /* messages go top → bottom */
  gap: 6px;                 /* spacing between messages */
}

.message {
  display: inline-flex;        /* align text + info horizontally */
  align-items: flex-end;       /* bottom-align text and info */
  gap: 6px;                     /* spacing between text and time */
  min-width: 60px;
  padding: 12px 16px;
  border-radius: 14px;
  max-width: 75%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.msg-text {
  display: inline;             /* just normal text */
}

.msg-info {
  font-size: 10px;
  color: #cbd5e1;              /* light gray */
  flex-shrink: 0;              /* keeps it from wrapping */
}

.bot {
  background: #334155;
  color: white;

  align-self: flex-start;      /* left side */
  width: fit-content;          /* 🔥 only as wide as text */
  border-bottom-left-radius: 4px;
}

.user {
  background: #3b82f6;
  color: white;

  align-self: flex-end;        /* right side */
  width: fit-content;          /* 🔥 only as wide as text */
  border-bottom-right-radius: 4px;
}


.input-area {
  display: flex;
  height: 50px;
}

input {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: none;
  font-size: 20px;
}

button {
  margin-left: 5px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: #22c55e;
  color: white;
  cursor: pointer;
  font-size: 20;
}

.chat-header {
  display: flex;
  flex-direction: column;
  align-items: center;   /* 🔥 centers everything */
  justify-content: center;

  padding-bottom: 15px;
  margin-bottom: 10px;
  border-bottom: 1px solid #334155;
}

.avatar-wrapper {
  position: relative;   /* 🔥 allows dot positioning */
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.info {
  display: flex;
  flex-direction: column;
}

.name {
  color: white;
  font-weight: bold;
  font-size: 18px;
  margin-top: 8px;
}

.status-dot {
  position: absolute;
  bottom: 3px;
  right: 3px;

  width: 14px;
  height: 14px;
  background: #22c55e;
  border-radius: 50%;

  border: 2px solid #1e293b; /* 🔥 makes it pop */
}


.msg-status {
  color: #22c55e; /* green check marks */
}