/* App-specific styles — extends theme.css */

.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.app-header {
  text-align: center;
  margin-bottom: 40px;
}

.app-header h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 12px;
}

.app-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Input Section */
.input-section {
  margin-bottom: 32px;
}

.url-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}

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

.input-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 16px;
}

.url-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 14px 12px;
  min-width: 0;
}

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

.btn-generate {
  background: var(--accent);
  color: #080b12;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 20px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px;
  border-radius: var(--radius-sm);
}

.btn-generate:hover:not(:disabled) {
  background: #00d48e;
}

.btn-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(8, 11, 18, 0.3);
  border-top-color: #080b12;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.url-error {
  color: #ff6b6b;
  font-size: 0.85rem;
  margin-top: 8px;
  padding-left: 16px;
}

/* Video Preview */
.video-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 28px;
}

.preview-thumb {
  position: relative;
  width: 120px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.preview-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.preview-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
}

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

.preview-info h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Pipeline Steps */
.preview-status {
  flex-shrink: 0;
}

.pipeline-steps {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-pending {
  background: var(--border-strong);
  color: var(--text-muted);
}

.step-active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  animation: pulse 1s infinite;
}

.step-done {
  background: var(--accent);
  color: #080b12;
}

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

/* Clips Section */
.clips-section {
  margin-top: 16px;
}

.clips-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.clips-header h2 {
  font-size: 1.3rem;
}

.clip-count-badge {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
}

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

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

.clip-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.clip-thumbnail {
  position: relative;
  aspect-ratio: 9/16;
  background: linear-gradient(135deg, #1a2540, #0d1520);
  overflow: hidden;
}

.clip-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.clip-format-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #080b12;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.clip-hook-score {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
}

.clip-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
}

.clip-play-icon {
  width: 48px;
  height: 48px;
  background: rgba(0,229,160,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,229,160,0.4);
}

.clip-play-icon svg {
  width: 20px;
  height: 20px;
  fill: #080b12;
  margin-left: 3px;
}

.clip-body {
  padding: 14px;
}

.clip-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clip-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.clip-timestamp {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,229,160,0.08);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}

.clip-description {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clip-actions {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.clip-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-align: center;
  text-decoration: none;
}

.clip-btn-primary {
  background: var(--accent);
  color: #080b12;
}

.clip-btn-primary:hover {
  background: #00d48e;
}

.clip-btn-secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.clip-btn-secondary:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* Error Section */
.error-section {
  background: rgba(255, 80, 80, 0.08);
  border: 1px solid rgba(255, 80, 80, 0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: #ff8080;
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .app-container { padding: 24px 16px 60px; }

  .video-preview { flex-direction: column; align-items: flex-start; }
  .preview-status { display: none; }

  .clips-grid { grid-template-columns: 1fr; }

  .pipeline-steps {
    flex-wrap: wrap;
    gap: 4px;
  }
}