.chat-container {
  display: flex;
  height: 100vh;
  background-color: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  background-color: #2c3e50;
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar h3 {
  margin: 0 0 10px 0;
  font-size: 1.2em;
  font-weight: 600;
}

.user-list li {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #34495e;
  font-size: 0.95em;
}

.main-chat {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background-color: white;
}

.messages-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #f9f9fb;
  padding: 20px;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.received {
  align-self: flex-start;
  background-color: #e9e9eb;
  color: #333;
}

.message.sent {
  align-self: flex-end;
  background-color: #0b93f6;
  color: white;
}

.message-form {
  display: flex;
  padding: 12px;
  gap: 8px;
  background-color: #f0f0f0;
  border-top: 1px solid #ddd;
}

.message-form input {
  flex-grow: 1;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}

.message-form input:focus {
  border-color: #0b93f6;
}

.message-form button {
  padding: 0 20px;
  background-color: #0b93f6;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.message-form button:hover {
  background-color: #0a84e0;
}

.message-sender {
  font-weight: bold;
  font-size: 0.85em;
  margin-bottom: 4px;
}

.message-text {
  word-wrap: break-word;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  position: relative;
}

.modal h2 {
  margin: 0 0 20px 0;
  font-size: 1.4em;
  color: #333;
  font-weight: 600;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nickname-input {
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.nickname-input:focus {
  border-color: #0b93f6;
}

.nickname-input:invalid {
  border-color: #e74c3c;
}

.nickname-input::placeholder {
  color: #aaa;
}

.modal-form button {
  padding: 12px;
  background-color: #0b93f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.modal-form button:hover {
  background-color: #0a84e0;
}

.modal-form button:disabled {
  background-color: #9fb6df;
  cursor: not-allowed;
}

.hidden {
  display: none;
}

.error-message {
  color: #e74c3c;
  font-size: 0.9em;
  margin-top: 5px;
  min-height: 20px;
  text-align: center;
}

