
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.chat-container {
  width: 400px;
  height: 600px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.chat-header {
  padding: 18px;
  background: #2563eb;
  color: white;
}

.chat-header h3 {
  font-size: 18px;
}

.chat-header span {
  font-size: 13px;
  opacity: 0.8;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.bot {
  background: white;
  align-self: flex-start;
  border: 1px solid #ddd;
}

.message.user {
  background: #2563eb;
  color: white;
  align-self: flex-end;
}

.chat-input {
  display: flex;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #eee;
  background: white;
}

.chat-input input {
  flex: 1;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  font-size: 15px;
}

.chat-input input:focus {
  border-color: #2563eb;
}

.chat-input button {
  padding: 0 20px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.chat-input button:hover {
  background: #1d4ed8;
}

.chat-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;

  width: 60px;
  height: 60px;

  border: none;
  border-radius: 50%;

  background: #2563eb;
  color: white;
  font-size: 26px;
  cursor: pointer;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);

  transition: 0.25s;
  z-index: 1000;
}

.chat-toggle:hover {
  transform: scale(1.08);
}

.chat-container {
  position: fixed;
  right: 24px;
  bottom: 96px;

  width: 380px;
  height: 550px;

  display: flex;
  flex-direction: column;

  background: white;
  border-radius: 16px;
  overflow: hidden;

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);

  transform: translateY(20px) scale(0.95);
  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.25s,
    transform 0.25s,
    visibility 0.25s;

  z-index: 999;
}

.chat-container.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

@media (max-width: 480px) {
  .chat-container {
    right: 12px;
    left: 12px;
    width: auto;
    height: 70vh;
    bottom: 84px;
  }

  .chat-toggle {
    right: 16px;
    bottom: 16px;
  }
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: typing 1.4s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}
