/**
 * Prompts Page Styles
 *
 * Extends the base style.css with prompts-specific components.
 * Maintains CLI aesthetic with CSS variables.
 */

/* `.prompts-subtitle` is now a no-style E2E hook (prompts-page.spec.js);
   canonical styling lives in `.page-header__subtitle` (style.css, LIN-462). */

.nav-value-static {
  font-family: var(--font-content);
  font-size: 0.9em;
  color: var(--fg);
}

/* =============================================================================
   Summary Section
   ============================================================================= */
.prompts-summary {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
  padding: var(--space-3);
  background: rgba(0, 0, 0, 0.02);
  border-radius: 4px;
}

.summary-stats {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-content);
  font-size: 0.9em;
}

.stat {
  color: var(--fg-dim);
}

.stat strong {
  color: var(--fg);
  font-weight: 600;
}

.stat-separator {
  color: var(--fg-vdim);
}

/* =============================================================================
   Sections
   ============================================================================= */
/* Section + heading styling is canonical now (.section / .section-header /
   .section-header--ruled in style.css, LIN-461). The catalog headers render as
   the ruled variant; only the page-specific description + meta-box accent
   remain here. */

.section-description {
  color: var(--fg-dim);
  font-family: var(--font-content);
  font-size: 0.9em;
  margin-bottom: var(--space-3);
  line-height: 1.5;
}

/* =============================================================================
   Category Grouping
   ============================================================================= */
.prompt-category {
  margin-bottom: var(--space-4);
}

.category-header {
  font-family: var(--font-content);
  font-size: 0.95em;
  font-weight: 500;
  color: var(--fg);
  margin: 0 0 0.75rem 0;
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--fg-vdim);
}

.category-count {
  color: var(--fg-dim);
  font-weight: normal;
}

.category-templates {
  padding-left: var(--space-2);
}

/* =============================================================================
   Prompt Cards
   ============================================================================= */
/* The card container (.prompt-card) and its header row (.prompt-header) are now
   the canonical `.card` / `.card-header` (style.css, LIN-468); those class names
   survive on the markup as no-style E2E/JS hooks. Only the prompt-specific
   children below remain here. */

.prompt-name {
  font-family: var(--font-content);
  font-weight: 500;
  color: var(--fg);
}

.prompt-label {
  font-family: var(--font-structural);
  font-size: var(--font-size-sm);
  color: var(--fg-dim);
  background: rgba(0, 0, 0, 0.05);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}

.prompt-chars {
  font-family: var(--font-structural);
  font-size: 0.8em;
  color: var(--fg-dim);
  margin-left: auto;
}

.prompt-description {
  font-family: var(--font-content);
  font-size: var(--font-size-sm);
  color: var(--fg-dim);
  margin-bottom: var(--space-2);
  line-height: 1.4;
}

/* =============================================================================
   AI Hints
   ============================================================================= */
.prompt-ai-hint {
  font-family: var(--font-content);
  font-size: 0.8em;
  color: var(--fg-dim);
  margin-bottom: var(--space-2);
  padding: var(--space-2);
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.ai-hint-row {
  margin-bottom: var(--space-1);
}

.ai-hint-row:last-child {
  margin-bottom: 0;
}

.ai-hint-label {
  font-weight: 500;
  color: var(--fg);
}

/* =============================================================================
   Completion Signals
   ============================================================================= */
.prompt-signals {
  font-family: var(--font-content);
  font-size: 0.8em;
  color: var(--fg-dim);
  margin-bottom: var(--space-2);
  padding: var(--space-2);
  background: rgba(22, 160, 133, 0.05);
  border-radius: var(--radius-sm);
}

.signals-core {
  margin-bottom: var(--space-1);
}

.signals-label {
  font-weight: 500;
  color: var(--fg);
}

.signals-list {
  margin-top: var(--space-1);
}

.signals-list ul {
  margin: var(--space-1) 0 0 var(--space-4);
  padding: 0;
  list-style-type: disc;
}

.signals-list li {
  margin-bottom: 0.15rem;
}

/* =============================================================================
   Expandable Prompt Details
   ============================================================================= */
.prompt-details {
  margin-top: var(--space-2);
}

.prompt-details summary {
  font-family: var(--font-content);
  font-size: var(--font-size-sm);
  color: var(--blue);
  cursor: pointer;
  padding: var(--space-1) 0;
}

.prompt-details summary:hover {
  text-decoration: underline;
}

.prompt-text {
  font-family: var(--font-structural);
  font-size: 0.8em;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--fg-vdim);
  border-radius: 4px;
  padding: var(--space-3);
  margin-top: var(--space-2);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

/* =============================================================================
   Template Copy Button (public /templates page only — LIN-1889)
   ============================================================================= */
.template-copy-btn {
  display: block;
  margin-top: var(--space-2);
  padding: 0.3rem 0.75rem;
  font-family: var(--font-content);
  font-size: var(--font-size-sm);
  color: var(--fg);
  background: var(--bg-muted);
  border: 1px solid var(--fg-vdim);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.template-copy-btn:hover {
  background: var(--bg-alt);
}

/* =============================================================================
   Meta-Prompt Section
   ============================================================================= */
.meta-prompt-section {
  background: rgba(0, 0, 0, 0.02);
  padding: var(--space-3);
  border-radius: 4px;
  border-left: 3px solid var(--blue);
}

.meta-prompt-section .section-header {
  border-bottom: none;
  margin-bottom: var(--space-2);
  padding-bottom: 0;
}

.meta-prompt-stats {
  font-family: var(--font-content);
  font-size: var(--font-size-sm);
  color: var(--fg-dim);
  margin-bottom: 0.75rem;
}

.meta-prompt-text {
  max-height: 600px;
}

/* =============================================================================
   Responsive
   ============================================================================= */
@media (max-width: 640px) {
  .prompts-summary {
    flex-direction: column;
    gap: var(--space-2);
  }

  .prompt-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }

  .prompt-chars {
    margin-left: 0;
  }

  .prompt-text {
    max-height: 300px;
    font-size: 0.75em;
  }

  .category-templates {
    padding-left: 0;
  }
}
