/* voice-page.css — Hero Voice Intent Page */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #000;
  --surface: #0c0c0e;
  --surface2:#141416;
  --surface3:#1c1c1e;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);
  --accent:  #7b50ff;
  --cyan:    #00c8ff;
  --green:   #30d158;
  --gray:    #86868b;
  --gray2:   #48484a;
  --font:    'Inter', -apple-system, sans-serif;
  --ease:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: #fff;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Global effect overlays ── */
.capture-flash {
  position: fixed; inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
}
.capture-flash.fire { animation: capture-anim 0.4s ease-out forwards; }
@keyframes capture-anim {
  0%   { opacity: 0.85; }
  100% { opacity: 0; }
}

.pause-dim {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.35s;
}
.pause-dim.active { opacity: 1; }

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 48px;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 20;
  position: relative;
}

.nav-back {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
  min-width: 80px;
}
.nav-back:hover { opacity: 0.7; }

.nav-center {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-title { font-size: 13px; color: var(--gray); font-weight: 500; }
.nav-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--green);
  background: rgba(48,209,88,0.12);
  border: 1px solid rgba(48,209,88,0.25);
  border-radius: 4px;
  padding: 2px 6px;
}

.nav-status { font-size: 12px; color: var(--gray); text-align: right; min-width: 100px; }
.nav-status.listening { color: rgba(123,80,255,0.9); }
.nav-status.error     { color: #ff453a; }

/* ── Layout ── */
.voice-main {
  display: grid;
  grid-template-columns: 1fr 300px;
  flex: 1;
  overflow: hidden;
}

/* ── Primary (left) ── */
.voice-primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 36px 48px;
  background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(100,60,255,0.10) 0%, transparent 70%), #050507;
  position: relative;
  overflow: hidden;
}

/* Waveform */
.wave-wrap {
  width: 100%;
  max-width: 520px;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
}

.voice-wave-canvas {
  width: 100%;
  height: 120px;
  display: block;
  background: rgba(123,80,255,0.05);
  border: 1px solid rgba(123,80,255,0.12);
  border-radius: 14px;
}

.wave-tint {
  position: absolute; inset: 0;
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
}
.wave-tint.flash { animation: wave-tint-anim 0.7s ease-out forwards; }
@keyframes wave-tint-anim {
  0%   { opacity: 0.28; }
  100% { opacity: 0; }
}

/* Transcript */
.transcript-area {
  text-align: center;
  min-height: 52px;
  max-width: 520px;
  width: 100%;
}
.vlc-interim {
  font-size: 18px;
  color: rgba(255,255,255,0.35);
  font-style: italic;
  display: block;
  line-height: 1.4;
}
.vlc-final {
  font-size: 20px;
  color: rgba(255,255,255,0.92);
  display: block;
  line-height: 1.4;
  font-weight: 500;
}

/* ── Action card ── */
.action-card {
  width: 100%;
  max-width: 520px;
  min-height: 82px;
  border-radius: 16px;
  border: 1px solid var(--border2);
  background: rgba(255,255,255,0.025);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 22px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease);
}

/* Color-reactive glow overlay */
.action-card::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--card-color, rgba(123,80,255,0.1));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.action-card.active {
  border-color: var(--card-color, rgba(123,80,255,0.45));
}
.action-card.active::before { opacity: 0.12; }
.action-card.flash::before  { animation: card-flash 0.55s ease-out forwards; }
@keyframes card-flash {
  0%   { opacity: 0.35; }
  100% { opacity: 0.12; }
}

/* No-match shake */
.action-card.no-match { animation: card-shake 0.3s ease; }
@keyframes card-shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-5px); }
  75%       { transform: translateX(5px); }
}

/* Zoom pulse */
.action-card.zoom-pulse { animation: zoom-anim 0.5s var(--ease); }
@keyframes zoom-anim {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Trigger burst */
.action-card.trigger-burst { animation: trigger-anim 0.4s ease; }
@keyframes trigger-anim {
  0%   { box-shadow: 0 0 0 0 var(--card-color, rgba(255,107,107,0)); }
  50%  { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: none; }
}

.action-empty {
  font-size: 13px;
  color: rgba(255,255,255,0.22);
  text-align: center;
  line-height: 1.5;
}

.action-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-icon {
  font-size: 30px;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.action-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.action-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

.action-heard {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-conf {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

/* ── Mic row ── */
.mic-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mic-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  border-radius: 980px;
  border: 1.5px solid rgba(123,80,255,0.5);
  background: rgba(123,80,255,0.08);
  color: rgba(190,155,255,1);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.mic-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.mic-btn:hover {
  background: rgba(123,80,255,0.18);
  border-color: rgba(123,80,255,0.85);
  box-shadow: 0 0 30px rgba(123,80,255,0.2);
}
.mic-btn.active {
  background: rgba(123,80,255,0.22);
  border-color: rgba(123,80,255,1);
  box-shadow: 0 0 40px rgba(123,80,255,0.3);
  animation: mic-glow 2s ease-in-out infinite;
}
@keyframes mic-glow {
  0%, 100% { box-shadow: 0 0 30px rgba(123,80,255,0.25); }
  50%       { box-shadow: 0 0 50px rgba(123,80,255,0.45); }
}

.mic-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gray2);
  transition: background 0.3s, box-shadow 0.3s;
  display: inline-block;
}
.mic-dot.active {
  background: rgba(123,80,255,1);
  box-shadow: 0 0 0 3px rgba(123,80,255,0.25), 0 0 12px rgba(123,80,255,0.6);
  animation: dot-pulse 1.4s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(123,80,255,0.25), 0 0 12px rgba(123,80,255,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(123,80,255,0.12), 0 0 24px rgba(123,80,255,0.7); }
}

.key-hint {
  font-family: var(--font);
  font-size: 11px;
  color: var(--gray2);
  background: var(--surface3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 3px 8px;
  transition: color 0.2s, border-color 0.2s;
  user-select: none;
}
.key-hint.active {
  color: rgba(123,80,255,0.9);
  border-color: rgba(123,80,255,0.4);
}

.not-supported-note {
  font-size: 13px;
  color: #ff453a;
  text-align: center;
}

.browser-note {
  font-size: 12px;
  color: var(--gray);
  opacity: 0.6;
  text-align: center;
}

/* ── Panel (right) ── */
.voice-panel {
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--gray2) transparent;
}

.vp-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.vp-label {
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 600;
  margin-bottom: 10px;
}

/* Hint chips */
.hint-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hint-chip {
  font-family: var(--font);
  font-size: 12px;
  background: rgba(123,80,255,0.07);
  border: 1px solid rgba(123,80,255,0.22);
  color: rgba(180,145,255,0.9);
  border-radius: 980px;
  padding: 4px 11px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.hint-chip:hover {
  background: rgba(var(--chip-rgb, 123,80,255), 0.18);
  border-color: rgba(var(--chip-rgb, 123,80,255), 0.55);
  color: #fff;
}

/* Intent log */
.intent-log {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 160px;
  overflow-y: auto;
}
.intent-log li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 2px 0;
}
.il-intent { font-weight: 500; white-space: nowrap; }
.il-text   { color: var(--gray); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.il-meta   { color: var(--gray2); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }

/* Intent map */
.intent-map {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.im-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 7px;
  background: var(--surface3);
  font-size: 11px;
  transition: background 0.2s;
}
.im-row.lit { background: rgba(255,255,255,0.06); }
.im-icon   { text-align: center; font-size: 13px; }
.im-phrase { color: rgba(255,255,255,0.45); font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-action { font-weight: 500; white-space: nowrap; }

/* Navigation links */
.nav-links-section { flex: 1; }
.nav-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.nav-link-item:hover {
  background: rgba(123,80,255,0.1);
  color: rgba(200,170,255,0.9);
}
.nav-link-icon { font-size: 16px; width: 22px; text-align: center; }

/* ── Responsive ── */
@media (max-width: 860px) {
  body { overflow: auto; }
  .voice-main { grid-template-columns: 1fr; }
  .voice-panel {
    max-height: none;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.07);
    overflow: visible;
  }
  .voice-primary { padding: 28px 20px; }
}
