/* Модальное окно */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: linear-gradient(135deg, #6e48aa, #9d50bb);
  margin: 5% auto;
  padding: 0;
  width: 90%;
  max-width: 500px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px 15px 0 0;
}

.modal-header h2 {
  margin: 0;
  color: white;
}

.close-btn {
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #ff4757;
}

/* Стили чата внутри модального окна */
.chat-messages {
  height: 300px;
  overflow-y: auto;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
}

.message {
  margin-bottom: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message .author {
  font-weight: bold;
  color: #ffdd59;
  margin-right: 5px;
}

.message .text {
  color: white;
}

.message .time {
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 10px;
}

.chat-input {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0 0 15px 15px;
}

.chat-input input {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.chat-input input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #6e48aa;
}

.chat-input button {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #ff4757;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.chat-input button:hover {
  background: #ff6b81;
  transform: translateY(-2px);
}

.chat-input button:active {
  transform: translateY(0);
}

/* Адаптивность */
@media (max-width: 600px) {
  .modal-content {
    margin: 10% auto;
    width: 95%;
  }
  
  .chat-input {
    flex-direction: column;
  }
}