/* ============================================
   SCENE 2 — VOICE ASSISTANT
   VaaniBank AI — scene-voice.css
   ============================================ */

#scene-voice {
  background: var(--white);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Wave canvas — scoped only to scene-voice */
#voice-wave-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* Lift all voice content above the wave canvas */
.live-badge,
.voice-inner {
  position: relative;
  z-index: 2;
}

/* ── Live Badge ─────────────────────────────────────────── */
.live-badge {
  position: absolute;
  top: calc(var(--nav-h) + 16px);
  right: var(--container-pad);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(27,43,107,0.06);
  border: 1px solid rgba(27,43,107,0.12);
  border-radius: var(--radius-full);
  padding: 6px 14px 6px 10px;
  backdrop-filter: blur(12px);
  font-family: var(--font-dm);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--navy);
  opacity: 0.7;
  letter-spacing: 0.05em;
  z-index: 10;
}

.live-dot {
  width: 7px; height: 7px;
  background: #22C55E;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
  animation: livePulse 1.5s ease-out infinite;
}

@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

[data-theme="dark"] .live-badge {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
}

.voice-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--nav-h) var(--container-pad) 0;
}

/* Left */
.voice-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.voice-tabs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.voice-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  background: transparent;
  cursor: none;
  text-align: left;
  transition: background 0.3s, border-color 0.3s, transform 0.2s var(--ease-spring);
}

.voice-tab:hover {
  background: var(--light-blue);
  transform: translateX(4px);
}

.voice-tab.active {
  background: var(--light-blue);
  border-color: var(--navy);
}

.voice-tab-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background 0.3s;
}

.voice-tab.active .voice-tab-icon { background: var(--red); }

.voice-tab-text { display: flex; flex-direction: column; gap: 2px; }

.voice-tab-title {
  font-family: var(--font-sora);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
  line-height: 1;
}

.voice-tab-sub {
  font-family: var(--font-dm);
  font-size: 0.8rem;
  color: var(--navy);
  opacity: 0.5;
}

/* Right — Feature Panel */
.voice-panel {
  position: relative;
  height: 480px;
  background: linear-gradient(145deg, var(--light-blue), var(--mid-blue));
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.voice-panel-content {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  gap: var(--space-lg);
}

.voice-panel-content.active {
  display: flex;
}

/* Tab 1 — Mic Visualizer */
.mic-visualizer {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mic-pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--red);
  animation: micPulse 2s ease-out infinite;
  opacity: 0;
}

.mic-pulse-ring:nth-child(1) { width: 80px;  height: 80px;  animation-delay: 0s; }
.mic-pulse-ring:nth-child(2) { width: 100px; height: 100px; animation-delay: 0.5s; }
.mic-pulse-ring:nth-child(3) { width: 120px; height: 120px; animation-delay: 1s; }

@keyframes micPulse {
  0%   { opacity: 0.7; transform: scale(0.7); }
  100% { opacity: 0;   transform: scale(1.4); }
}

.mic-core {
  width: 64px;
  height: 64px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: var(--shadow-red);
  position: relative;
  z-index: 2;
}

/* Wave Bars */
.wave-bars {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 48px;
}

.wave-bar {
  width: 5px;
  border-radius: 3px;
  background: var(--navy);
  animation: waveAnim 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) { height: 16px; animation-delay: 0.0s; }
.wave-bar:nth-child(2) { height: 28px; animation-delay: 0.1s; }
.wave-bar:nth-child(3) { height: 40px; animation-delay: 0.2s; opacity: 0.8; }
.wave-bar:nth-child(4) { height: 48px; animation-delay: 0.15s; }
.wave-bar:nth-child(5) { height: 38px; animation-delay: 0.05s; opacity: 0.9; }
.wave-bar:nth-child(6) { height: 26px; animation-delay: 0.25s; }
.wave-bar:nth-child(7) { height: 14px; animation-delay: 0.1s; }
.wave-bar:nth-child(8) { height: 32px; animation-delay: 0.2s; }
.wave-bar:nth-child(9) { height: 44px; animation-delay: 0.05s; }
.wave-bar:nth-child(10){ height: 22px; animation-delay: 0.18s; }

@keyframes waveAnim {
  0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
  50%       { transform: scaleY(1);   opacity: 1;   }
}

.voice-result {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.voice-result-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.45;
  margin-bottom: 4px;
  font-family: var(--font-dm);
}

.voice-result-text {
  font-family: var(--font-sora);
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  min-height: 1.5em;
}

/* Tab 2 — Language Grid */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.lang-pill {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-dm);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--navy);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s;
  cursor: default;
}

.lang-pill:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.lang-pill .lang-native {
  display: block;
  font-size: 0.72rem;
  opacity: 0.5;
  font-weight: 500;
  margin-top: 2px;
}

.lang-more {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  font-family: var(--font-sora);
  font-weight: 900;
  font-size: 1.1rem;
}

#panel-flow {
  padding: 14px 12px 0 !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  overflow: hidden;
  flex-direction: column !important;
  gap: 0 !important;
}

#panel-flow.active {
  display: flex !important;
}

/* ── Flow Cards Wrap ────────────────────────────────────── */
.flow-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  flex: 1;
  overflow-y: scroll;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding-bottom: 6px;
  min-height: 0;
}
.flow-cards-wrap::-webkit-scrollbar { display: none; }

/* Hide connector on first card */
.flow-card:first-child .flow-card-connector { display: none; }

/* ── Individual Step Card ──────────────────────────────── */
.flow-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

/* Connector line between cards */
.flow-card-connector {
  width: 2px;
  height: 10px;
  background: rgba(27,43,107,0.15);
  border-radius: 2px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: background 0.4s ease;
}

.flow-card-connector::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0%;
  background: var(--navy);
  border-radius: 2px;
  transition: height 0.5s ease;
}

.flow-card.done .flow-card-connector::after {
  height: 100%;
}

.flow-card.active .flow-card-connector::after {
  height: 60%;
  background: linear-gradient(to bottom, var(--navy), rgba(27,43,107,0.2));
  animation: connectorPulse 1.2s ease-in-out infinite;
}

@keyframes connectorPulse {
  0%,100% { height: 30%; opacity: 0.7; }
  50%      { height: 85%; opacity: 1; }
}

/* The white card box */
.flow-card-inner {
  width: 100%;
  background: rgba(255,255,255,0.75);
  border: 1.5px solid rgba(27,43,107,0.1);
  border-radius: 12px;
  padding: 10px 12px;
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    background 0.35s ease,
    transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

.flow-card:hover .flow-card-inner {
  border-color: rgba(27,43,107,0.2);
  transform: translateX(3px);
}

/* ACTIVE card — glowing highlighted */
.flow-card.active .flow-card-inner {
  background: rgba(255,255,255,0.97);
  border-color: var(--navy);
  box-shadow:
    0 0 0 3px rgba(27,43,107,0.12),
    0 0 18px rgba(27,43,107,0.25),
    0 4px 16px rgba(27,43,107,0.14);
  transform: translateX(4px);
  animation: cardGlowPulse 1.8s ease-in-out infinite;
}

@keyframes cardGlowPulse {
  0%,100% {
    box-shadow:
      0 0 0 3px rgba(27,43,107,0.12),
      0 0 18px rgba(27,43,107,0.25),
      0 4px 16px rgba(27,43,107,0.14);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(27,43,107,0.16),
      0 0 28px rgba(27,43,107,0.38),
      0 4px 20px rgba(27,43,107,0.20);
  }
}

/* DONE card — green tint */
.flow-card.done .flow-card-inner {
  background: rgba(220,252,231,0.7);
  border-color: rgba(22,163,74,0.35);
  box-shadow: 0 0 10px rgba(22,163,74,0.15);
  animation: none;
}

/* Card Header: badge + icon */
.flow-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.flow-card-badge {
  font-family: var(--font-sora);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(27,43,107,0.4);
  background: rgba(27,43,107,0.07);
  border-radius: 20px;
  padding: 2px 7px;
  transition: color 0.3s, background 0.3s;
}

.flow-card.active .flow-card-badge {
  background: rgba(27,43,107,0.12);
  color: var(--navy);
}

.flow-card.done .flow-card-badge {
  background: rgba(22,163,74,0.12);
  color: #16a34a;
}

.flow-card-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

.flow-card.active .flow-card-icon {
  transform: scale(1.2);
}

/* Card Title */
.flow-card-title {
  font-family: var(--font-sora);
  font-weight: 700;
  font-size: 0.82rem;
  color: rgba(27,43,107,0.7);
  margin-bottom: 3px;
  line-height: 1.2;
  transition: color 0.3s;
}

.flow-card.active .flow-card-title { color: var(--navy); font-weight: 800; }
.flow-card.done  .flow-card-title  { color: #16a34a; }

/* Card Desc — visible only on active */
.flow-card-desc {
  font-family: var(--font-dm);
  font-size: 0.72rem;
  color: rgba(27,43,107,0.6);
  line-height: 1.45;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s ease, opacity 0.35s ease, margin 0.35s ease;
  margin-bottom: 0;
}

.flow-card.active .flow-card-desc {
  max-height: 80px;
  opacity: 1;
  margin-bottom: 6px;
}

/* Tags — visible only on active */
.flow-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease 0.05s, opacity 0.35s ease 0.05s;
}

.flow-card.active .flow-card-tags {
  max-height: 60px;
  opacity: 1;
}

.flow-card-tag {
  background: var(--navy);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  font-family: var(--font-sora);
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.flow-card.done .flow-card-tag {
  background: #16a34a;
}

/* Progress bar at bottom */
.flow-progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(27,43,107,0.08);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 8px;
}

.flow-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), #4a7fc1);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  width: 0%;
  box-shadow: 0 0 8px rgba(27,43,107,0.5);
}

/* Language Morph in heading */
.voice-lang-morph {
  display: inline-block;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.voice-lang-morph.morphing {
  opacity: 0;
  transform: translateY(-6px);
}

@media (max-width: 900px) {
  .voice-inner { grid-template-columns: 1fr; gap: 40px; }
  .voice-panel { height: 360px; }
}

@media (max-width: 768px) {
  .voice-inner { display: flex; flex-direction: column; gap: 20px; }
  .voice-left, .voice-panel { width: 100%; }
  .flow-steps-list { max-height: 260px; }
}
