/* Digital Human Short Video — Dark Tech Theme */

/* === Root === */
.dhv-root {
  padding: 0;
  background: #080515;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* === Page wrapper === */
.dhv-page {
  padding: 0 12px 24px;
}

/* === Hero === */
.dhv-hero {
  padding: 22px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}
.dhv-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.15);
  filter: blur(20px);
}
.dhv-hero::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  filter: blur(20px);
}
.dhv-hero-title {
  font-size: 1.15rem;
  font-weight: 800;
  position: relative;
  z-index: 1;
}
.dhv-hero-subtitle {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: 5px;
  position: relative;
  z-index: 1;
}
.dhv-hero-pills {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.dhv-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* === Segmented Control (tabs) === */
.dhv-seg-wrap {
  background: #13102a;
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 16px;
  display: flex;
}
.dhv-seg-btn {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  color: rgba(255, 255, 255, 0.4);
  border: none;
  background: transparent;
}
.dhv-seg-btn.active {
  background: linear-gradient(135deg, #4338ca, #6366f1);
  color: #fff;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.35);
}

/* === Section label === */
.dhv-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dhv-label-count {
  color: #818cf8;
  font-size: 0.72rem;
}

/* === Glass card === */
.dhv-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  transition: all .2s;
}
.dhv-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

/* === Role card === */
.dhv-role {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dhv-role-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}
.dhv-role-info {
  flex: 1;
  min-width: 0;
}
.dhv-role-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dhv-role-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 3px;
}
.dhv-role-status.ready {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}
.dhv-role-status.processing {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}
.dhv-role-status.failed {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}
.dhv-role-delete {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.dhv-role-delete:hover {
  border-color: #f87171;
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

/* === Add role card === */
.dhv-add-card {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.dhv-add-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  color: #818cf8;
  background: rgba(99, 102, 241, 0.04);
}
.dhv-add-icon {
  font-size: 1.6rem;
}
.dhv-add-text {
  font-size: 0.8rem;
  font-weight: 600;
}

/* === Upload area === */
.dhv-upload {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: rgba(255, 255, 255, 0.02);
}
.dhv-upload:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.04);
}
.dhv-upload.has-file {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.04);
}
.dhv-upload-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}
.dhv-upload-text {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
}
.dhv-upload-hint {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.25);
  margin-top: 4px;
}

/* === Input === */
.dhv-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  box-sizing: border-box;
  margin-bottom: 12px;
  transition: border-color .2s;
}
.dhv-input:focus {
  outline: none;
  border-color: #6366f1;
}
.dhv-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

/* === Textarea === */
.dhv-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  resize: vertical;
  min-height: 100px;
  box-sizing: border-box;
  font-family: inherit;
  margin-bottom: 4px;
  transition: border-color .2s;
}
.dhv-textarea:focus {
  outline: none;
  border-color: #6366f1;
}
.dhv-textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

/* === Chips (audio source selector) === */
.dhv-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.dhv-chip {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  font-weight: 600;
}
.dhv-chip:hover {
  border-color: rgba(99, 102, 241, 0.3);
  color: #c4b5fd;
}
.dhv-chip.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
  color: #a5b4fc;
}

/* === Button === */
.dhv-btn {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all .2s;
}
.dhv-btn-primary {
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}
.dhv-btn-primary:hover {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}
.dhv-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.dhv-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #c4b5fd;
}
.dhv-btn-secondary:hover {
  border-color: rgba(99, 102, 241, 0.3);
}
.dhv-btn-danger {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: #f87171;
}

/* === Voice profile card === */
.dhv-vp {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  margin-bottom: 8px;
}
.dhv-vp:hover {
  border-color: rgba(99, 102, 241, 0.3);
}
.dhv-vp.active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}
.dhv-vp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.dhv-vp-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
}

/* === Produce role selector === */
.dhv-role-select {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.dhv-role-chip {
  flex-shrink: 0;
  width: 78px;
  padding: 10px 8px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.dhv-role-chip:hover {
  border-color: rgba(99, 102, 241, 0.3);
}
.dhv-role-chip.selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.2);
}
.dhv-role-chip-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
}
.dhv-role-chip-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* === Record list === */
.dhv-record {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .2s;
}
.dhv-record:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(255, 255, 255, 0.05);
}
.dhv-record-info {
  flex: 1;
  min-width: 0;
}
.dhv-record-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dhv-record-meta {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 2px;
}

/* === Result page === */
.dhv-result-player {
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 65vh;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dhv-result-player-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.8) 100%);
  pointer-events: none;
}
.dhv-play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
  z-index: 1;
}
.dhv-play-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}
.dhv-play-triangle {
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 20px solid #fff;
  margin-left: 4px;
}
.dhv-result-info {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  z-index: 1;
}
.dhv-result-title {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
}
.dhv-result-meta {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  margin-top: 3px;
}
.dhv-download-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.dhv-download {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  border: none;
}
.dhv-download-primary {
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}
.dhv-download-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #c4b5fd;
}
.dhv-download:hover {
  transform: translateY(-1px);
}

/* === Processing state === */
.dhv-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}
.dhv-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a78bfa, #6366f1);
  background-size: 200% 100%;
  border-radius: 2px;
  animation: dhv-shimmer 2s infinite linear;
}
@keyframes dhv-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.dhv-processing-text {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.82rem;
  text-align: center;
}

/* === Back button === */
.dhv-back {
  padding: 8px 0;
  font-size: 0.82rem;
  color: #818cf8;
  cursor: pointer;
  border: none;
  background: none;
  display: block;
  margin-bottom: 10px;
}

/* === Section divider === */
.dhv-divider {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 18px 0 10px;
}

/* === Char count === */
.dhv-char-count {
  text-align: right;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.25);
  margin-bottom: 12px;
}

/* === Empty state === */
.dhv-empty {
  text-align: center;
  padding: 32px 16px;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.82rem;
}

/* === Subtitle area === */
.dhv-subtitle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  margin-top: 10px;
}
.dhv-subtitle-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 8px;
}
.dhv-subtitle-content {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* === Status badges === */
.dhv-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 600;
}
.dhv-status-badge.is-pending {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}
.dhv-status-badge.is-processing {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
}
.dhv-status-badge.is-completed {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
}
.dhv-status-badge.is-failed {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

/* === Message === */
.dhv-message {
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  display: none;
}
.dhv-message.is-error {
  display: block;
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.15);
}
.dhv-message.is-success {
  display: block;
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.15);
}
.dhv-message.is-info {
  display: block;
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.15);
}

/* === Role counter === */
.dhv-role-counter {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 8px;
  font-weight: 600;
}

/* === Empty hint === */
.dhv-empty-hint {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.25);
  padding: 8px 0;
  margin: 0;
}

/* === Video player (generic) === */
.dhv-video-player {
  width: 100%;
  border-radius: 16px;
  background: #000;
  margin-bottom: 12px;
  max-height: 70vh;
}

/* === Upload filename === */
.dhv-upload-filename {
  font-size: 0.82rem;
  color: #34d399;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* === Responsive === */
@media (max-width: 480px) {
  .dhv-role-select {
    gap: 8px;
  }
  .dhv-chips {
    flex-direction: column;
  }
  .dhv-download-row {
    flex-direction: column;
  }
}
