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

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 16px;
  color: #2d3748;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: white;
  margin-bottom: 24px;
  position: relative;
}

header h1 {
  font-size: 32px;
  margin-bottom: 8px;
  font-weight: 600;
}

header p {
  opacity: 0.9;
  font-size: 16px;
  margin-bottom: 12px;
}

.clear-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.chat-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 600px;
}

.messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  display: flex;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

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

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

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

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

.message.assistant .message-avatar {
  background: #e8e4f0;
}

.message-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
  word-wrap: break-word;
}

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

.message.assistant .message-content {
  background: #f7fafc;
  color: #2d3748;
  border-bottom-left-radius: 4px;
  border: 1px solid #e8e4f0;
}

.message.assistant.streaming .message-content::after {
  content: '▋';
  animation: blink 1s infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.tool-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff5e6;
  border: 1px solid #ffe0b3;
  border-radius: 8px;
  font-size: 13px;
  color: #8b6914;
  margin-bottom: 8px;
}

.tool-indicator::before {
  content: '⚙️';
}

.input-area {
  display: flex;
  gap: 8px;
  padding: 16px;
  background: #f7fafc;
  border-top: 1px solid #e8e4f0;
}

#messageInput {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e8e4f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

#messageInput:focus {
  border-color: #8b7fc7;
}

#sendBtn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

#sendBtn:hover:not(:disabled) {
  transform: translateY(-1px);
}

#sendBtn:active:not(:disabled) {
  transform: translateY(0);
}

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

.info {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  text-align: center;
  backdrop-filter: blur(10px);
}

.info strong {
  font-weight: 600;
}

.quick-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.quick-btn {
  background: white;
  color: #667eea;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quick-btn:active {
  transform: translateY(0);
}

.welcome-message {
  text-align: center;
  padding: 48px 24px;
  color: #718096;
}

.welcome-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  75% { transform: rotate(-20deg); }
}

.welcome-message h2 {
  font-size: 24px;
  color: #2d3748;
  margin-bottom: 8px;
  font-weight: 600;
}

.welcome-message p {
  font-size: 15px;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

.error-message {
  padding: 12px 16px;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 8px;
  color: #c33;
  margin: 8px 24px;
  animation: slideIn 0.3s ease;
}

/* Scrollbar styling */
.messages::-webkit-scrollbar {
  width: 8px;
}

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

.messages::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

@media (max-width: 640px) {
  .chat-container {
    height: calc(100vh - 220px);
  }
  
  .message-content {
    max-width: 85%;
  }
  
  header h1 {
    font-size: 24px;
  }
  
  .quick-actions {
    flex-direction: column;
  }
  
  .quick-btn {
    width: 100%;
  }
  
  .welcome-message {
    padding: 32px 16px;
  }
  
  .welcome-icon {
    font-size: 48px;
  }
}