/* ==========================================================================
   Mockup Components - Shared UI Elements
   Used consistently across all feature section animations
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Mockup Container
   --------------------------------------------------------------------------- */

.mockup-container {
  width: 100%;
  max-width: 400px;
  background: var(--bg-mockup);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-primary);
  overflow: hidden;
}

@media (min-width: 768px) {
  .mockup-container {
    max-width: 480px;
    padding: var(--space-6);
    font-size: var(--text-sm);
  }
}

/* ---------------------------------------------------------------------------
   Mockup Header
   --------------------------------------------------------------------------- */

.mockup-header {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  font-family: var(--font-sans);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.mockup-header--muted {
  color: var(--text-muted);
  font-weight: var(--font-medium);
}

/* ---------------------------------------------------------------------------
   Mockup Divider
   --------------------------------------------------------------------------- */

.mockup-divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--space-4) 0;
}

/* ---------------------------------------------------------------------------
   Mockup Input
   --------------------------------------------------------------------------- */

.mockup-input {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  min-height: 40px;
}

.mockup-input--focused {
  border-color: var(--accent-start);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.mockup-input-placeholder {
  color: var(--text-dim);
}

.mockup-input-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent-start);
  margin-left: 2px;
  animation: blink 1s infinite;
}

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

/* ---------------------------------------------------------------------------
   Mockup Buttons
   --------------------------------------------------------------------------- */

.mockup-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--accent-start), var(--accent-mid));
  color: var(--text-primary);
  border-radius: var(--radius-md);
  white-space: nowrap;
}

.mockup-button--secondary {
  background: transparent;
  border: 1px solid var(--border-default);
}

.mockup-button--small {
  padding: var(--space-1) var(--space-3);
  font-size: 10px;
}

.mockup-button--glow {
  box-shadow: var(--glow-purple);
}

/* ---------------------------------------------------------------------------
   Mockup Dropdown
   --------------------------------------------------------------------------- */

.mockup-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  min-width: 140px;
}

.mockup-dropdown-value {
  flex: 1;
  color: var(--text-primary);
}

.mockup-dropdown-arrow {
  color: var(--text-muted);
  font-size: 10px;
}

.mockup-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-mockup);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  box-shadow: var(--shadow-lg);
}

.mockup-dropdown-item {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

.mockup-dropdown-item:hover,
.mockup-dropdown-item.selected {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.mockup-dropdown-item.selected::before {
  content: "";
  margin-right: var(--space-2);
}

/* ---------------------------------------------------------------------------
   Mockup Radio & Checkbox
   --------------------------------------------------------------------------- */

.mockup-radio,
.mockup-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  color: var(--text-secondary);
  cursor: pointer;
}

.mockup-radio-circle,
.mockup-checkbox-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-default);
  flex-shrink: 0;
}

.mockup-radio-circle {
  border-radius: 50%;
}

.mockup-checkbox-box {
  border-radius: var(--radius-sm);
}

.mockup-radio.selected .mockup-radio-circle,
.mockup-checkbox.checked .mockup-checkbox-box {
  border-color: var(--accent-start);
  background: var(--accent-start);
}

.mockup-radio.selected .mockup-radio-circle::after {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--text-primary);
  border-radius: 50%;
}

.mockup-checkbox.checked .mockup-checkbox-box::after {
  content: "";
  color: var(--text-primary);
  font-size: 10px;
}

.mockup-radio.selected,
.mockup-checkbox.checked {
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------------
   Mockup Progress Bar
   --------------------------------------------------------------------------- */

.mockup-progress {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.mockup-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
  border-radius: var(--radius-full);
  transition: width var(--duration-normal) var(--ease-default);
}

.mockup-progress--large {
  height: 8px;
}

/* ---------------------------------------------------------------------------
   Mockup Slider
   --------------------------------------------------------------------------- */

.mockup-slider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mockup-slider-track {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  position: relative;
}

.mockup-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--accent-start);
  border-radius: var(--radius-full);
}

.mockup-slider-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: var(--text-primary);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
}

.mockup-slider-value {
  font-size: var(--text-xs);
  color: var(--text-muted);
  min-width: 40px;
  text-align: right;
}

/* ---------------------------------------------------------------------------
   Mockup Toggle
   --------------------------------------------------------------------------- */

.mockup-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mockup-toggle-track {
  width: 36px;
  height: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  position: relative;
  transition: all var(--duration-fast) var(--ease-default);
}

.mockup-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--duration-fast) var(--ease-default);
}

.mockup-toggle.active .mockup-toggle-track {
  background: var(--accent-start);
  border-color: var(--accent-start);
}

.mockup-toggle.active .mockup-toggle-thumb {
  left: 18px;
  background: var(--text-primary);
}

.mockup-toggle-label {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------------------
   Mockup Badge / Status
   --------------------------------------------------------------------------- */

.mockup-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: 10px;
  font-weight: var(--font-medium);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
}

.mockup-badge--success {
  color: var(--status-success);
}

.mockup-badge--error {
  color: var(--status-error);
}

.mockup-badge--warning {
  color: var(--status-warning);
}

.mockup-badge--info {
  color: var(--status-info);
}

.mockup-badge--ai {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: var(--text-primary);
}

/* ---------------------------------------------------------------------------
   Mockup Spinner
   --------------------------------------------------------------------------- */

.mockup-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-start);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.mockup-spinner--small {
  width: 12px;
  height: 12px;
  border-width: 1.5px;
}

/* ---------------------------------------------------------------------------
   Mockup List Items
   --------------------------------------------------------------------------- */

.mockup-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mockup-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.mockup-list-item.selected {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid var(--accent-start);
  color: var(--text-primary);
}

.mockup-list-item-icon {
  font-size: var(--text-base);
}

.mockup-list-item-text {
  flex: 1;
}

/* ---------------------------------------------------------------------------
   Mockup Chapter/Row
   --------------------------------------------------------------------------- */

.mockup-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.mockup-row:last-child {
  border-bottom: none;
}

.mockup-row-status {
  flex-shrink: 0;
  font-size: var(--text-base);
}

.mockup-row-label {
  flex: 1;
  color: var(--text-secondary);
}

.mockup-row-value {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* Status icons */
.status-complete { color: var(--status-success); }
.status-pending { color: var(--text-dim); }
.status-active { color: var(--accent-start); }
.status-error { color: var(--status-error); }

/* ---------------------------------------------------------------------------
   Mockup Waveform (Audio)
   --------------------------------------------------------------------------- */

.mockup-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border-radius: var(--radius-md);
}

.mockup-waveform-bar {
  width: 3px;
  background: var(--accent-start);
  border-radius: var(--radius-full);
  animation: waveform 1s ease-in-out infinite;
}

.mockup-waveform-bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.mockup-waveform-bar:nth-child(2) { height: 70%; animation-delay: 0.1s; }
.mockup-waveform-bar:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.mockup-waveform-bar:nth-child(4) { height: 60%; animation-delay: 0.3s; }
.mockup-waveform-bar:nth-child(5) { height: 80%; animation-delay: 0.4s; }
.mockup-waveform-bar:nth-child(6) { height: 50%; animation-delay: 0.5s; }
.mockup-waveform-bar:nth-child(7) { height: 90%; animation-delay: 0.6s; }
.mockup-waveform-bar:nth-child(8) { height: 30%; animation-delay: 0.7s; }

@keyframes waveform {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.5); }
}

/* ---------------------------------------------------------------------------
   Mockup Container Fixed Height (for animations)
   --------------------------------------------------------------------------- */

.mockup-container--fixed {
  height: 440px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .mockup-container--fixed {
    height: 480px;
  }
}

/* All mockup states should fill available space */
.mockup-container--fixed .mockup-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Content areas within fixed containers - NO SCROLL BARS */
.mockup-container--fixed .mockup-list,
.mockup-container--fixed .facts-container,
.mockup-container--fixed .chapter-progress-list,
.mockup-container--fixed .basic-outline-list,
.mockup-container--fixed .outline-generation-preview,
.mockup-container--fixed .detailed-outline-section {
  overflow: hidden;
  flex-shrink: 1;
}

/* Research row should stay at bottom */
.mockup-container--fixed .research-suggestion-row {
  flex-shrink: 0;
  margin-top: auto;
}

/* ---------------------------------------------------------------------------
   Image Filter Tabs
   --------------------------------------------------------------------------- */

.image-filter-tabs {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.image-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: 10px;
  font-family: var(--font-mono);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
}

.image-filter-tab:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.image-filter-tab.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-start);
  color: var(--text-primary);
}

.image-filter-tab .filter-count {
  padding: 0 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  font-size: 9px;
}

.image-filter-tab.active .filter-count {
  background: var(--accent-start);
}

/* Image status badges - fixed height */
.image-status-badges {
  min-height: 28px;
}

/* ---------------------------------------------------------------------------
   Mockup Image Grid
   --------------------------------------------------------------------------- */

.mockup-image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  /* Fixed height for 2 rows of square cells */
  height: 140px;
}

@media (min-width: 768px) {
  .mockup-image-grid {
    height: 160px;
  }
}

.mockup-image-cell {
  aspect-ratio: 1;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  color: var(--text-dim);
  position: relative;
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-default);
}

.image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.image-slot-number {
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.5;
}

/* Loading state */
.mockup-image-cell.loading {
  animation: imageCellPulse 1.5s ease-in-out infinite;
}

.mockup-image-cell.loading .image-placeholder::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-start);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.mockup-image-cell.loading .image-slot-number {
  display: none;
}

/* Downloaded state */
.mockup-image-cell.downloaded {
  border: 1px solid var(--status-success);
}

.mockup-image-cell.downloaded .image-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Coffee-themed image placeholders */
.coffee-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  position: relative;
}

.coffee-image--beans {
  background: linear-gradient(135deg, #3d2314 0%, #5c3d2e 50%, #8b5a2b 100%);
}

.coffee-image--cup {
  background: linear-gradient(135deg, #2c1810 0%, #4a3728 50%, #6b4423 100%);
}

.coffee-image--plant {
  background: linear-gradient(135deg, #1a3d1a 0%, #2d5a2d 50%, #3d7a3d 100%);
}

.coffee-image--roast {
  background: linear-gradient(135deg, #1a1a1a 0%, #3d2314 50%, #5c3d2e 100%);
}

.coffee-image--latte {
  background: linear-gradient(135deg, #d4a574 0%, #c4956a 50%, #a67c52 100%);
}

.coffee-image--farm {
  background: linear-gradient(135deg, #2d4a1a 0%, #4a6b2d 50%, #5c8a3d 100%);
}

/* Rejected/watermark state */
.mockup-image-cell.rejected {
  border: 1px solid var(--status-error);
}

.mockup-image-cell.rejected::after {
  content: "✕";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: var(--status-error);
  z-index: 2;
}

.mockup-image-cell.rejected .coffee-image {
  opacity: 0.3;
}

/* AI Generation state - glowing effect */
.mockup-image-cell.generating {
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-input), var(--bg-input)) padding-box,
              linear-gradient(135deg, var(--accent-start), var(--accent-end), var(--accent-start)) border-box;
  animation: aiGeneratingGlow 2s ease-in-out infinite;
}

.mockup-image-cell.generating::before {
  content: "";
  position: absolute;
  inset: -4px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end), var(--accent-start));
  border-radius: var(--radius-md);
  z-index: -1;
  opacity: 0.5;
  animation: aiGlowPulse 2s ease-in-out infinite;
  filter: blur(8px);
}

.mockup-image-cell.generating .ai-gen-icon {
  font-size: 16px;
  animation: aiIconPulse 1s ease-in-out infinite;
}

/* AI Generated (complete) */
.mockup-image-cell.ai-generated {
  border: 2px solid var(--accent-start);
}

.mockup-image-cell.ai-generated .mockup-image-cell-badge {
  display: block;
}

.mockup-image-cell--filled {
  background: linear-gradient(135deg, var(--bg-hover), var(--bg-input));
  color: var(--text-muted);
}

.mockup-image-cell--ai {
  border: 1px solid var(--accent-start);
}

.mockup-image-cell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 8px;
  padding: 1px 3px;
  background: var(--accent-start);
  border-radius: 2px;
  display: none;
  z-index: 3;
}

/* Download icon overlay */
.download-icon {
  position: absolute;
  bottom: 2px;
  left: 2px;
  font-size: 10px;
  padding: 1px 3px;
  background: rgba(34, 197, 94, 0.9);
  border-radius: 2px;
  z-index: 3;
}

/* Ready checkmark */
.ready-check {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 10px;
  width: 14px;
  height: 14px;
  background: var(--status-success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 3;
}

/* ---------------------------------------------------------------------------
   Mockup Verification Badges (Multi-LLM)
   --------------------------------------------------------------------------- */

.mockup-verification {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.mockup-verification-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  font-size: 9px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.mockup-verification-badge--verified {
  color: var(--status-success);
}

.mockup-verification-badge--flagged {
  color: var(--status-warning);
}

/* ---------------------------------------------------------------------------
   Mockup Label / Field
   --------------------------------------------------------------------------- */

.mockup-field {
  margin-bottom: var(--space-4);
}

.mockup-field:last-child {
  margin-bottom: 0;
}

.mockup-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.mockup-help {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: var(--space-1);
}

/* ---------------------------------------------------------------------------
   Mockup Thumbnail Preview
   --------------------------------------------------------------------------- */

.mockup-thumbnail-preview {
  aspect-ratio: 16 / 9;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mockup-thumbnail-text {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  font-family: var(--font-sans);
  color: var(--text-primary);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* ---------------------------------------------------------------------------
   Mockup Two-Panel Layout (Thumbnail Editor)
   --------------------------------------------------------------------------- */

.mockup-two-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 480px) {
  .mockup-two-panel {
    grid-template-columns: 1fr 1fr;
  }
}

.mockup-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.mockup-panel-title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  font-family: var(--font-sans);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------------------------------------------------------------------------
   Mockup Language Flags
   --------------------------------------------------------------------------- */

.mockup-language-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.mockup-flag {
  font-size: var(--text-base);
  flex-shrink: 0;
}

.mockup-language-name {
  flex: 1;
  color: var(--text-secondary);
}

.mockup-language-status {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   AI Generation Effect Box
   --------------------------------------------------------------------------- */

.ai-generation-box {
  position: relative;
  padding: var(--space-4);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(168, 85, 247, 0.05));
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: aiBoxGlow 2s ease-in-out infinite;
}

.ai-generation-box::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-mid), var(--accent-end), var(--accent-start));
  border-radius: var(--radius-lg);
  z-index: -1;
  animation: aiGradientRotate 3s linear infinite;
  background-size: 300% 300%;
}

.ai-generation-box::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--bg-mockup);
  border-radius: calc(var(--radius-lg) - 2px);
  z-index: -1;
}

.ai-generation-content {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
}

.ai-gen-sparkle {
  font-size: var(--text-lg);
  animation: sparkleRotate 2s ease-in-out infinite;
}

.ai-gen-text {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* Section A content areas - fixed heights */
#mockup-a .mockup-state[data-state="input"] {
  min-height: 280px;
}

#mockup-a .mockup-state[data-state="generating"],
#mockup-a .mockup-state[data-state="results"] {
  min-height: 280px;
}

/* AI Results list */
.ai-results-list {
  overflow: hidden;
}

/* AI Result items that appear one by one */
.ai-result-item {
  transition: all 0.4s var(--ease-out);
}

.ai-result-item.visible {
  opacity: 1 !important;
  animation: slideInResult 0.4s var(--ease-out) forwards;
}

/* Research Suggestion Row */
.research-suggestion-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
}

.research-icon {
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.research-content {
  flex: 1;
  min-width: 0;
}

.research-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.research-description {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
}

.research-btn {
  flex-shrink: 0;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--accent-start);
  border-radius: var(--radius-md);
  font-size: 10px;
  color: var(--accent-start);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Outline Animation Components (Section B)
   --------------------------------------------------------------------------- */

/* Section B states - fixed heights */
#mockup-b .mockup-state {
  min-height: 320px;
}

/* Basic outline items - fixed height */
.basic-outline-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.basic-outline-item {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  padding: var(--space-1) 0;
}

.outline-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* Outline generation preview */
.outline-generation-preview {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow: hidden;
}

.outline-gen-item {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  transition: all 0.4s var(--ease-out);
}

.outline-gen-item.visible {
  opacity: 1 !important;
  animation: slideInResult 0.4s var(--ease-out) forwards;
}

.outline-gen-label {
  color: var(--text-muted);
}

.outline-gen-value {
  color: var(--accent-start);
  font-weight: var(--font-medium);
}

/* Detailed outline content wrapper */
.detailed-outline-content {
  overflow: hidden;
  margin-bottom: var(--space-3);
}

/* Detailed outline sections */
.detailed-outline-section {
  margin-bottom: var(--space-3);
}

.outline-bullet {
  padding: var(--space-1) 0;
  font-size: var(--text-xs);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.outline-bullet::before {
  content: "•";
  color: var(--text-dim);
  flex-shrink: 0;
}

.outline-bullet--main {
  color: var(--text-primary);
  font-weight: var(--font-medium);
}

.outline-bullet--main::before {
  color: var(--accent-start);
}

.outline-bullet--sub {
  color: var(--text-secondary);
  padding-left: var(--space-4);
}

.outline-bullet--sub::before {
  content: "○";
  color: var(--text-dim);
}

.outline-bullet--fact {
  color: var(--status-warning);
  background: rgba(245, 158, 11, 0.1);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  margin-left: var(--space-4);
  margin-top: var(--space-1);
}

.outline-bullet--fact::before {
  display: none;
}

.fact-icon {
  margin-right: var(--space-1);
}

/* Negative scope */
.negative-scope-section {
  padding: var(--space-3);
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
}

.negative-icon {
  font-size: var(--text-sm);
}

.negative-scope-items {
  margin-top: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.negative-scope-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  padding: var(--space-1) 0;
}

.strikethrough {
  color: var(--text-dim);
  text-decoration: line-through;
}

.negative-reason {
  color: var(--text-muted);
  font-size: 10px;
  font-style: italic;
}

/* ---------------------------------------------------------------------------
   Verification Facts Animation (Section C)
   --------------------------------------------------------------------------- */

/* Phase indicator */
.verification-phase-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.phase-step {
  font-size: 10px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-dim);
  transition: all var(--duration-fast) var(--ease-default);
}

.phase-step.active {
  background: var(--accent-start);
  color: var(--text-primary);
}

.phase-step.completed {
  background: var(--status-success);
  color: var(--text-primary);
}

.phase-arrow {
  color: var(--text-dim);
  font-size: 10px;
}

/* Facts container */
.facts-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow: hidden;
}

.fact-item {
  padding: var(--space-3);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  transition: all var(--duration-normal) var(--ease-default);
}

.fact-item.reviewing {
  border-color: var(--accent-start);
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.2);
}

.fact-item.verified {
  border-color: var(--status-success);
}

.fact-item.flagged {
  border-color: var(--status-warning);
}

.fact-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.fact-text {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 1.5;
}

.fact-text.updated {
  color: var(--text-primary);
}

/* Source tags */
.fact-source-tag {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
}

.source-badge--generator {
  color: var(--accent-start);
  background: rgba(124, 58, 237, 0.15);
}

.source-badge--reviewer {
  color: var(--status-info);
  background: rgba(59, 130, 246, 0.15);
}

/* Review panel */
.fact-review-panel {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: rgba(124, 58, 237, 0.05);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-md);
  animation: fadeIn var(--duration-normal) var(--ease-out);
}

.review-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.review-icon {
  font-size: var(--text-sm);
}

.review-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.review-suggestion {
  padding: var(--space-2);
  background: var(--bg-mockup);
  border-radius: var(--radius-sm);
  animation: slideUp var(--duration-normal) var(--ease-out);
}

.suggestion-type {
  font-size: 10px;
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

.suggestion-type--reword {
  color: var(--status-info);
}

.suggestion-type--confidence {
  color: var(--status-warning);
}

.suggestion-type--verified {
  color: var(--status-success);
}

.suggestion-text {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  font-style: italic;
}

.suggestion-actions {
  display: flex;
  gap: var(--space-2);
}

.suggestion-btn {
  font-size: 9px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.suggestion-btn--accept {
  background: var(--status-success);
  color: white;
}

.suggestion-btn--reject {
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-default);
}

/* Fact verification badges row */
.fact-verification {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

/* Verification status */
.verification-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.verification-status-text {
  color: var(--accent-start);
}

/* ---------------------------------------------------------------------------
   Script Writing Animation (Section D)
   --------------------------------------------------------------------------- */

.script-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 10px;
  padding: var(--space-1) var(--space-2);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(168, 85, 247, 0.1));
  border: 1px solid var(--accent-start);
  border-radius: var(--radius-sm);
  color: var(--accent-start);
  animation: aiBoxGlow 2s ease-in-out infinite;
}

.script-ai-badge .ai-gen-sparkle {
  animation: sparkleRotate 2s ease-in-out infinite;
}

.script-ai-badge.complete {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
  border-color: var(--status-success);
  color: var(--status-success);
  animation: none;
}

.script-writing-area {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  min-height: 80px;
  max-height: 100px;
  overflow: hidden;
  position: relative;
}

.script-writing-area::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(transparent, var(--bg-input));
  pointer-events: none;
}

.script-text-container {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.6;
}

.script-typed-text {
  white-space: pre-wrap;
}

.script-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent-start);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: cursorBlink 0.8s step-end infinite;
}

.script-cursor.hidden {
  display: none;
}

/* Script progress bar */
.script-progress-bar {
  height: 4px;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  margin-top: var(--space-3);
  overflow: hidden;
}

.script-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-start), var(--accent-mid));
  border-radius: var(--radius-full);
  transition: width 0.1s linear;
}

.script-progress-fill.complete {
  background: var(--status-success);
}

/* Script status */
.script-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
}

.script-status-text {
  color: var(--accent-start);
}

.script-status.complete .mockup-spinner {
  display: none;
}

.script-status.complete .script-status-text {
  color: var(--status-success);
}

.script-status.complete::before {
  content: "✓";
  color: var(--status-success);
}

/* Chapter progress list */
.chapter-progress-list {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chapter-row {
  transition: all var(--duration-fast) var(--ease-default);
}

.chapter-row.active {
  background: rgba(124, 58, 237, 0.05);
  border-radius: var(--radius-sm);
  padding-left: var(--space-2);
  margin-left: calc(-1 * var(--space-2));
}

.chapter-row.complete .mockup-row-status {
  color: var(--status-success);
}

.chapter-row.complete .mockup-row-status::before {
  content: "✓";
}

.chapter-row.complete .mockup-row-status.status-pending {
  color: var(--status-success);
}

.chapter-word-count.generating {
  color: var(--accent-start);
}

/* ---------------------------------------------------------------------------
   Animation Utilities
   --------------------------------------------------------------------------- */

.fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-out) forwards;
  opacity: 0;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp var(--duration-normal) var(--ease-out) forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInResult {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes aiBoxGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(124, 58, 237, 0.4);
  }
}

@keyframes aiGradientRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes sparkleRotate {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(10deg) scale(1.1); }
  50% { transform: rotate(0deg) scale(1); }
  75% { transform: rotate(-10deg) scale(1.1); }
}

/* Staggered delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ---------------------------------------------------------------------------
   Title Card Skeleton (Section A)
   --------------------------------------------------------------------------- */

.title-cards-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.title-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-default);
}

.title-card-radio {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-default);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-default);
}

.title-card-text {
  flex: 1;
  height: 14px;
  border-radius: var(--radius-sm);
  transition: all var(--duration-normal) var(--ease-default);
}

/* Skeleton state */
.title-card.skeleton .title-card-text {
  background: linear-gradient(90deg, var(--bg-hover) 0%, var(--bg-input) 50%, var(--bg-hover) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Generating state - AI glow effect */
.title-card.generating {
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-input), var(--bg-input)) padding-box,
              linear-gradient(135deg, var(--accent-start), var(--accent-end), var(--accent-start)) border-box;
  animation: aiCardGlow 1.5s ease-in-out infinite;
}

.title-card.generating::before {
  content: "";
  position: absolute;
  inset: -4px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.3;
  filter: blur(8px);
  animation: aiGlowPulse 1.5s ease-in-out infinite;
}

.title-card.generating {
  position: relative;
}

.title-card.generating .title-card-text {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.2), rgba(168, 85, 247, 0.3), rgba(124, 58, 237, 0.2));
  background-size: 200% 100%;
  animation: shimmer 1s infinite;
}

@keyframes aiCardGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
  }
}

/* Filled state - title generated */
.title-card.filled {
  border-color: var(--border-default);
  background: var(--bg-input);
}

.title-card.filled .title-card-radio {
  border-color: var(--accent-start);
  background: var(--accent-start);
}

.title-card.filled .title-card-radio::after {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  margin: 4px;
  background: white;
  border-radius: 50%;
  opacity: 0;
}

.title-card.filled .title-card-text {
  background: none;
  animation: none;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  height: auto;
}

/* Selected state */
.title-card.selected {
  border-color: var(--accent-start);
  background: rgba(124, 58, 237, 0.1);
}

.title-card.selected .title-card-radio {
  border-color: var(--accent-start);
  background: var(--accent-start);
}

.title-card.selected .title-card-radio::after {
  opacity: 1;
}

.title-card.selected .title-card-text {
  color: var(--text-primary);
}

/* More indicator */
.title-cards-more {
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  padding-top: var(--space-2);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-default);
}

.title-cards-more.visible {
  opacity: 1;
}
