/* Сброс базовых стилей */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

/* Навигационная панель сверху */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background-color: #2c3e50;
  display: flex;
  align-items: center;
  justify-content: space-between; /* <-- важно */
  padding: 0 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 1000;
}

.brand{
  margin-right: auto;          /* <-- прижать влево */
  font-weight: 700;
  text-decoration: none;
  color: #fff;                 /* <-- белая */
}

.brand:hover{
  color: #fff;
}


/* Меню пользователя */
.user-menu {
  position: relative;
  color: white;
  cursor: pointer;
  user-select: none;
  outline: none;
}

.user-menu .username {
  font-weight: bold;
}

/* Дропдаун меню скрыто по умолчанию */
.dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border: 1px solid #ccc;
  min-width: 140px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: none;
  z-index: 10;
}

/* Показать дропдаун, когда активен */
.user-menu.active .dropdown {
  display: block;
}

/* Кнопка выхода */
#logoutBtn {
  width: 100%;
  padding: 10px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #333;
}

#logoutBtn:hover {
  background-color: #f2f2f2;
}

/* Контейнер для формы - центрируем */
.login-container {
  min-height: calc(100vh - 50px); /* учитываем navbar */
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #ecf0f1;
  padding: 30px 20px;
}

/* Увеличенное окно авторизации */
.login-form {
  background-color: white;
  padding: 40px 60px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  width: 420px; /* увеличена ширина */
  max-width: 100%;
}

/* Заголовок формы */
.login-form h2 {
  margin-bottom: 25px;
  color: #2c3e50;
  text-align: center;
}

/* Метки и инпуты */
.login-form label {
  display: block;
  margin-bottom: 10px;
  color: #34495e;
  font-weight: 600;
  font-size: 15px;
}

.login-form input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 25px;
  border: 1px solid #bdc3c7;
  border-radius: 5px;
  font-size: 15px;
  transition: border-color 0.3s;
}

.login-form input[type="email"]:focus {
  border-color: #2980b9;
  outline: none;
}

/* Кнопка входа */
.login-form button[type="submit"] {
  width: 100%;
  padding: 14px;
  background-color: #2980b9;
  border: none;
  border-radius: 5px;
  color: white;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.login-form button[type="submit"]:hover {
  background-color: #1c5980;
}

.chat-wrapper {
  min-height: calc(100vh - 50px); /* учитываем navbar */
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #ecf0f1;
  padding: 30px 20px;
}

.chat-container {
  width: 500px;
  max-width: 100%;
  margin: 30px auto 0;
  background: white;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  height: 600px;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  border-bottom: 2px solid #ddd;
  font-family: Arial, sans-serif;
  font-size: 15px;
  color: #333;
  background-color: #fafafa;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  border-bottom: 2px solid #ddd;
  font-family: Arial, sans-serif;
  font-size: 15px;
  color: #333;
  background-color: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 15px; /* расстояние между сообщениями */
}

/* Новый контейнер для каждого сообщения */
.message-wrapper {
  display: flex;
}

/* Сообщения пользователя - выравниваем вправо */
.message-wrapper.user {
  justify-content: flex-end;
}

/* Сообщения бота - выравниваем влево */
.message-wrapper.bot {
  justify-content: flex-start;
}

/* Сообщение */
.message {
  display: inline-flex;       /* адаптивная ширина под текст */
  max-width: 75%;             /* не шире 75% от контейнера */
  padding: 10px 15px;
  border-radius: 15px;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  align-items: center;
  background-clip: padding-box;
  font-size: 15px;
}

/* Иконка */
.message::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

/* Стиль иконок и цветов */
.message.user {
  background-color: #d6e9ff;
  color: #2980b9;
  text-align: right;
  border-bottom-right-radius: 0;
}

.message.user::before {
  content: '👤';
  margin-left: 10px;
  margin-right: 0;
  order: 2;
}

.message.bot {
  background-color: #d0f0d6;
  color: #27ae60;
  text-align: left;
  border-bottom-left-radius: 0;
}

.message.bot::before {
  content: '🤖';
}
/* Форма чата */
.chat-form {
  display: flex;
  padding: 15px 20px;
  background-color: #fff;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.chat-form input[type="text"] {
  flex: 1;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid #bdc3c7;
  border-radius: 5px 0 0 5px;
  outline: none;
  transition: border-color 0.3s;
}

.chat-form input[type="text"]:focus {
  border-color: #2980b9;
}

.chat-form button {
  padding: 14px 24px;
  border: none;
  background-color: #2980b9;
  color: white;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  border-radius: 0 5px 5px 0;
  transition: background-color 0.3s;
}

.chat-form button:hover {
  background-color: #1c5980;
}

html, body {
  height: 100%;
}

body.page{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* контентная часть между navbar и footer */
.content{
  flex: 1;
  padding-top: 50px;  /* высота navbar */
}

/* футер всегда снизу */
.footer{
  margin-top: auto;
  text-align:center;
  padding: 12px 0;
  opacity: .8;
}
.footer a{ text-decoration: none; }
