/* ════════════════════════════════════════════════════════════
   Video Clipper — Styles
   ════════════════════════════════════════════════════════════ */

/* ── Welcome Screen ─────────────────────────────────────────── */
.welcome-container {
  max-width: 580px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.welcome-badge {
  display: inline-block;
  background: var(--primary-50);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.welcome-gauge-icon { margin-bottom: 1rem; }

.welcome-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
  line-height: 1.15;
}

.welcome-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.welcome-description {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 500px;
}

.welcome-field-group {
  width: 100%;
  text-align: left;
  margin-bottom: 1.25rem;
}

.welcome-field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.welcome-error {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  text-align: center;
}

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

.welcome-footer {
  margin-top: 2.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.welcome-footer strong {
  color: var(--primary);
  font-weight: 600;
}

/* ── Upload Zone ────────────────────────────────────────────── */
.upload-zone {
  width: 100%;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: var(--bg-white);
}

.upload-zone:hover {
  border-color: var(--primary-light);
  background: var(--primary-50);
}

.upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-50);
  box-shadow: var(--shadow-glow);
}

.upload-zone.has-file {
  border-style: solid;
  border-color: var(--primary-light);
  cursor: default;
  padding: 1.25rem 1.5rem;
}

.upload-zone-idle { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }

.upload-zone-icon {
  color: var(--primary-light);
  margin-bottom: 0.25rem;
}

.upload-zone-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

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

.upload-zone-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
}

.upload-file-icon { color: var(--primary); flex-shrink: 0; }

.upload-file-info { flex: 1; min-width: 0; }

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

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

.upload-file-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.375rem;
  border-radius: var(--radius);
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.upload-file-remove:hover {
  background: var(--red-bg);
  color: var(--red);
}

.upload-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--yellow-text);
  background: var(--yellow-bg);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

/* ── Uploading Screen ───────────────────────────────────────── */
.uploading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.uploading-spinner { margin-bottom: 1.5rem; }

.uploading-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.015em;
}

.uploading-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.upload-progress-container {
  width: 100%;
  margin-bottom: 2rem;
}

.upload-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.upload-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.3s ease;
}

.upload-progress-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}

.uploading-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
}

.uploading-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-white);
  border: 1px solid var(--border);
  opacity: 0.4;
  transition: all 0.4s ease;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.uploading-step.active {
  opacity: 1;
  border-color: var(--primary-light);
  background: var(--primary-50);
  color: var(--primary-dark);
  font-weight: 600;
}

.uploading-step.done {
  opacity: 1;
  border-color: var(--green);
  background: var(--green-bg);
  color: var(--green-text);
}

.uploading-step-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uploading-step .step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.uploading-step .step-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary-100);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: analyzeSpin 0.8s linear infinite;
}

.uploading-step.done .step-dot,
.uploading-step.done .step-spinner { display: none; }

.uploading-step.done .uploading-step-icon::after {
  content: '';
  display: block;
  width: 14px;
  height: 8px;
  border-left: 2.5px solid var(--green);
  border-bottom: 2.5px solid var(--green);
  transform: rotate(-45deg);
  margin-top: -2px;
}

.uploading-step.active .step-dot { display: none; }

/* ── Analyzing Screen ───────────────────────────────────────── */
.analyzing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.analyzing-spinner { margin-bottom: 1.5rem; }

.analyzing-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.015em;
}

.analyzing-url {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  word-break: break-all;
  max-width: 400px;
}

.analyzing-steps {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  width: 100%;
  text-align: left;
}

.analyzing-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-white);
  border: 1px solid var(--border);
  opacity: 0.4;
  transition: all 0.4s ease;
}

.analyzing-step.active {
  opacity: 1;
  border-color: var(--primary-light);
  background: var(--primary-50);
}

.analyzing-step.done {
  opacity: 1;
  border-color: var(--green);
  background: var(--green-bg);
}

.analyzing-step-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.analyzing-step-icon .step-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary-100);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: analyzeSpin 0.8s linear infinite;
}

.analyzing-step-icon .step-check {
  display: none;
  color: var(--green);
}

.analyzing-step-icon .step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}

.analyzing-step.active .step-spinner { display: block; }
.analyzing-step.active .step-dot { display: none; }

.analyzing-step.done .step-check { display: block; }
.analyzing-step.done .step-dot { display: none; }
.analyzing-step.done .step-spinner { display: none; }

.analyzing-step-text {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.analyzing-step.active .analyzing-step-text {
  color: var(--primary-dark);
  font-weight: 600;
}

.analyzing-step.done .analyzing-step-text {
  color: var(--green-text);
}

.analyzing-step-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

.analyzing-step.active .analyzing-step-detail { color: var(--primary); }
.analyzing-step.done .analyzing-step-detail { color: var(--green); }

/* ── Error Screen ───────────────────────────────────────────── */
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  gap: 1rem;
}

.error-icon { margin-bottom: 0.5rem; }

.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.error-message {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

/* ── Lead Capture Screen ────────────────────────────────────── */
.lead-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.lead-teaser {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lead-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.025em;
}

.lead-clip-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-50);
  color: var(--primary);
  font-size: 1.125rem;
  font-weight: 700;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.lead-video-summary {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  max-width: 480px;
  line-height: 1.5;
}

.lead-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
}

.lead-option-card {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  position: relative;
}

.lead-option-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.lead-option-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.lead-option-full {
  border-color: var(--primary);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.lead-recommended-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lead-form { display: flex; flex-direction: column; gap: 0.625rem; }

.lead-privacy {
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
  margin-bottom: 0 !important;
  margin-top: 0.5rem;
}

/* ── Results Screen ─────────────────────────────────────────── */
.results-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.result-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.result-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* ── Video Player ───────────────────────────────────────────── */
.video-player-card {
  padding: 0;
  overflow: hidden;
  background: #000;
}

.video-player-card video {
  width: 100%;
  display: block;
  max-height: 450px;
  background: #000;
}

/* ── Summary Card ───────────────────────────────────────────── */
.video-summary-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Cut All Bar ────────────────────────────────────────────── */
.cut-all-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.cut-all-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ── Clip Card ──────────────────────────────────────────────── */
.clip-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.clip-card.is-cutting {
  opacity: 0.6;
  pointer-events: none;
}

.clip-card.is-ready {
  border-color: var(--green);
}

.clip-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem 0.75rem;
}

.clip-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.clip-card.is-ready .clip-number {
  background: var(--green-bg);
  color: var(--green);
}

.clip-info { flex: 1; min-width: 0; }

.clip-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.clip-summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.375rem;
}

.clip-reason {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

/* ── Timestamp Controls ─────────────────────────────────────── */
.clip-timestamps {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.timestamp-group {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.timestamp-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 32px;
}

.timestamp-nudge {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.timestamp-nudge:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-50);
}

.timestamp-input {
  width: 72px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', monospace;
  padding: 0.3rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-primary);
  transition: border-color 0.15s ease;
}

.timestamp-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-100);
}

.timestamp-separator {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.clip-duration {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  margin-left: auto;
  white-space: nowrap;
}

/* ── Clip Actions ───────────────────────────────────────────── */
.clip-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.5rem 1.25rem;
  flex-wrap: wrap;
}

.clip-actions .btn {
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
}

.btn-preview {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: all 0.15s ease;
}

.btn-preview:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.btn-cut {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: all 0.15s ease;
}

.btn-cut:hover { background: var(--primary-dark); }

.btn-download {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  transition: all 0.15s ease;
}

.btn-download:hover { filter: brightness(1.1); }

.clip-cut-status {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* ── FFmpeg Overlay ─────────────────────────────────────────── */
.ffmpeg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.ffmpeg-overlay-inner {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 2.5rem 3rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
}

.ffmpeg-spinner { margin-bottom: 1rem; }

.ffmpeg-status {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.ffmpeg-progress {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── CTA Card ───────────────────────────────────────────────── */
.result-cta-card {
  text-align: center;
  padding: 2.5rem 2rem;
  margin-top: 0.5rem;
}

.result-cta-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
}

.result-cta-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .welcome-title { font-size: 1.75rem; }
  .welcome-subtitle { font-size: 1rem; }
  .welcome-description { font-size: 0.875rem; }

  .lead-title { font-size: 1.5rem; }

  .lead-options {
    grid-template-columns: 1fr;
  }
  .lead-option-full { order: -1; }

  .video-player-card video { max-height: 260px; }

  .clip-card-header { padding: 1rem 1rem 0.75rem; }
  .clip-timestamps { padding: 0.75rem 1rem; gap: 0.75rem; }
  .clip-actions { padding: 0.75rem 1rem 1rem; }

  .clip-duration { margin-left: 0; width: 100%; margin-top: 0.25rem; }

  .cut-all-bar { flex-direction: column; align-items: flex-start; }

  .result-cta-card { padding: 2rem 1.5rem; }
}

@media (max-width: 480px) {
  .welcome-container { padding: 2rem 1rem; }
  .welcome-title { font-size: 1.5rem; }

  .upload-zone { padding: 1.5rem 1rem; }

  .timestamp-group { gap: 0.25rem; }
  .timestamp-nudge { padding: 0.2rem 0.25rem; font-size: 0.625rem; }
  .timestamp-input { width: 64px; font-size: 0.8125rem; }

  .clip-title { font-size: 1rem; }
  .clip-actions { gap: 0.5rem; }

  .ffmpeg-overlay-inner { padding: 2rem 1.5rem; margin: 0 1rem; }
}
