* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d1810 100%);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#chat-container {
  width: 100%;
  max-width: 900px;
  height: 90vh;
  background: #1a1a1a;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  border: 2px solid #4a0e0e;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: linear-gradient(135deg, #2d1810 0%, #4a0e0e 100%);
  color: #e0e0e0;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  border-bottom: 2px solid #6b1818;
}

.chat-header h2 {
  font-size: 24px;
  font-weight: 600;
}

.header-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-count {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 0, 0, 0.3);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  border: 1px solid rgba(139, 0, 0, 0.5);
}

.user-count span {
  font-weight: 600;
  color: #ff6b6b;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #8b0000;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 25px;
  background: #0d0d0d;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#messages::-webkit-scrollbar {
  width: 8px;
}

#messages::-webkit-scrollbar-track {
  background: #1a1a1a;
}

#messages::-webkit-scrollbar-thumb {
  background: #4a0e0e;
  border-radius: 4px;
}

#messages::-webkit-scrollbar-thumb:hover {
  background: #6b1818;
}

.bot-message, .user-message {
  animation: slideIn 0.3s ease;
  max-width: 80%;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bot-message {
  align-self: flex-start;
}

.user-message {
  align-self: flex-end;
}

.message-content {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2d1810 0%, #4a0e0e 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  border: 2px solid #6b1818;
}

.bot-message .message-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
  color: #b0b0b0;
}

.bot-message .message-text {
  background: #2a2a2a;
  padding: 14px 18px;
  border-radius: 18px;
  border-top-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  border: 1px solid #3a3a3a;
  line-height: 1.6;
  color: #d0d0d0;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.user-message .message-content {
  flex-direction: column;
  align-items: flex-end;
}

.user-message .message-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
  color: #b0b0b0;
}

.user-message .message-text {
  background: linear-gradient(135deg, #4a0e0e 0%, #6b1818 100%);
  color: #e0e0e0;
  padding: 14px 18px;
  border-radius: 18px;
  border-top-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(74, 14, 14, 0.5);
  border: 1px solid #8b0000;
  line-height: 1.6;
  word-wrap: break-word;
}

.time {
  opacity: 0.6;
  font-size: 11px;
  font-weight: 400;
}

#typing-indicator {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 25px 15px 25px;
  background: #0d0d0d;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 12px 18px;
  background: #2a2a2a;
  border-radius: 18px;
  border: 1px solid #3a3a3a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #8b0000;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
}

.message-input {
  display: flex;
  gap: 12px;
  padding: 20px 25px;
  background: #1a1a1a;
  border-top: 2px solid #4a0e0e;
}

#message-input {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid #3a3a3a;
  border-radius: 25px;
  font-size: 15px;
  transition: all 0.3s;
  background: #2a2a2a;
  color: #e0e0e0;
}

#message-input:focus {
  outline: none;
  border-color: #6b1818;
  background: #333;
}

#message-input::placeholder {
  color: #666;
}

#send-btn {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #4a0e0e 0%, #6b1818 100%);
  color: #e0e0e0;
  border: 2px solid #8b0000;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(74, 14, 14, 0.5);
}

#send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 0, 0, 0.6);
  background: linear-gradient(135deg, #6b1818 0%, #8b0000 100%);
}

#send-btn:active {
  transform: translateY(0);
}

.error-message .message-text {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca;
}

@media (max-width: 768px) {
  #chat-container {
    height: 100vh;
    border-radius: 0;
    max-width: 100%;
  }

  .bot-message, .user-message {
    max-width: 90%;
  }

  .bot-avatar {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  .chat-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }
}

