/* ===== APP LAYOUT ===== */
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-secondary);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--fg-primary);
  background: var(--bg-card-hover);
}

.nav-link.active {
  color: var(--accent-bright);
  background: var(--accent-glow);
}

/* ===== MAIN ===== */
.app-main {
  min-height: 100vh;
  padding-top: 80px;
}

.app-section {
  position: relative;
  padding: 80px 20px;
  overflow: hidden;
}

.app-section.hidden {
  display: none;
}

.section-glow {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 500px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.app-container {
  max-width: 700px;
  margin: 0 auto;
}

/* ===== UPLOAD HEADER ===== */
.upload-header {
  text-align: center;
  margin-bottom: 48px;
}

.upload-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  margin-top: 20px;
}

.upload-subtitle {
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* ===== TABS ===== */
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg-secondary);
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--fg-secondary);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(6,182,212,0.1));
  color: var(--fg-primary);
  border: 1px solid rgba(168,85,247,0.3);
}

.tab-icon {
  font-style: normal;
}

.tab-panel {
  animation: fadeIn 0.2s ease;
}

.tab-panel.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== URL INPUT ===== */
.input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.url-input {
  flex: 1;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
  color: var(--fg-primary);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input::placeholder {
  color: var(--fg-muted);
}

.url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-hint {
  font-size: 13px;
  color: var(--fg-muted);
  text-align: center;
}

/* ===== BUTTONS ===== */
.btn-primary {
  padding: 16px 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(168,85,247,0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--fg-secondary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--fg-primary);
}

.btn-icon {
  font-style: normal;
}

/* ===== DROP ZONE ===== */
.drop-zone {
  padding: 60px 40px;
  border-radius: var(--radius);
  border: 2px dashed var(--border-strong);
  background: var(--bg-card);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.drop-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.drop-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.drop-hint {
  font-size: 14px;
  color: var(--fg-muted);
}

.file-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
}

.file-selected.hidden {
  display: none;
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.file-size {
  font-size: 13px;
  color: var(--fg-muted);
}

/* ===== PROCESSING CARD ===== */
.processing-card {
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary);
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.4), 0 0 80px var(--accent-glow);
  max-width: 520px;
  margin: 0 auto;
}

.processing-body {
  padding: 48px 40px;
  text-align: center;
}

.processing-status {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.4; }
}

.status-icon {
  font-size: 36px;
  position: relative;
  z-index: 1;
}

.processing-label {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.processing-sub {
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 32px;
}

.progress-bar-wrap {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-card);
  overflow: hidden;
  margin-bottom: 32px;
}

.progress-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  transition: width 0.5s ease;
}

.processing-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.p-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--fg-muted);
  transition: color 0.3s;
}

.p-step.done {
  color: var(--fg-primary);
}

.p-step.active {
  color: var(--accent-bright);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
  transition: background 0.3s;
}

.p-step.done .step-dot {
  background: #22c55e;
}

.p-step.active .step-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===== RESULTS ===== */
.results-header {
  margin-bottom: 40px;
}

.results-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.results-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.results-subtitle {
  font-size: 15px;
  color: var(--fg-muted);
}

/* ===== CLIPS GRID ===== */
.clips-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.clip-item {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
  transition: all 0.3s;
}

.clip-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.clip-item-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
}

.clip-score-badge {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

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

.clip-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.clip-label-badge {
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--accent-glow);
  border: 1px solid rgba(168,85,247,0.3);
  color: var(--accent-bright);
  font-size: 12px;
  font-family: var(--font-display);
  font-weight: 500;
}

.clip-time-range {
  font-size: 13px;
  color: var(--fg-muted);
}

.clip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-export {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent-glow);
  color: var(--accent-bright);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-export:hover {
  background: var(--accent);
  color: white;
}

.btn-export:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-download {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34,197,94,0.4);
}

.clip-transcript {
  padding: 0 24px 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.clip-transcript p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg-secondary);
  font-style: italic;
}

.exporting-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-muted);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== NO CLIPS ===== */
.no-clips {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-muted);
}

.no-clips.hidden { display: none; }

.no-clips-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-clips p {
  margin-bottom: 24px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  background: var(--fg-primary);
  color: var(--bg-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 999;
  animation: slideUp 0.3s ease;
}

.toast.hidden { display: none; }

.toast.error {
  background: #ef4444;
  color: white;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .input-group {
    flex-direction: column;
  }

  .btn-primary {
    justify-content: center;
  }

  .clip-item-header {
    flex-wrap: wrap;
  }

  .clip-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .results-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}
