* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: #0f1729;
  color: #e2e8f0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  text-align: center;
  padding: 1.5rem;
  background: #1e293b;
  border-radius: 12px;
  margin-bottom: 1rem;
}
#clearChat {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 0.2rem 0.2rem;
  font-size: 0.85rem;
  background: #dc2626;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: background 0.3s ease;
  width: 50px;
}

#clearChat:hover {
  background: #b91c1c;
}
h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(45deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: #94a3b8;
}

.chat-container {
  flex-grow: 1;
  height: calc(100vh - 180px);
  background: #1e293b;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.user-avatar {
  background: #7c3aed;
}

.message-content {
  flex: 1;
  background: #2d3748;
  padding: 1rem;
  border-radius: 12px;
  line-height: 1.5;
}

.user-message .message-content {
  background: #3730a3;
}

.input-container {
  position: sticky;
  bottom: 0;
  padding: 1rem;
  background: rgba(45, 55, 72, 0.9);
  backdrop-filter: blur(10px);
  z-index: 50;
}

.input-form {
  display: flex;
  gap: 1rem;
}

textarea {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #4a5568;
  border-radius: 8px;
  background: #1a202c;
  color: #e2e8f0;
  font-size: 1rem;
  resize: none;
  min-height: 50px;
  max-height: 150px;
}

textarea:focus {
  outline: none;
  border-color: #4f46e5;
}

button {
  padding: 0.75rem 1.5rem;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
  font-weight: 500;
}

button:hover {
  background: #4338ca;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.typing-indicator {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  color: #94a3b8;
  align-items: center;
}

.dot {
  width: 8px;
  height: 8px;
  background: #4f46e5;
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}
.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0.5rem;
  }

  header {
    padding: 1rem;
  }

  .chat-messages {
    padding: 1rem;
  }

  .message-content {
    font-size: 0.95rem;
  }
}
