/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0D0B14;
  --bg2:       #1A1625;
  --bg3:       #2D2640;
  --purple:    #7C3AED;
  --purple-l:  #A855F7;
  --purple-d:  #6D28D9;
  --muted:     #5C5480;
  --muted-l:   #A89EC9;
  --white:     #FFFFFF;
  --emerald:   #10B981;
  --emerald-l: #34D399;
  --font-display: 'Syne', sans-serif;
  --font-body:    'Plus Jakarta Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Noise texture overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* ── Glass card ── */
.glass-card {
  background: rgba(26, 22, 37, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(124, 58, 237, 0.15);
}

/* ── Neon border ── */
.neon-border {
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.12), inset 0 0 24px rgba(124, 58, 237, 0.04);
}

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(13, 11, 20, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(124, 58, 237, 0.12);
  height: 64px;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--purple), var(--purple-l));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
}
.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--white);
  letter-spacing: -0.3px;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-l);
  text-decoration: none;
  transition: all 0.2s;
}
.nav-link:hover { color: var(--white); background: rgba(124,58,237,0.1); }
.nav-link-active { color: var(--white); background: rgba(124,58,237,0.15); }

/* ── Main layout ── */
.main { padding-top: 64px; position: relative; z-index: 1; }
.container {
  max-width: 896px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.breadcrumb-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.breadcrumb-link:hover { color: var(--muted-l); }
.breadcrumb-sep { color: var(--muted); }
.breadcrumb-current { color: var(--muted-l); }

/* ── Page header ── */
.page-header { margin-bottom: 32px; }
.page-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}
.page-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Processing panel ── */
.processing-panel {
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 24px;
}
.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.progress-left { display: flex; align-items: center; gap: 12px; }
.status-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.status-icon.done {
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 50%;
  color: var(--emerald-l);
  font-size: 14px;
}
.status-label {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}
.status-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.progress-pct {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
}
.progress-track {
  height: 8px;
  background: var(--bg);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 24px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--purple-l));
  border-radius: 99px;
  transition: width 0.3s ease-out;
}

/* ── Processing ring ── */
.processing-ring {
  width: 28px; height: 28px;
  border: 3px solid rgba(168,85,247,0.2);
  border-top-color: var(--purple-l);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Steps list ── */
.steps-list { display: flex; flex-direction: column; gap: 8px; }
.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.3s;
}
.step-item.pending { background: rgba(26,22,37,0.5); }
.step-item.current {
  background: rgba(124,58,237,0.15);
  border-color: rgba(124,58,237,0.35);
  animation: pulse 2s ease-in-out infinite;
}
.step-item.completed {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.2);
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.75; }
}
.step-icon { font-size: 18px; flex-shrink: 0; }
.step-icon.bounce { animation: bounce 0.6s ease-in-out infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-3px); } }
.step-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}
.step-label.pending { color: var(--muted); }
.step-label.current { color: var(--white); }
.step-label.completed { color: var(--emerald-l); }
.step-check { color: var(--emerald-l); flex-shrink: 0; }
.step-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(168,85,247,0.3);
  border-top-color: var(--purple-l);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ── Drop zone ── */
.dropzone {
  border: 2px dashed var(--bg3);
  border-radius: 20px;
  padding: 64px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}
.dropzone:hover { border-color: rgba(124,58,237,0.4); }
.dropzone.drag-active {
  border-color: var(--purple-l);
  background: rgba(168,85,247,0.07);
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.dz-icon, .file-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.dz-icon { background: var(--bg3); }
.file-icon { background: rgba(124,58,237,0.15); }
.dz-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}
.dz-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.file-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
  word-break: break-all;
}
.file-size { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* ── Buttons ── */
.btn-select {
  padding: 8px 24px;
  background: var(--purple);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  z-index: 2;
}
.btn-select:hover { background: var(--purple-d); }
.btn-remove {
  background: none;
  border: none;
  color: #F87171;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
  z-index: 2;
}
.btn-remove:hover { color: #FCA5A5; }

/* ── Settings panel ── */
.settings-panel {
  border-radius: 20px;
  padding: 24px;
  margin-top: 20px;
}
.settings-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 16px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .settings-grid { grid-template-columns: 1fr; } }
.setting-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-l);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.setting-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--bg3);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 13px;
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  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='%235C5480' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.setting-select:focus { border-color: var(--purple); }
.setting-select option { background: var(--bg2); }

/* ── Form actions ── */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}
.btn-cancel {
  padding: 12px 24px;
  border: 1px solid var(--bg3);
  border-radius: 12px;
  color: var(--muted-l);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-cancel:hover { border-color: rgba(124,58,237,0.4); color: var(--white); }
.btn-process {
  flex: 1;
  max-width: 280px;
  padding: 13px 32px;
  border: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-process:disabled {
  background: var(--bg3);
  color: var(--muted);
  cursor: not-allowed;
}
.btn-process.ready {
  background: linear-gradient(135deg, var(--purple), var(--purple-l));
  color: var(--white);
  box-shadow: 0 8px 24px rgba(124,58,237,0.3);
}
.btn-process.ready:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Dashboard page ── */
.dash-hero {
  text-align: center;
  padding: 80px 24px 48px;
}
.dash-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--white) 40%, var(--purple-l));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.dash-sub { font-size: 15px; color: var(--muted-l); margin-bottom: 32px; }
.btn-upload-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--purple), var(--purple-l));
  color: var(--white);
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(124,58,237,0.35);
  transition: all 0.2s;
}
.btn-upload-cta:hover { opacity: 0.9; transform: translateY(-2px); }
.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 0 24px 60px;
  max-width: 1200px;
  margin: 0 auto;
}
.clip-card {
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s;
}
.clip-card:hover { transform: translateY(-3px); }
.clip-thumb {
  aspect-ratio: 9/16;
  max-height: 200px;
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.clip-info { padding: 14px; }
.clip-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 6px;
}
.clip-meta { display: flex; align-items: center; justify-content: space-between; }
.clip-score {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(124,58,237,0.2);
  color: var(--purple-l);
}
.clip-dur { font-size: 11px; color: var(--muted); }
