/* ===========================
   VoiceForge AI — Premium CSS
   =========================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-base: #070b14;
  --bg-surface: #0d1525;
  --bg-card: #111827;
  --bg-card-hover: #162035;
  --bg-input: #0d1525;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.15);

  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #a855f7;
  --accent-teal: #06b6d4;
  --accent-orange: #f97316;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;

  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 40px rgba(99,102,241,0.15);

  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--accent-1); border-radius: 3px; }

/* ─────────────────────────────
   NAVBAR
───────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 64px;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(7, 11, 20, 0.95);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 36px;
  height: 36px;
  display: block;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.logo-ai {
  color: var(--accent-1);
  margin-left: 2px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: block;
  padding: 6px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: rgba(99,102,241,0.1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.api-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s infinite;
}

.status-dot.error {
  background: var(--error);
  animation: none;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.btn-settings {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-settings:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ─────────────────────────────
   MODALS
───────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 440px;
  padding: 28px;
  transform: translateY(-16px);
  transition: transform 0.25s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-overlay.open .modal-box {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-display);
}

.modal-close {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

/* ─────────────────────────────
   HERO
───────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 100px 24px 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% -10%, rgba(99,102,241,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 80% 60%, rgba(168,85,247,0.15) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(6,182,212,0.1) 0%, transparent 50%),
    var(--bg-base);
}

#wave-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.4;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-2);
  letter-spacing: 0.5px;
  margin-bottom: 28px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-1);
  animation: pulse-dot 2s infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3), var(--accent-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.btn-hero {
  padding: 14px 28px !important;
  font-size: 1rem !important;
  gap: 10px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

.hero-visual {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  height: 300px;
  opacity: 0.6;
  pointer-events: none;
}

.audio-visualizer-hero .viz-bars {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 200px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.audio-visualizer-hero .viz-bars span {
  display: block;
  width: 6px;
  background: linear-gradient(to top, var(--accent-1), var(--accent-3));
  border-radius: 3px;
  animation: bar-bounce var(--d, 1s) var(--delay, 0s) ease-in-out infinite alternate;
  height: 20px;
}

@keyframes bar-bounce {
  to { height: var(--h, 100px); }
}

/* ─────────────────────────────
   MAIN APP
───────────────────────────── */
.main-app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.app-section {
  padding-top: 80px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.section-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(168,85,247,0.2));
  border: 1px solid rgba(99,102,241,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent-1);
}

.section-icon.section-icon-purple {
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(99,102,241,0.2));
  border-color: rgba(168,85,247,0.3);
}

.section-icon.section-icon-purple svg { stroke: var(--accent-3); }

.section-icon.section-icon-teal {
  background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(99,102,241,0.2));
  border-color: rgba(6,182,212,0.3);
}

.section-icon.section-icon-teal svg { stroke: var(--accent-teal); }

.section-icon.section-icon-orange {
  background: linear-gradient(135deg, rgba(249,115,22,0.2), rgba(251,191,36,0.2));
  border-color: rgba(249,115,22,0.3);
}

.section-icon.section-icon-orange svg { stroke: var(--accent-orange); }

.section-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─────────────────────────────
   CARDS
───────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.card-inner {
  padding: 28px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg {
  opacity: 0.7;
}

/* ─────────────────────────────
   FORM ELEMENTS
───────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.form-label svg {
  opacity: 0.7;
}

.char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.input-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: var(--transition);
  outline: none;
  appearance: none;
}

.input-field:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.textarea-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: var(--font-sans);
  line-height: 1.6;
  resize: vertical;
  min-height: 160px;
  transition: var(--transition);
  outline: none;
}

.textarea-field:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.textarea-field::placeholder {
  color: var(--text-muted);
}

/* ── RTL support for Urdu / Arabic / Hindi ── */
.textarea-field[dir="rtl"],
.textarea-field.rtl-active {
  font-family: 'Noto Nastaliq Urdu', 'Noto Sans Arabic', 'Segoe UI', serif;
  font-size: 1.05rem;
  line-height: 2.2;          /* Nastaliq script needs extra line-height */
  text-align: right;
  letter-spacing: 0;
  direction: rtl;
}

/* When dir=auto detects RTL, browser handles it — just ensure font */
.textarea-field:dir(rtl) {
  font-family: 'Noto Nastaliq Urdu', 'Noto Sans Arabic', 'Segoe UI', serif;
  font-size: 1.05rem;
  line-height: 2.2;
  letter-spacing: 0;
}

.select-field {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.select-field option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.range-input {
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-input);
  border: none;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.range-input::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-1);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
  transition: var(--transition);
}

.range-input::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px rgba(99,102,241,0.25);
  transform: scale(1.1);
}

.controls-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.flex-1 { flex: 1; }

/* ─────────────────────────────
   BUTTONS
───────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: white;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  opacity: 0;
  transition: opacity 0.22s ease;
}

.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.35); }
.btn-primary:active { transform: translateY(0); }

.btn-primary span, .btn-primary svg {
  position: relative;
  z-index: 1;
}

.btn-generate {
  width: 100%;
  padding: 14px !important;
  font-size: 0.95rem !important;
  margin-top: 8px;
  gap: 10px;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.04);
}

.btn-danger {
  color: var(--error) !important;
  border-color: rgba(239,68,68,0.3) !important;
}

.btn-danger:hover {
  background: rgba(239,68,68,0.08) !important;
  border-color: rgba(239,68,68,0.6) !important;
}

.btn-refresh {
  margin-left: auto;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.btn-icon-sm {
  width: 28px;
  height: 28px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 6px;
  color: var(--error);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: var(--transition);
}

.btn-icon-sm:hover {
  background: rgba(239,68,68,0.2);
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  position: relative;
  z-index: 1;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─────────────────────────────
   TTS LAYOUT
───────────────────────────── */
.tts-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .tts-layout {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────
   UPLOAD ZONE
───────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent-1);
  background: rgba(99,102,241,0.05);
}

.upload-inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.upload-inner svg {
  color: var(--text-muted);
}

.upload-inner p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.upload-link {
  color: var(--accent-1);
  cursor: pointer;
}

.upload-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.upload-zone-lg .upload-inner {
  padding: 40px;
}

.upload-icon-lg svg {
  color: var(--accent-2);
  opacity: 0.8;
}

.ref-audio-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  flex-wrap: wrap;
}

.ref-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.ref-file-info svg {
  color: var(--accent-1);
  flex-shrink: 0;
}

.ref-audio-preview audio {
  flex: 1;
  min-width: 180px;
  height: 36px;
}

/* ─────────────────────────────
   OUTPUT CARD
───────────────────────────── */
.output-card {
  min-height: 200px;
}

.output-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 28px;
  color: var(--text-muted);
}

.placeholder-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-icon svg {
  opacity: 0.4;
}

.output-placeholder p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.audio-output {
  padding: 20px;
}

.output-waveform {
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  height: 80px;
  background: var(--bg-input);
}

#waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.custom-player {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.player-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
}

.player-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

.player-progress {
  flex: 1;
  height: 5px;
  background: var(--bg-input);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: visible;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent-1), var(--accent-3));
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-2);
  left: 0%;
  opacity: 0;
  transition: opacity 0.15s;
}

.player-progress:hover .progress-thumb { opacity: 1; }

.player-actions {
  display: flex;
  gap: 8px;
}

/* ─────────────────────────────
   QUICK STATS CARD
───────────────────────────── */
.quick-stats-card {
  margin-top: 16px;
}

.quick-stats-card .card-inner {
  padding: 20px 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.stat-box-num {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-box-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─────────────────────────────
   CLONE SECTION
───────────────────────────── */
.clone-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .clone-layout {
    grid-template-columns: 1fr;
  }
}

.clone-card .card-inner {
  padding: 28px;
}

.clone-tips {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: rgba(251,191,36,0.06);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.tip-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.tip-content strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.tip-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tip-content ul li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding-left: 14px;
  position: relative;
}

.tip-content ul li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--warning);
}

.clone-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.clone-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(99,102,241,0.07);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.clone-file-item svg {
  color: var(--accent-1);
  flex-shrink: 0;
}

.clone-file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clone-file-item .file-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Cloned voices list */
.cloned-voices-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.voice-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.voice-item:hover {
  border-color: var(--border-hover);
}

.voice-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.voice-info {
  flex: 1;
  overflow: hidden;
}

.voice-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.voice-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.voice-action-btn {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 12px;
}

.voice-action-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.voice-action-btn.use-voice {
  background: rgba(99,102,241,0.1);
  border-color: rgba(99,102,241,0.25);
  color: var(--accent-1);
}

.voice-action-btn.use-voice:hover {
  background: rgba(99,102,241,0.2);
}

.voice-action-btn.del-voice {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.2);
  color: var(--error);
}

.voice-action-btn.del-voice:hover {
  background: rgba(239,68,68,0.15);
}

/* Clone progress */
.clone-progress-card .card-inner {
  padding: 24px;
}

.progress-bar-container {
  margin-bottom: 24px;
}

.progress-bar-track {
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--accent-1), var(--accent-3));
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.clone-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clone-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.clone-step.active { color: var(--accent-1); }
.clone-step.done { color: var(--success); }

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.clone-step.active .step-dot {
  background: var(--accent-1);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.2);
}

.clone-step.done .step-dot { background: var(--success); }

/* ─────────────────────────────
   VOICE LIBRARY
───────────────────────────── */
.library-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.library-search-bar:focus-within {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.library-search-bar svg { color: var(--text-muted); flex-shrink: 0; }

.library-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
}

.library-search-input::placeholder { color: var(--text-muted); }

.voice-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.library-voice-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  cursor: pointer;
}

.library-voice-card:hover {
  border-color: rgba(99,102,241,0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.library-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.library-voice-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.library-voice-info { flex: 1; overflow: hidden; }

.library-voice-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-voice-tags {
  display: flex;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.voice-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(99,102,241,0.12);
  color: var(--accent-2);
  border: 1px solid rgba(99,102,241,0.2);
}

.library-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.library-card-actions {
  display: flex;
  gap: 8px;
}

.library-card-actions .btn-primary {
  flex: 1;
  padding: 8px 14px !important;
  font-size: 0.82rem !important;
}

.library-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.loader-ring {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ─────────────────────────────
   HISTORY
───────────────────────────── */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.history-item:hover {
  border-color: var(--border-hover);
}

.history-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(168,85,247,0.2));
  border: 1px solid rgba(99,102,241,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-icon svg { color: var(--accent-1); }

.history-info {
  flex: 1;
  overflow: hidden;
}

.history-text {
  font-size: 0.875rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.history-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ─────────────────────────────
   EMPTY STATE
───────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state svg { opacity: 0.3; }

.empty-state p {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ─────────────────────────────
   TOAST
───────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  font-size: 0.875rem;
  color: var(--text-primary);
  pointer-events: all;
  min-width: 280px;
  max-width: 380px;
  animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.removing {
  animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(60px) scale(0.9); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(60px) scale(0.9); }
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}

.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.success .toast-icon { background: rgba(16,185,129,0.15); color: var(--success); }

.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.error .toast-icon { background: rgba(239,68,68,0.15); color: var(--error); }

.toast.info { border-color: rgba(99,102,241,0.3); }
.toast.info .toast-icon { background: rgba(99,102,241,0.15); color: var(--accent-1); }

/* ─────────────────────────────
   FOOTER
───────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 32px 24px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.footer-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─────────────────────────────
   RESPONSIVE
───────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 80px 20px 60px; }
  .hero-visual { display: none; }
  .hero-stats { flex-wrap: wrap; gap: 16px; }
  .hero-actions { flex-direction: column; }
  .btn-hero { width: 100%; }
  .controls-row { flex-direction: column; }
  .section-header { flex-wrap: wrap; }
}

/* ─────────────────────────────
   UTILITY
───────────────────────────── */
.hidden { display: none !important; }

.pulse-anim {
  animation: pulse-anim 0.6s ease;
}

@keyframes pulse-anim {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}
