/* HVoice — design tokens & shared components (tách khỏi palette Vbee tím/vàng) */
:root {
  /* Light (hướng 2): xanh dương */
  --vbee-purple: #0F172A;
  --vbee-purple-2: #1E3A8A;
  --vbee-purple-3: #1E40AF;
  --vbee-purple-light: #2563EB;
  --vbee-orange: #F97316;
  --vbee-orange-2: #FB923C;
  --vbee-yellow: #2563EB;
  --vbee-yellow-hover: #1D4ED8;
  --vbee-primary: #2563EB;
  --vbee-primary-hover: #1D4ED8;
  --vbee-text-on-dark: #FFFFFF;
  --vbee-text-on-primary: #FFFFFF;
  --vbee-muted: rgba(15, 23, 42, 0.65);
  --vbee-pill-border: rgba(15, 23, 42, 0.14);
  --vbee-radius-pill: 999px;
  --vbee-radius-btn: 12px;
  --vbee-radius-card: 16px;
  --brand-glow: rgba(37, 99, 235, 0.35);
  --brand-soft-fill: rgba(37, 99, 235, 0.1);
}

html[data-theme="dark"] {
  /* Dark (hướng 1): xanh đêm + emerald */
  --vbee-purple: #0B1220;
  --vbee-purple-2: #0F172A;
  --vbee-purple-3: #020617;
  --vbee-purple-light: #34D399;
  --vbee-yellow: #34D399;
  --vbee-yellow-hover: #10B981;
  --vbee-primary: #34D399;
  --vbee-primary-hover: #10B981;
  --vbee-text-on-dark: #FFFFFF;
  --vbee-text-on-primary: #022C22;
  --vbee-muted: rgba(255, 255, 255, 0.72);
  --vbee-pill-border: rgba(255, 255, 255, 0.22);
  --brand-glow: rgba(52, 211, 153, 0.4);
  --brand-soft-fill: rgba(52, 211, 153, 0.12);
}

/* Primary CTA */
.btn-vbee-cta,
.btn-ivoi-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--vbee-yellow);
  color: var(--vbee-text-on-primary);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--vbee-radius-btn);
  border: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  box-shadow: 0 2px 8px var(--brand-glow);
}
.btn-vbee-cta svg,
.btn-ivoi-cta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn-vbee-cta:hover,
.btn-ivoi-cta:hover {
  background: var(--vbee-yellow-hover);
}
.btn-vbee-cta:disabled,
.btn-ivoi-cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-vbee-cta.lg {
  padding: 14px 28px;
  font-size: 1rem;
  min-height: 56px;
}

/* Voice pill rail */
.voice-rail-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}
.voice-rail-wrap > .voice-cat-tabs {
  flex: 0 0 100%;
}
.voice-rail {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1;
  min-width: 0;
  padding: 2px 0 6px;
}
.voice-rail::-webkit-scrollbar {
  display: none;
}
.voice-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--vbee-radius-pill);
  border: 1px solid var(--vbee-pill-border);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
  user-select: none;
}
.voice-pill:hover {
  border-color: var(--brand-glow);
  background: rgba(255, 255, 255, 0.1);
}
.voice-pill.active {
  border-color: var(--vbee-yellow);
  background: var(--brand-soft-fill);
}
.vpill-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--vbee-yellow);
  color: var(--vbee-text-on-primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.vpill-av-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.vpill-av-grad {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.82rem;
  color: #fff;
}
.vpill-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 120px;
}
.vpill-cat {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--vbee-muted, rgba(255, 255, 255, 0.72));
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vpill-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--vbee-text-on-dark, #fff);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vpill-play {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--vbee-yellow);
  color: var(--vbee-text-on-primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.vpill-play:hover {
  background: var(--vbee-yellow-hover);
}
.vpill-play svg {
  width: 14px;
  height: 14px;
  display: block;
}
.vpill-play.loading svg {
  animation: vpill-spin 0.7s linear infinite;
}
.vpill-play.playing {
  background: var(--vbee-purple-2);
  color: var(--vbee-yellow);
}
@keyframes vpill-spin {
  to { transform: rotate(360deg); }
}
.voice-rail-all {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--vbee-radius-pill);
  border: 1px solid var(--vbee-pill-border);
  background: transparent;
  color: var(--vbee-text-on-dark, #fff);
  cursor: pointer;
  white-space: nowrap;
}
.voice-rail-all:hover {
  border-color: var(--vbee-yellow);
  color: var(--vbee-yellow);
}

/* Light-context voice pills */
.voice-rail-light .voice-pill {
  background: #fff;
  border-color: #e5e7eb;
}
.voice-rail-light .voice-pill:hover {
  border-color: var(--vbee-purple-light);
  background: #fafafa;
}
.voice-rail-light .voice-pill.active {
  border-color: var(--vbee-purple-light);
  background: var(--brand-soft-fill);
}
.voice-rail-light .vpill-cat {
  color: #9ca3af;
}
.voice-rail-light .vpill-name {
  color: #111827;
}
.voice-rail-light .voice-rail-all {
  border-color: #e5e7eb;
  color: #374151;
}
.voice-rail-light .voice-rail-all:hover {
  border-color: var(--vbee-purple-light);
  color: var(--vbee-purple-light);
}

/* Dark hero context */
.voice-rail-dark .voice-pill {
  background: rgba(255, 255, 255, 0.08);
}
.voice-rail-dark .vpill-cat {
  color: rgba(255, 255, 255, 0.65);
}
.voice-rail-dark .vpill-name {
  color: #fff;
}

/* Round country flags + voice portrait avatars */
.voice-flag {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.voice-av-img,
.vpill-av-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.vp-flag {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line, #e5e7eb);
  flex-shrink: 0;
  vertical-align: middle;
}
.vt-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
