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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f5f5f5;
  color: #333;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  background: #fff;
}

/* Header */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 12px;
  opacity: 0.9;
}

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

.welcome-message {
  text-align: center;
  padding: 32px 16px;
  color: #666;
  margin-top: auto;
}

.welcome-message h2 {
  margin-bottom: 8px;
  color: #333;
}

/* Messages */
.message {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 85%;
  word-wrap: break-word;
  animation: slideIn 0.3s ease;
}

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

.message.user {
  align-self: flex-end;
  background: #667eea;
  color: white;
  border-radius: 18px 4px 18px 18px;
}

.message.assistant {
  align-self: flex-start;
  background: #e8e8e8;
  color: #333;
  border-radius: 4px 18px 18px 18px;
}

.message.audio {
  background: #fff3cd;
  color: #856404;
  border-left: 3px solid #ffc107;
}

/* Input area */
.input-area {
  padding: 12px;
  border-top: 1px solid #eee;
  background: #fff;
}

.input-wrapper {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

#messageInput {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#messageInput:focus {
  border-color: #667eea;
}

.audio-controls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn {
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: #f0f0f0;
}

.btn:active {
  transform: scale(0.95);
}

.btn-send {
  background: #667eea;
  color: white;
}

.btn-send:active {
  background: #5568d3;
}

.btn-record {
  background: #ff6b6b;
  color: white;
}

.btn-record.recording {
  animation: pulse 1s infinite;
  background: #ff5252;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.recording-time {
  color: #ff6b6b;
  font-weight: bold;
  font-size: 12px;
  align-self: center;
}

/* Responsive */
@media (max-width: 480px) {
  .message {
    max-width: 95%;
  }

  .header {
    padding: 12px;
  }

  .header h1 {
    font-size: 20px;
  }

  .chat-container {
    padding: 12px;
  }

  .input-area {
    padding: 10px;
  }
}

/* Scrollbar styling */
.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.chat-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}
