/* Reset and Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333333;
  background: #f5f5f5;
}

body {
  margin: 0;
  padding: 0;
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 24px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 14px;
  color: #666666;
}

/* Chat Container */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  min-height: 500px;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.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.ai {
  align-self: flex-start;
}

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

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

.message.ai .message-avatar {
  background: #2563eb;
  color: white;
}

.message.user .message-avatar {
  background: #16a34a;
  color: white;
}

.message-content {
  background: #f5f5f5;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

.message.user .message-content {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.message-text {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

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

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666666;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

/* Chat Input */
.chat-input-container {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid #e0e0e0;
  background: #fafafa;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  resize: none;
  max-height: 120px;
  background: white;
}

.chat-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px #2563eb20;
}

.btn-send {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-send:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Profile Result */
.profile-result {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 32px;
  animation: fadeIn 0.5s ease;
}

.profile-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}

.profile-header h2 {
  font-size: 28px;
  font-weight: 600;
  color: #2563eb;
  margin-bottom: 8px;
}

.profile-header p {
  font-size: 16px;
  color: #666666;
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.profile-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 12px;
}

.profile-section p {
  font-size: 14px;
  color: #666666;
  line-height: 1.6;
}

.profile-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-section li {
  font-size: 14px;
  color: #666666;
  padding-left: 20px;
  position: relative;
}

.profile-section li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #2563eb;
  font-weight: bold;
}

/* Buttons */
.btn-primary {
  display: block;
  width: 100%;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 500;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: #1d4ed8;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 12px;
  }
  
  .header {
    padding: 16px;
  }
  
  .header h1 {
    font-size: 20px;
  }
  
  .chat-messages {
    padding: 16px;
  }
  
  .message {
    max-width: 90%;
  }
  
  .profile-result {
    padding: 20px;
  }
  
  .profile-header h2 {
    font-size: 24px;
  }
}