/* ============================================================
   Voice Assistant — Floating button + panel
   ============================================================ */

.va-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* ── FAB ─────────────────────────────────────────────────── */
.va-fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary) !important;
  color: #fff;
  border: none !important;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast), transform 0.15s ease;
  flex-shrink: 0;
  outline: none !important;
}

.va-fab:hover {
  background: var(--primary-hover) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: scale(1.07);
  border-color: transparent;
}

.va-fab--recording {
  background: #ef4444 !important;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45) !important;
  animation: va-pulse-fab 1.4s ease-in-out infinite;
}

.va-fab--processing {
  background: var(--amber-600) !important;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.4) !important;
}

@keyframes va-pulse-fab {
  0%, 100% { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45); }
  50%       { box-shadow: 0 4px 28px rgba(239, 68, 68, 0.7); transform: scale(1.08); }
}

/* ── Panel ───────────────────────────────────────────────── */
.va-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 300px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  overflow: hidden;
  animation: va-slide-up 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes va-slide-up {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ──────────────────────────────────────────────── */
.va-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.va-panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.va-close-btn {
  background: none !important;
  border: none !important;
  outline: none !important;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  padding: 0;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.va-close-btn:hover {
  background: var(--gray-200) !important;
  color: var(--text-primary);
  border-color: transparent;
}

/* ── Área de estado ──────────────────────────────────────── */
.va-status-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px 16px;
  gap: 8px;
}

.va-status-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.va-status-icon--recording {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  animation: va-pulse-icon 1.4s ease-in-out infinite;
}

.va-status-icon--processing {
  background: rgba(217, 119, 6, 0.1);
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--amber-600);
}

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

.va-status-text {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.va-status-sub {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  min-height: 14px;
  line-height: 1.4;
}

/* ── Resultado ───────────────────────────────────────────── */
.va-result {
  margin: 0 12px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.va-result-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}

.va-result-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  font-style: italic;
}

.va-result-action {
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
}

.va-result-action--unknown {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Lista de comandos ───────────────────────────────────── */
.va-commands {
  border-top: 1px solid var(--border-color);
  padding: 8px 0 6px;
}

.va-commands-title {
  margin: 0 0 4px;
  padding: 0 14px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
}

.va-commands-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.va-cmd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.va-cmd-item:hover {
  background: var(--bg-subtle);
}

.va-cmd-icon {
  width: 28px;
  height: 28px;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.va-cmd-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.va-cmd-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.va-cmd-hint {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Dark mode ───────────────────────────────────────────── */
:root[data-theme='dark'] .va-panel {
  background: #0d1b2e;
  border-color: #1e2f4d;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.2);
}

:root[data-theme='dark'] .va-panel-header {
  background: rgba(15, 23, 42, 0.8);
  border-color: #1e2f4d;
}

:root[data-theme='dark'] .va-status-icon {
  background: rgba(148, 163, 184, 0.08);
  border-color: #1e2f4d;
}

:root[data-theme='dark'] .va-close-btn:hover {
  background: rgba(30, 47, 77, 0.7) !important;
}

:root[data-theme='dark'] .va-cmd-item:hover {
  background: rgba(30, 47, 77, 0.5);
}

:root[data-theme='dark'] .va-result {
  background: rgba(15, 23, 42, 0.8);
  border-color: #1e2f4d;
}

:root[data-theme='dark'] .va-cmd-icon {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.25);
}

:root[data-theme='dark'] .va-commands {
  border-color: #1e2f4d;
}

/* ── Móvil ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .va-root {
    bottom: 16px;
    right: 16px;
  }

  .va-panel {
    width: calc(100vw - 32px);
    max-width: 300px;
  }
}
