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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
  color: #e0e0e0;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 20px;
}

header h1 {
  font-size: 1.8rem;
  background: linear-gradient(90deg, #4facfe, #00f2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.subtitle {
  color: #8892b0;
  font-size: 0.95rem;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.welcome-message {
  background: rgba(79, 172, 254, 0.1);
  border: 1px solid rgba(79, 172, 254, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  color: #8892b0;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

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

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.assistant {
  align-self: flex-start;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.message.user .avatar {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.message.assistant .avatar {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.message-content {
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 12px 18px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.message.user .message-content {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
  background: rgba(255,255,255,0.08);
  border-bottom-left-radius: 4px;
}

.input-container {
  display: flex;
  gap: 12px;
  padding: 20px 0 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

#userInput {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 18px;
  color: #e0e0e0;
  font-size: 1rem;
  resize: none;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

#userInput:focus {
  border-color: rgba(79, 172, 254, 0.5);
}

#userInput::placeholder {
  color: #666;
}

#sendBtn {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
}

#sendBtn:hover {
  transform: scale(1.05);
}

#sendBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#sendBtn svg {
  width: 22px;
  height: 22px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #4facfe;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
}
