/* Модальное окно */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 10px;
  width: 300px;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
  margin-bottom: 15px;
  font-size: 20px;
}

.modal-content input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.modal-content button {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.modal-content button:hover {
  background: #0056b3;
}

.error {
  color: red;
  font-size: 14px;
  margin-top: 5px;
}

/* Основной чат */
.chat-container {
  display: flex;
  height: 100vh;
  font-family: Arial, sans-serif;
}

aside {
  width: 200px;
  background: #f5f5f5;
  padding: 10px;
  box-sizing: border-box;
  border-right: 1px solid #ccc;
}

aside h3 {
  margin-top: 0;
}

aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

aside li {
  padding: 6px 0;
}

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

.chat {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #fafafa;
}

.chat-input {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ccc;
}

.chat-input input {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.chat-input button {
  margin-left: 10px;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  background-color: #007bff;
  color: white;
  cursor: pointer;
}

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

/* Сообщения */
.message {
  margin: 6px 0;
  max-width: 70%;
  padding: 8px 12px;
  border-radius: 12px;
  line-height: 1.4;
}

.message.own {
  background-color: #daf7dc;
  align-self: flex-end;
  text-align: right;
}

.message.other {
  background-color: #f1f1f1;
  align-self: flex-start;
  text-align: left;
}

.message .meta {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.message .time {
  margin-left: 6px;
  color: #999;
  font-size: 11px;
}

.message .text {
  font-size: 14px;
  color: #222;
}
