/* Sil voice — mic button, voice status, camera, streaming indicators */

.voice-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.voice-link:hover {
  color: var(--accent-hover);
}

/* Voice mode (standalone) */

.voice-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 140px);
  gap: 2rem;
  user-select: none;
  -webkit-user-select: none;
}

.voice-status {
  font-size: 1.1rem;
  color: var(--muted);
  text-align: center;
  min-height: 1.6em;
  transition: color 0.2s;
}

.voice-status.active {
  color: var(--accent);
}

.voice-status.speaking {
  color: var(--fg);
}

.voice-status.error {
  color: var(--error);
}

.voice-status.reconnecting {
  color: var(--muted);
  font-style: italic;
}

.voice-mic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--card-bg);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.voice-mic:hover {
  background: var(--accent);
  color: white;
}

.voice-mic.active {
  background: var(--accent);
  color: white;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.4); }
  50% { box-shadow: 0 0 0 20px rgba(124,58,237,0); }
}

.voice-end {
  padding: 0.75rem 2rem;
  background: none;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
}

.voice-end:hover {
  color: var(--error);
  border-color: var(--error);
}

.voice-transcript-area {
  width: 100%;
  max-width: 600px;
  max-height: 40vh;
  overflow-y: auto;
  text-align: left;
  padding: 0 1rem;
}

.voice-transcript-heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.voice-transcript-area #transcript p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--fg);
  margin-bottom: 0.375rem;
}

/* Conversation header toggle bar */

.conv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.conv-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent);
}

.toggle-bar {
  display: flex;
  gap: 0.5rem;
}

.toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.toggle-btn.active,
.toggle-btn[aria-pressed="true"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Voice transcript indicator */

.message.voice-transcript {
  border-left: 3px solid var(--accent);
  opacity: 0.9;
}

/* Inline mic button (in chat input area) */

.mic-btn-inline {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--card-bg);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.mic-btn-inline:hover {
  background: var(--accent);
  color: white;
}

.mic-btn-inline.active {
  background: var(--accent);
  color: white;
  animation: pulse 2s ease-in-out infinite;
}

.mic-btn-inline.muted {
  opacity: 0.5;
}

.voice-end-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.voice-end-btn:hover {
  color: var(--error);
  border-color: var(--error);
}

/* Camera preview PiP */

.camera-preview {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 120px;
  border-radius: var(--radius);
  border: 2px solid var(--accent);
  z-index: 100;
  overflow: hidden;
}

.camera-preview video {
  width: 100%;
  display: block;
}

.camera-reverse-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Enlarge flip button in fullscreen */
.camera-fullscreen .camera-reverse-btn {
  width: 44px;
  height: 44px;
  top: 16px;
  right: 16px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.camera-fullscreen .camera-reverse-btn svg {
  width: 24px;
  height: 24px;
}

/* Fullscreen camera mode */
.camera-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  z-index: 1000 !important;
  background: #000;
}
.camera-fullscreen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.camera-controls {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  z-index: 1001;
}
.cam-ctrl-btn {
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.cam-shutter {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.25);
  border: 3px solid white;
}
.cam-minimize, .cam-close {
  width: 44px;
  height: 44px;
}

/* Voice status bar */

.voice-status-bar {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  padding: 0.25rem;
}

.voice-status-bar.active {
  color: var(--accent);
}

.voice-status-bar.speaking {
  color: var(--fg);
}

.voice-status-bar.error {
  color: var(--error);
}

.voice-status-bar.reconnecting {
  color: var(--muted);
  font-style: italic;
}

/* Voice streaming bubbles */

.message.streaming .bubble::after {
  content: '\25CF';
  display: inline;
  margin-left: 0.25em;
  animation: blink 1s steps(2, start) infinite;
  color: var(--accent);
}

@keyframes blink {
  to { visibility: hidden; }
}
