.chat-window {
  position: fixed;
  bottom: 15px;
  right: 10px;
  width: 320px;
  height: 450px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  z-index: 2;
}

.chat-header {
  background: #a81b1b;
  color: white;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h2 {
  font-weight: 700;
  font-size: 1.25rem;
}

.close-chat {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-chat:hover {
  color: #ff6666;
}

.chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.message.user {
  align-self: flex-end;
}

.message.bot .text-content {
  background: #e3e3e3;
  color: #222;
  border-radius: 15px 15px 15px 0;
  padding: 10px 15px;
  max-width: 80%;
  animation: fadeInUp 0.3s ease forwards;
}

.message.user .text-content {
  background: #dae7ff;
  color: black;
  border-radius: 15px 15px 0 15px;
  padding: 10px 15px;
  max-width: 80%;
  align-self: flex-end;
  animation: fadeInUp 0.3s ease forwards;
}

.message img {
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-input {
  padding: 10px 15px;
  border-top: 1px solid #ccc;
  display: flex;
  gap: 10px;
  background: white;
}

.chat-input input[type="text"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #aaa;
  border-radius: 20px;
  font-size: 1rem;
  outline-offset: 2px;
  transition: border-color 0.3s ease;
}

.chat-input input[type="text"]:focus {
  border-color: #0044cc;
}

.chat-input button {
  background: #a81b1b;
  color: white;
  border: none;
  padding: 8px 18px;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.chat-input button:hover {
  background: #aa3636;
}

#input-error {
  color: red;
  font-size: 0.875rem;
  margin: 5px 15px 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}