body {
  background: #f5f6fa;
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
}

#chat-container {
  max-width: 900px;
  margin: 40px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: row;
  height: 600px;
  overflow: hidden;
}

#user-list {
  width: 220px;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  background: #fafafa;
}

#user-list-header {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

#users {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
}

#chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#chat-header {
  padding: 12px 16px;
  background: #f7f7fa;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 12px;
}

#chat-header h2 {
  margin: 0 0 8px 0;
  font-size: 20px;
  color: #0078fe;
}

#chat-header input {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #ddd;
  font-size: 14px;
  margin-bottom: 4px;
  background: #fff;
}

#messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f0f2f5;
}

.message {
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 15px;
  word-break: break-word;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  margin-bottom: 2px;
  display: inline-flex;
  flex-direction: column;
}

.message.user {
  background: #0078fe;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message.bot {
  background: #e4e6eb;
  color: #222;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 6px;
  align-self: flex-end;
}

.message.bot .message-time {
  align-self: flex-start;
}

#input-area {
  display: flex;
  padding: 16px;
  background: #fff;
  border-top: 1px solid #eee;
}

.user-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.user-item:hover {
  background: #fff;
}

.user-item.online {
  font-weight: 600;
}

.user-badge {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.user-badge.online {
  background: #2ecc71;
}

.user-badge.offline {
  background: #c4c4c4;
}

#input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid #ddd;
  font-size: 15px;
  outline: none;
  margin-right: 8px;
  background: #f7f7fa;
  transition: border 0.2s;
}

#input:focus {
  border: 1.5px solid #0078fe;
}

#send {
  background: #0078fe;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0 22px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

#send:hover {
  background: #005bb5;
}
