/* Reset some default styles */
body,
h2,
h3,
ul,
li,
button,
input {
  margin: 0;
  padding: 0;
  border: 0;
  box-sizing: border-box;
}

/* Basic body styling */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f0f0f0;
}

/* Main chat application container */
#chat-app {
  display: flex;
  flex-direction: column;
  width: 600px;
  height: 400px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Login section */
#login-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}

#login-section h2 {
  margin-bottom: 20px;
}

#username {
  padding: 10px;
  width: 100%;
  margin-bottom: 10px;
}

#join-btn {
  padding: 10px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#join-btn:hover {
  background-color: #0056b3;
}

/* Chat section */
#chat-section {
  display: flex;
  flex-direction: row;
  height: 100%;
}

/* Users list section */
#users-list {
  width: 25%;
  background: #eee;
  padding: 10px;
  box-sizing: border-box;
  border-right: 1px solid #ddd;
}

#users-list h3 {
  margin-bottom: 10px;
}

#online-users {
  list-style: none;
  padding: 0;
}

#online-users li {
  margin-bottom: 5px;
}

/* Messages section */
#messages-section {
  width: 75%;
  display: flex;
  flex-direction: column;
  padding: 10px;
  box-sizing: border-box;
}

/* Formatting buttons */
#formatting-buttons {
  margin-bottom: 10px;
}

#formatting-buttons button {
  margin-right: 5px;
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #f8f9fa;
  cursor: pointer;
}

#formatting-buttons button:hover {
  background: #e2e6ea;
}

/* Change username section */
#change-username-section {
  margin-bottom: 10px;
}

#new-username {
  padding: 5px;
  margin-right: 5px;
  width: 80%;
}

#change-username-btn {
  padding: 5px;
  background-color: #28a745;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

#change-username-btn:hover {
  background-color: #218838;
}

/* Messages display area */
#messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 10px;
  border-bottom: 1px solid #ddd;
  padding-right: 5px;
}

/* Typing notification */
#typing-notification {
  margin-bottom: 10px;
}

/* Message input and send button */
#message-input {
  width: calc(100% - 100px);
  padding: 5px;
}

#send-btn {
  width: 90px;
  padding: 5px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

#send-btn:hover {
  background-color: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
  #chat-app {
    width: 100%;
    height: 100vh;
  }

  #chat-section {
    flex-direction: column;
  }

  #users-list {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }

  #messages-section {
    width: 100%;
  }
}
