/* Voice Interface Styles - Dark Theme with Three.js Orb */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #0a0a0a;
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  position: relative;
}

/* Settings Button */
.settings-button {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #666;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.settings-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.settings-button svg {
  width: 20px;
  height: 20px;
}

/* Status Bar */
.status-bar {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.875rem;
  color: #666;
  z-index: 10;
}

#status-text {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.05);
}

/* Three.js Canvas Container */
.orb-canvas {
  width: 300px;
  height: 300px;
  margin-bottom: 1rem;
  position: relative;
}

.orb-canvas canvas {
  display: block;
}

/* Prompt Text */
.prompt-container {
  text-align: center;
  margin-bottom: 1.5rem;
  min-height: 2rem;
}

.prompt {
  color: #888;
  font-size: 1.25rem;
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* Transcript Area */
.transcript-container {
  width: 100%;
  max-width: 500px;
  min-height: 100px;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.transcript {
  padding: 0.875rem 1.25rem;
  border-radius: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-height: 0;
  overflow: hidden;
}

.transcript.visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 200px;
}

.user-transcript {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.assistant-transcript {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

/* Controls */
.controls {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.mic-button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: #0a0a0a;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.mic-button:hover {
  transform: scale(1.05);
  background: #f0f0f0;
  box-shadow: 0 6px 30px rgba(255, 255, 255, 0.15);
}

.mic-button:active {
  transform: scale(0.95);
}

.mic-button.recording {
  background: #ef4444;
  color: #ffffff;
  animation: recording-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 4px 30px rgba(239, 68, 68, 0.4);
}

@keyframes recording-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
}

.mic-button svg {
  width: 32px;
  height: 32px;
}

.mic-button .stop-icon {
  display: none;
}

.mic-button.recording .mic-icon {
  display: none;
}

.mic-button.recording .stop-icon {
  display: block;
}

.end-session-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #666;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}

.end-session-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.end-session-button svg {
  width: 20px;
  height: 20px;
}

.hidden {
  display: none !important;
}

/* Hint */
.hint {
  position: absolute;
  bottom: 1.5rem;
  font-size: 0.75rem;
  color: #444;
}

.hint kbd {
  padding: 0.125rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.25rem;
  font-family: inherit;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
  font-size: 1.125rem;
  font-weight: 500;
  color: #fff;
}

.close-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #666;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}

.close-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.close-button svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: 1.5rem;
}

/* Settings */
.setting-group {
  margin-bottom: 1.5rem;
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #888;
  margin-bottom: 0.5rem;
}

.setting-value {
  display: flex;
  align-items: center;
}

.tts-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  color: #888;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tts-badge.enabled {
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
}

.voice-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.voice-select:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.voice-select:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.voice-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.voice-select option {
  background: #1a1a1a;
  color: #fff;
  padding: 0.5rem;
}

.setting-hint {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 480px) {
  .orb-canvas {
    width: 250px;
    height: 250px;
  }

  .mic-button {
    width: 64px;
    height: 64px;
  }

  .mic-button svg {
    width: 28px;
    height: 28px;
  }

  .prompt {
    font-size: 1.1rem;
  }

  .settings-button {
    top: 1rem;
    right: 1rem;
  }

  .modal-content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }
}

/* No microphone warning */
.no-mic-warning {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
  margin-bottom: 1rem;
}

/* Loading state for orb */
.orb-canvas.loading {
  display: flex;
  justify-content: center;
  align-items: center;
}

.orb-canvas.loading::after {
  content: '';
  width: 60px;
  height: 60px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
