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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
}

.container {
  max-width: 600px;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.15);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
  color: #333;
  margin-bottom: 8px;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: #666;
  margin-bottom: 40px;
  font-size: 1.2rem;
  font-weight: 500;
}

.status-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.voice-visualizer {
  margin-bottom: 20px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wave-container {
  display: flex;
  gap: 4px;
  align-items: center;
}

.wave {
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 2px;
  opacity: 0.1;
  transition: all 0.3s ease;
}

.wave:nth-child(1) { animation-delay: 0s; }
.wave:nth-child(2) { animation-delay: 0.1s; }
.wave:nth-child(3) { animation-delay: 0.2s; }
.wave:nth-child(4) { animation-delay: 0.3s; }
.wave:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 40%, 100% { transform: scaleY(0.4); opacity: 0.3; }
  20% { transform: scaleY(1); opacity: 1; }
}

.listening .wave {
  opacity: 0.4;
  background: linear-gradient(135deg, #28a745, #20c997);
}

.speaking .wave {
  opacity: 1;
  background: linear-gradient(135deg, #ff6b6b, #feca57);
  animation: wave 0.5s ease-in-out infinite;
}

.status-card {
  background: #f8f9fa;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.listening .status-card {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: #667eea;
  transform: scale(1.02);
}

.speaking .status-card {
  background: linear-gradient(135deg, #ff6b6b, #feca57);
  color: white;
  border-color: #ff6b6b;
  transform: scale(1.02);
}

#status {
  font-size: 1.3rem;
  font-weight: 700;
  color: #495057;
  margin-bottom: 12px;
}

.listening #status,
.speaking #status {
  color: white;
}

.volume-indicator {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.volume-bar {
  height: 100%;
  background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s ease;
}

.controls {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  border: none;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 180px;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.btn:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover:before {
  left: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-toggle {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-toggle:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.btn-toggle.active {
  background: linear-gradient(135deg, #28a745, #20c997);
  animation: pulse 2s infinite;
}

.btn-secondary {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 35px rgba(220, 53, 69, 0.6);
}

.btn-icon {
  font-size: 1.3em;
}

.conversation-history {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 16px;
  border: 2px solid #e9ecef;
}

.message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  animation: messageSlide 0.3s ease-out;
}

.message:last-child {
  margin-bottom: 0;
}

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

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

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

.user-avatar {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.message-content {
  flex: 1;
  text-align: left;
}

.message-text {
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  color: #333;
  line-height: 1.5;
}

.user-message .message-text {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
}

.feature-icon {
  font-size: 1.2em;
}

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

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 30px 20px;
    margin: 10px;
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .controls {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
  }
  
  .features {
    grid-template-columns: 1fr;
  }
}

/* Scrollbar styling */
.conversation-history::-webkit-scrollbar {
  width: 6px;
}

.conversation-history::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.conversation-history::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 3px;
}

.conversation-history::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
}
