/* ─────────────────────────────────────────────────────────────────────────
 * EZCODER.IO · Vocal Forge studio styles
 * The voice-first coder · zero typing · live build view · verbal interrupt
 * Empire canon compliant: no Claude-emoji · mobile-first · light/dark aware
 * ───────────────────────────────────────────────────────────────────────── */

.vf-studio {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 60px auto 40px;
  padding: 0 20px;
}

.vf-studio-header {
  text-align: center;
  margin-bottom: 28px;
}

.vf-studio-header h2 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: #0f1226;
}

.vf-studio-header .sub {
  color: #4a4f6f;
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.5;
}

.vf-studio-header .sub em {
  font-style: normal; font-weight: 600;
  background: rgba(167, 139, 250, 0.16);
  padding: 1px 7px; border-radius: 6px; color: #5b3aa3;
}

.vf-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 880px) {
  .vf-grid { grid-template-columns: 1fr; }
}

/* ── Mic panel (light-default · mem #49) ── */
.vf-mic-panel {
  background: #ffffff;
  border: 1px solid rgba(15, 18, 38, 0.08);
  border-radius: 16px;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  box-shadow: 0 4px 14px rgba(15, 18, 38, 0.04);
}

.vf-mic-btn {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: radial-gradient(circle at 30% 30%, #7c8cf8 0%, #4d5fe0 50%, #2d3da0 100%);
  box-shadow: 0 8px 40px rgba(102, 126, 234, 0.45), inset 0 2px 12px rgba(255, 255, 255, 0.18);
  transition: transform 0.18s, box-shadow 0.18s;
  position: relative;
  outline: none;
}

.vf-mic-btn:hover { transform: scale(1.04); }
.vf-mic-btn:active { transform: scale(0.97); }

.vf-mic-btn svg {
  width: 60px;
  height: 60px;
  fill: white;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.vf-mic-btn.listening {
  background: radial-gradient(circle at 30% 30%, #ff7eb6 0%, #e94f97 50%, #b22368 100%);
  animation: vfPulse 1.4s ease-in-out infinite;
}

@keyframes vfPulse {
  0%, 100% { box-shadow: 0 8px 40px rgba(233, 79, 151, 0.55), 0 0 0 0 rgba(233, 79, 151, 0.5); }
  50%       { box-shadow: 0 8px 40px rgba(233, 79, 151, 0.55), 0 0 0 22px rgba(233, 79, 151, 0); }
}

.vf-mic-btn.building {
  background: radial-gradient(circle at 30% 30%, #4ade80 0%, #22c55e 50%, #14803a 100%);
}

.vf-mic-btn.interrupted {
  background: radial-gradient(circle at 30% 30%, #fbbf24 0%, #f59e0b 50%, #b45309 100%);
}

.vf-status {
  margin-top: 22px;
  font-size: 1rem;
  font-weight: 700;
  color: #0f1226;
  text-align: center;
  min-height: 24px;
}

.vf-status .hint {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: #4a4f6f;
  margin-top: 6px;
}

.vf-transcript {
  margin-top: 18px;
  width: 100%;
  min-height: 56px;
  background: #f5f6fa;
  border: 1px solid rgba(15, 18, 38, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: #0f1226;
  line-height: 1.45;
}

.vf-transcript:empty::before {
  content: 'Your words will appear here…';
  color: #8b90a8;
  font-style: italic;
}

.vf-fallback {
  margin-top: 16px;
  width: 100%;
  display: none;
}

.vf-fallback textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(15, 18, 38, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  color: #0f1226;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  outline: none;
}

.vf-fallback textarea:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.12); }

.vf-fallback button {
  margin-top: 8px;
  width: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.92rem;
}

.vf-fallback button:hover { filter: brightness(1.1); }

/* ── Build pane ── */
.vf-build-pane {
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-height: 360px;
  overflow: hidden;
}

.vf-build-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(20, 20, 35, 0.9), rgba(10, 10, 25, 0.6));
  border-bottom: 1px solid rgba(0, 229, 255, 0.14);
  font-size: 0.85rem;
  color: #8888aa;
}

.vf-traffic {
  display: inline-flex;
  gap: 6px;
}

.vf-traffic span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.vf-traffic .r { background: #ff5f56; }
.vf-traffic .y { background: #ffbd2e; }
.vf-traffic .g { background: #27c93f; }

.vf-build-title {
  flex: 1;
  text-align: center;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

.vf-build-mode {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(102, 126, 234, 0.18);
  color: #a0b0ff;
  border: 1px solid rgba(102, 126, 234, 0.32);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vf-build-body {
  flex: 1;
  position: relative;
  overflow: auto;
}

.vf-build-code {
  margin: 0;
  padding: 18px 20px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #e8e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 280px;
}

.vf-build-code .kw   { color: #c792ea; }
.vf-build-code .str  { color: #c3e88d; }
.vf-build-code .com  { color: #6b7080; font-style: italic; }
.vf-build-code .tag  { color: #f78c6c; }
.vf-build-code .attr { color: #82aaff; }
.vf-build-code .num  { color: #f78c6c; }
.vf-build-code .fn   { color: #82aaff; }

.vf-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: #00e5ff;
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: vfBlink 1s steps(2) infinite;
}

@keyframes vfBlink { 50% { opacity: 0; } }

.vf-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 280px;
  color: #555577;
  font-size: 0.92rem;
  text-align: center;
  padding: 20px;
}

.vf-empty-state svg {
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  opacity: 0.5;
}

/* ── Action bar ── */
.vf-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 229, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
}

.vf-actions button {
  flex: 1;
  background: rgba(102, 126, 234, 0.14);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: #c0c0e0;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.vf-actions button:hover {
  background: rgba(102, 126, 234, 0.28);
  color: #fff;
}

.vf-actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Unlock card (light-default) ── */
.vf-unlock {
  margin-top: 28px;
  background: linear-gradient(135deg, #f5f3ff 0%, #eef4ff 100%);
  border: 1px solid rgba(102, 126, 234, 0.22);
  border-radius: 14px;
  padding: 22px 24px;
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.vf-unlock-text { flex: 1; min-width: 260px; }

.vf-unlock-text h3 {
  font-size: 1.18rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #0f1226;
  letter-spacing: -0.01em;
}

.vf-unlock-text p {
  font-size: 0.92rem;
  color: #4a4f6f;
  line-height: 1.55;
}

.vf-unlock-cta {
  background: linear-gradient(135deg, #00e5ff, #a78bfa);
  color: #0a0a1a;
  font-weight: 800;
  padding: 12px 22px;
  border-radius: 99px;
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
}

.vf-unlock-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(167, 139, 250, 0.42);
}

/* ── Mode chips (light-default) ── */
.vf-modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.vf-mode-chip {
  background: #ffffff;
  border: 1px solid rgba(15, 18, 38, 0.1);
  color: #4a4f6f;
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.vf-mode-chip:hover { border-color: rgba(102, 126, 234, 0.42); color: #0f1226; }
.vf-mode-chip.active {
  background: linear-gradient(135deg, #667eea, #a78bfa);
  color: #ffffff; border-color: transparent;
}

/* Usage counter pill */
.vf-counter {
  margin-left: 8px; padding: 6px 12px; border-radius: 99px;
  background: rgba(167, 139, 250, 0.12); color: #5b3aa3;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid rgba(167, 139, 250, 0.22);
  display: none;
}
.vf-counter.show { display: inline-flex; align-items: center; gap: 6px; }
.vf-counter.warn { background: rgba(245, 158, 11, 0.14); color: #92400e; border-color: rgba(245, 158, 11, 0.32); }
.vf-counter.gate { background: rgba(239, 68, 68, 0.14); color: #991b1b; border-color: rgba(239, 68, 68, 0.32); }
body.theme-dark .vf-counter { background: rgba(167, 139, 250, 0.22); color: #d8c8ff; border-color: rgba(167, 139, 250, 0.32); }

/* Primary action (Deploy) */
.vf-actions button.primary {
  background: linear-gradient(135deg, #667eea, #a78bfa);
  color: #ffffff; border-color: transparent;
}
.vf-actions button.primary:hover {
  filter: brightness(1.08);
  background: linear-gradient(135deg, #667eea, #a78bfa);
  color: #ffffff;
}

/* Deploy result panel */
.vf-deploy-result {
  margin: 12px 16px 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 10px;
  font-size: 0.92rem;
  color: #14532d;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.vf-deploy-result.err { background: #fef2f2; color: #7f1d1d; border-color: rgba(239, 68, 68, 0.28); }
.vf-deploy-result a.live-url {
  color: #14532d; font-weight: 800; word-break: break-all;
  text-decoration: underline; text-decoration-thickness: 2px;
}
.vf-deploy-result a.live-url:hover { color: #15803d; }
.vf-deploy-result .copy-link {
  background: rgba(20, 83, 45, 0.12);
  color: #14532d; border: 0;
  padding: 6px 14px; border-radius: 99px;
  font-weight: 700; font-size: 0.82rem; cursor: pointer;
}
.vf-deploy-result .copy-link:hover { background: rgba(20, 83, 45, 0.22); }
body.theme-dark .vf-deploy-result { background: rgba(34, 197, 94, 0.12); color: #bbf7d0; }
body.theme-dark .vf-deploy-result a.live-url { color: #bbf7d0; }

/* Pro badge on build pane */
.vf-pro-badge {
  display: inline-block; margin-left: 6px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #422006; padding: 2px 8px; border-radius: 6px;
  font-size: 0.66rem; font-weight: 900; letter-spacing: 0.05em;
  text-transform: uppercase; vertical-align: middle;
}

/* ── Dark-mode override (toggle via empire-theme-toggle.js · mem #49) ── */
body.theme-dark .vf-studio-header h2 { color: #ffffff; }
body.theme-dark .vf-studio-header .sub { color: #b0b2c8; }

body.theme-dark .vf-mic-panel {
  background: rgba(20, 22, 44, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
body.theme-dark .vf-status { color: #ffffff; }
body.theme-dark .vf-status .hint { color: #b0b2c8; }
body.theme-dark .vf-transcript {
  background: rgba(0, 0, 0, 0.35);
  color: #e8e9f5;
  border-color: rgba(255, 255, 255, 0.06);
}
body.theme-dark .vf-transcript:empty::before { color: #6c7090; }

body.theme-dark .vf-fallback textarea {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f0f1fa;
}

body.theme-dark .vf-unlock {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.14), rgba(167, 139, 250, 0.10));
  border-color: rgba(167, 139, 250, 0.28);
}
body.theme-dark .vf-unlock-text h3 { color: #ffffff; }
body.theme-dark .vf-unlock-text p  { color: #b0b2c8; }

body.theme-dark .vf-mode-chip {
  background: rgba(0, 229, 255, 0.08);
  border-color: rgba(0, 229, 255, 0.18);
  color: #88ccdd;
}
body.theme-dark .vf-mode-chip:hover,
body.theme-dark .vf-mode-chip.active {
  background: rgba(0, 229, 255, 0.22); color: #ffffff;
}

/* ── Tiny mobile polish ── */
@media (max-width: 680px) {
  .vf-studio { margin: 36px auto 24px; }
  .vf-studio-header h2 { font-size: 1.5rem; }
  .vf-mic-btn { width: 116px; height: 116px; }
  .vf-mic-btn svg { width: 48px; height: 48px; }
  .vf-build-code { font-size: 0.78rem; }
  .vf-unlock { padding: 18px; }
  .vf-unlock-cta { width: 100%; text-align: center; }
}
