/* Story Video Page */
@import url('../t2i/t2i.css');

.story-hero {
  padding: 56px 0 40px;
  background: linear-gradient(180deg,
    rgba(139,92,246,0.08) 0%,
    rgba(249,115,22,0.05) 50%,
    var(--bg-page) 100%);
  border-bottom: 1px solid var(--border);
}

.story-tag {
  display: inline-block;
  padding: 5px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Steps */
.story-section { padding: 40px 0 80px; }

.story-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

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

.step-num {
  width: 32px; height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.story-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Chapter buttons */
.chapter-btn {
  flex: 1;
  padding: 10px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.chapter-btn:hover { border-color: var(--primary); color: var(--primary); }
.chapter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Story buttons */
.story-btn-primary {
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(249,115,22,0.3);
}
.story-btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.story-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.story-btn-outline {
  padding: 12px 24px;
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.story-btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Chapter cards */
.chapter-card {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: border-color 0.2s;
}
.chapter-card:hover { border-color: rgba(249,115,22,0.4); }

.chapter-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.chapter-index {
  width: 26px; height: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.chapter-title-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  padding: 0;
}

.duration-select {
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.chapter-prompt-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  resize: vertical;
  min-height: 72px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
  line-height: 1.5;
}
.chapter-prompt-input:focus { border-color: var(--primary); }

.chapter-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-style: italic;
}

/* Video job cards */
.video-job-card {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.video-job-preview {
  width: 140px;
  min-height: 90px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.video-job-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-job-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.job-spinner {
  width: 24px; height: 24px;
  border: 2px solid rgba(249,115,22,0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.video-job-info { flex: 1; }

.video-job-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.video-job-prompt {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.job-status-badge.pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.job-status-badge.success { background: rgba(16,185,129,0.15); color: var(--success); }
.job-status-badge.failed  { background: rgba(239,68,68,0.15);  color: var(--error); }

.video-download-btn {
  margin-top: 8px;
  padding: 6px 14px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.video-download-btn:hover { opacity: 0.9; }

.hidden { display: none !important; }
