* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont;
}

body {
  margin: 0;
  background: hsl(216, 33%, 97%);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chat-container {
  width: 100%;
  max-width: 600px;
  height: 100vh;
  background: hsl(0, 0%, 100%);
  display: flex;
  flex-direction: column;
  border-radius: 0;
}

@media (min-width: 768px) {
  .chat-container {
    height: 90vh;
    border-radius: 10px;
    box-shadow: 0 10px 30px hsla(0, 0%, 0%, 0.1);
  }
}

.chat-header {
  padding: 16px;
  font-weight: 600;
  background: hsl(215, 28%, 17%);
  color: hsl(0, 0%, 100%);
  text-align: center;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.message {
  margin-bottom: 12px;
  max-width: 80%;
  line-height: 1.4;
}

.user {
  margin-left: auto;
  background: hsl(221, 83%, 53%);
  color: hsl(0, 0%, 100%);
  padding: 10px 14px;
  border-radius: 16px 16px 0 16px;
}

.bot {
  margin-right: auto;
  background: hsl(220, 13%, 91%);
  color: hsl(221, 39%, 11%);
  padding: 10px 14px;
  border-radius: 16px 16px 16px 0;
}

.chat-input {
  display: flex;
  padding: 12px;
  border-top: 1px solid hsl(220, 13%, 91%);
}

.chat-input input {
  flex: 1;
  padding: 10px;
  border: 1px solid hsl(216, 12%, 84%);
  border-radius: 6px;
  font-size: 16px;
}

.chat-input button {
  margin-left: 8px;
  padding: 10px 16px;
  background: hsl(197, 100%, 43%);
  color: hsl(0, 0%, 100%);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.chat-input input:disabled {
  background: hsl(0, 0%, 95%);
  cursor: not-allowed;
}

.chat-input button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.translate-btn {
  margin: 4px 2px;
  padding: 4px;
  cursor: pointer;
  background: hsl(152, 100%, 33%);
  transition: ease background 0.2s;
  border-radius: 4px;
  border: 1px solid hsl(226, 100%, 87%);
}

.translate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.translate-btn:hover:not(:disabled) {
  background: hsl(152, 100%, 28%);
}

.message.typing {
  background: hsl(220, 13%, 91%);
  color: hsl(221, 39%, 11%);
  padding: 10px 14px;
  border-radius: 16px 16px 16px 0;
  display: inline-flex;
  align-items: center;
  font-style: italic;
}

.dots::after {
  content: "";
  display: inline-block;
  width: 8px;
  animation: blink 1s infinite;
  margin-left: 4px;
}

@keyframes blink {
  0%, 20%, 50%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
  60% { opacity: 1; }
}
