/* ═══ APP-WIDE ═══ */

/* Navigation */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 6vw;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.nav-brand .dot { color: var(--accent); }

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

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

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

/* Hero CTA */
.hero-cta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  background: var(--accent);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
}

.btn-hero:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.hero-cta-note {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ═══ APP LAYOUT ═══ */
.app-main {
  padding-top: 80px;
  min-height: 100vh;
}

.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 6vw 80px;
}

.page-header {
  margin-bottom: 48px;
}

.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 16px 0 12px;
}

.page-sub {
  color: var(--fg-muted);
  font-size: 1rem;
  max-width: 560px;
  line-height: 1.65;
  margin-bottom: 24px;
}

/* ═══ BUTTONS ═══ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary.hidden { display: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-elevated);
  color: var(--fg);
  font-size: 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s;
}

.btn-secondary:hover { border-color: rgba(255,255,255,0.15); }

/* ═══ UPLOAD ZONE ═══ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 64px 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-elevated);
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(255, 61, 0, 0.04);
}

.upload-zone.hidden { display: none; }

.upload-icon { font-size: 3rem; }

.upload-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upload-text strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.upload-text span {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

/* ═══ PROGRESS ═══ */
.upload-progress {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 40px;
}

.upload-progress.hidden { display: none; }

.progress-file {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.progress-icon { font-size: 1.5rem; }

.progress-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.progress-filename {
  font-weight: 500;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
}

.progress-size {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.progress-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-2);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-msg {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* ═══ PROCESSING CARD ═══ */
.processing-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}

.processing-card.hidden { display: none; }

.processing-pulse {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

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

.pulse-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-2);
}

@keyframes pulse-ring {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.processing-info {
  flex: 1;
}

.processing-info h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.processing-info p {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.processing-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px;
  text-align: center;
  color: var(--fg-muted);
}

/* ═══ STATUS BADGES ═══ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-uploaded { background: rgba(0, 212, 255, 0.1); color: var(--accent-2); }
.status-processing { background: rgba(255, 200, 0, 0.1); color: #ffc800; animation: blink 1.5s ease-in-out infinite; }
.status-done { background: rgba(0, 255, 100, 0.1); color: #00c853; }
.status-error { background: rgba(255, 61, 0, 0.1); color: var(--accent); }
.status-uploading { background: rgba(0, 212, 255, 0.1); color: var(--accent-2); animation: blink 1.5s ease-in-out infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ═══ VIDEO LIST ═══ */
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  margin-bottom: 16px;
}

.recent-uploads { margin-top: 48px; }

.videos-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.video-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg);
  transition: background 0.15s;
}

.video-row:hover { background: rgba(255,255,255,0.04); }

.video-row-icon { font-size: 1.4rem; }

.video-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.video-row-name {
  font-size: 0.95rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-row-meta {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

/* ═══ VIDEO DETAIL ═══ */
.back-link { margin-bottom: 24px; }
.back-link a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}
.back-link a:hover { color: var(--fg); }

.video-header {
  margin-bottom: 40px;
}

.video-detail-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.video-detail-icon { font-size: 2.5rem; }

.video-detail-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.video-detail-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--fg-muted);
  flex-wrap: wrap;
}

.clips-count {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 12px;
}

/* ═══ CLIPS GRID ═══ */
.clips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.clip-card {
  background: var(--bg-elevated);
  padding: 32px;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.clip-card:first-child { border-radius: var(--radius) 0 0 0; }
.clip-card:nth-child(2) { border-radius: 0 var(--radius) 0 0; }
.clip-card:nth-last-child(2) { border-radius: 0 0 0 var(--radius); }
.clip-card:last-child { border-radius: 0 0 var(--radius) 0; }
.clip-card:only-child { border-radius: var(--radius); }

.clip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.clip-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
}

.virality-score {
  display: flex;
  align-items: center;
  gap: 6px;
}

.virality-label {
  font-size: 0.72rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.virality-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-2);
}

.clip-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.clip-hook {
  font-style: italic;
  color: var(--accent);
  font-size: 0.9rem;
  line-height: 1.5;
}

.clip-transcript {
  color: var(--fg-muted);
  font-size: 0.85rem;
  line-height: 1.65;
  flex: 1;
}

.clip-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.clip-timing {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.clip-platforms {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.platform-tag {
  padding: 3px 8px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--accent-2);
  font-weight: 500;
}

/* ═══ STATES ═══ */
.empty-state {
  padding: 48px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.9rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
}

.accent-link { color: var(--accent); text-decoration: none; }
.accent-link:hover { text-decoration: underline; }

.error-state { color: var(--accent); }

.loading-state {
  padding: 40px;
  text-align: center;
  color: var(--fg-muted);
}

.hidden { display: none !important; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .app-container { padding: 40px 24px 60px; }
  .clips-grid { grid-template-columns: 1fr; }
  .clip-card:first-child { border-radius: var(--radius) var(--radius) 0 0; }
  .clip-card:nth-child(2) { border-radius: 0; }
  .clip-card:nth-last-child(2) { border-radius: 0; }
  .clip-card:last-child { border-radius: 0 0 var(--radius) var(--radius); }
  .upload-zone { padding: 40px 24px; }
  .processing-card { flex-direction: column; text-align: center; }
  .video-detail-meta { flex-direction: column; text-align: center; }
  .hero-cta { flex-direction: column; align-items: flex-start; }
}
