/* ── Voice Console — Floating Widget ─────────────────────────── */

/* FAB (Floating Action Button) */
.vc-fab {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  right: calc(20px + env(safe-area-inset-right, 0px));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(233, 69, 96, 0.4);
  z-index: 9000;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vc-fab:active {
  transform: scale(0.92);
}

.vc-fab.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.5);
}

/* ── Mini Bar ────────────────────────────────────────────────── */

.vc-mini {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--surface-alt);
  z-index: 9001;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.vc-mini.visible {
  transform: translateY(0);
}

.vc-mini-mode {
  font-size: 11px;
  color: var(--primary);
  background: rgba(233, 69, 96, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.vc-mini-text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vc-mini-text.interim {
  color: var(--text-dim);
  font-style: italic;
}

.vc-mini-mic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vc-mini-mic.recording {
  background: var(--danger);
  animation: vc-pulse 1s infinite;
}

.vc-mini-expand {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.vc-mini-close {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Full Panel ──────────────────────────────────────────────── */

.vc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9002;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.vc-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.vc-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 70vh;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  z-index: 9003;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vc-panel.visible {
  transform: translateY(0);
}

.vc-panel-header {
  display: flex;
  align-items: center;
  padding: 14px 16px 10px;
  gap: 10px;
  border-bottom: 1px solid var(--surface-alt);
  flex-shrink: 0;
}

.vc-panel-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.vc-panel-context {
  font-size: 11px;
  color: var(--primary);
  background: rgba(233, 69, 96, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.vc-panel-minimize {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.vc-panel-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.vc-panel-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

/* Record button in panel */
.vc-record-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.vc-record-btn {
  flex: 1;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.15s;
}

.vc-record-btn.recording {
  background: var(--danger);
  animation: vc-pulse 1s infinite;
}

.vc-record-btn:disabled {
  background: #555;
  cursor: not-allowed;
}

/* Transcript */
.vc-transcript {
  min-height: 48px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid #333;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 10px;
  word-break: break-all;
  display: none;
}

.vc-transcript.visible {
  display: block;
}

.vc-transcript.interim {
  color: var(--text-dim);
  font-style: italic;
}

/* Edit area */
.vc-edit {
  display: none;
  margin-bottom: 10px;
}

.vc-edit.visible {
  display: block;
}

.vc-edit textarea {
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid #333;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  font-family: inherit;
}

.vc-edit textarea:focus {
  border-color: var(--primary);
}


/* Submit */
.vc-submit-row {
  display: flex;
  gap: 10px;
}

.vc-submit-btn {
  flex: 1;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.vc-submit-btn:hover {
  background: var(--primary-hover);
}

.vc-submit-btn:disabled {
  background: #555;
  cursor: not-allowed;
}

/* Result message */
.vc-result {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
}

.vc-result.visible {
  display: block;
}

.vc-result.success {
  background: rgba(46, 204, 113, 0.15);
  color: var(--success);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.vc-result.error {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.vc-result.warning {
  background: rgba(243, 156, 18, 0.15);
  color: var(--warning);
  border: 1px solid rgba(243, 156, 18, 0.3);
}

/* Not-supported notice */
.vc-unsupported {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 20px;
}

/* ── Animations ──────────────────────────────────────────────── */

@keyframes vc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* ── Quick Actions ───────────────────────────────────────────── */

.vc-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.vc-quick-btn {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 16px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.vc-quick-btn:active {
  transform: scale(0.95);
  background: var(--primary);
  color: #fff;
}

/* ── Inline Voice Button (for modals) ────────────────────────── */

.inline-mic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  font-size: 16px;
  vertical-align: middle;
  margin-left: 6px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.inline-mic-btn.recording {
  background: var(--danger);
  animation: vc-pulse 1s infinite;
}

/* ── Spinner ─────────────────────────────────────────────────── */

.vc-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}
