/* === Общие стили === */
body {
  margin: 0;
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  background-color: #1e1e1e;
  color: #f0f0f0;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

h1, h2 {
  margin: 0 0 20px;
  font-weight: 500;
}

a {
  color: #0088cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* === Боковая панель === */
.sidebar {
  width: 240px;
  background-color: #2c2c2c;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-block img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-meta a {
  color: #f0f0f0;
  font-size: 14px;
}

.logout-btn {
  color: #ff6b6b;
  font-weight: bold;
  font-size: 13px;
}

/* === Меню навигации === */
.menu a {
  display: block;
  color: #ccc;
  padding: 8px 0;
  font-size: 15px;
}

.menu a:hover {
  color: #fff;
}

/* === Страница чата === */
.chat-content {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-window {
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  background-color: #2a2a2a;
  padding: 10px 14px;
  border-radius: 8px;
  max-width: 80%;
}

.message strong {
  color: #0088cc;
  display: block;
  margin-bottom: 4px;
}

/* === Вложения === */
.attachment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #2c2c2c;
  padding: 10px;
  border-radius: 8px;
  margin-top: 6px;
}

.attachment-icon {
  font-size: 24px;
}

.attachment-info {
  display: flex;
  flex-direction: column;
}

.attachment-info a {
  color: #00afff;
  font-size: 14px;
  text-decoration: none;
}

.attachment-info a:hover {
  text-decoration: underline;
}

.attachment-ext {
  font-size: 12px;
  color: #aaa;
}

/* === Превью изображений === */
.attachment-preview {
  max-width: 200px;
  max-height: 200px;
  border-radius: 6px;
  margin-top: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.attachment-preview:hover {
  transform: scale(1.02);
}

/* === Масштабирование изображений === */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 20px #000;
  cursor: zoom-out;
}

/* === Форма отправки сообщений === */
#message-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

#message-form textarea {
  resize: none;
  height: 80px;
  padding: 10px;
  border-radius: 6px;
  border: none;
  background-color: #2c2c2c;
  color: #fff;
  font-size: 14px;
}

#message-form input[type="file"] {
  color: #ccc;
  font-size: 13px;
}

#message-form button {
  background-color: #0088cc;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}

#message-form button:hover {
  background-color: #0070aa;
}

/* === Drag-and-drop === */
#message-form.drag-over {
  outline: 2px dashed #00afff;
  background-color: #2a2a2a;
}

/* === Модальное окно выбора загрузки === */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: #2c2c2c;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  color: #fff;
}

.modal-content button {
  margin: 10px;
  padding: 10px 20px;
  background: #0088cc;
  border: none;
  border-radius: 6px;
  color: white;
  cursor: pointer;
}

/* === Прогресс загрузки === */
.upload-item {
  margin-top: 6px;
  font-size: 14px;
  color: #ccc;
}

.upload-item span {
  display: inline-block;
  min-width: 80px;
}

.upload-item progress {
  width: 200px;
  height: 8px;
  vertical-align: middle;
}
