/* assets/ddt-magic-box-page.css
 * Re-skin for the dedicated Magic Box page (/magic-box.html).
 * Targets the existing element IDs used by magic-box.js (4660-line detection
 * engine) so the engine continues to function without changes.
 * Spec: docs/superpowers/specs/2026-05-29-site-redesign-design.md §9.2
 */

.rd-mb-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.rd-mb-header {
  margin-bottom: 28px;
  text-align: center;
}
.rd-mb-eyebrow {
  display: inline-block;
  font-family: var(--rd-font-mono);
  font-size: 0.72rem;
  color: var(--rd-accent-cyan);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.rd-mb-h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: var(--rd-heading-tight);
  line-height: 1.1;
  margin: 0 0 12px;
}
.rd-mb-sub {
  color: var(--rd-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 56ch;
  margin: 0 auto;
}

.rd-mb-shell {
  background: var(--rd-bg-surface);
  border: 1px solid var(--rd-border-strong);
  border-radius: var(--rd-radius-lg);
  padding: 20px;
}
.rd-mb-shell:focus-within {
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.10);
}

/* Re-skin existing #magicBoxInput textarea */
#magicBoxInput {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  background: var(--rd-bg-app);
  border: 1px solid var(--rd-border-soft);
  border-radius: var(--rd-radius-md);
  color: var(--rd-text-primary);
  font-family: var(--rd-font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 14px 16px;
  outline: none;
  transition: border-color var(--rd-trans-fast);
}
#magicBoxInput:focus {
  border-color: rgba(0, 212, 255, 0.5);
}
#magicBoxInput::placeholder {
  color: var(--rd-text-dim);
}

/* Toolbar with the existing magic-box.js buttons */
.rd-mb-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}
#magicPasteBtn,
#magicUploadBtn,
#magicSuggestBtn,
#magicClearBtn {
  padding: 7px 14px;
  border-radius: var(--rd-radius-sm);
  font-size: 0.8rem;
  font-family: var(--rd-font-sans);
  border: 1px solid var(--rd-border-strong);
  background: transparent;
  color: var(--rd-text-primary);
  cursor: pointer;
  transition: background var(--rd-trans-fast), border-color var(--rd-trans-fast);
}
#magicPasteBtn:hover,
#magicUploadBtn:hover,
#magicSuggestBtn:hover,
#magicClearBtn:hover {
  background: var(--rd-bg-elevated);
}
#magicSuggestBtn {
  background: linear-gradient(135deg, #00d4ff, #0099cc);
  color: #080c12;
  font-weight: 700;
  border: none;
}

#magicStatus {
  margin-top: 12px;
  font-family: var(--rd-font-mono);
  font-size: 0.75rem;
  color: var(--rd-text-muted);
  min-height: 1.2em;
}

/* Detection result cards (rendered by magic-box.js into #magicSuggestions) */
#magicSuggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
#magicSuggestions > * {
  background: var(--rd-bg-elevated);
  border: 1px solid var(--rd-border-soft);
  border-radius: var(--rd-radius-md);
  padding: 14px 16px;
}

/* Detection preview block */
#magicPreview {
  background: var(--rd-bg-elevated);
  border: 1px solid var(--rd-border-soft);
  border-radius: var(--rd-radius-md);
  padding: 14px 16px;
  margin-top: 14px;
}
#magicPreviewText {
  font-family: var(--rd-font-mono);
  font-size: 0.75rem;
  color: var(--rd-text-muted);
  white-space: pre-wrap;
  max-height: 200px;
  overflow: auto;
}
#magicPreviewHint {
  font-family: var(--rd-font-mono);
  font-size: 0.7rem;
  color: var(--rd-text-dim);
  margin-bottom: 6px;
}

/* History bar */
#magicHistoryBar {
  margin-top: 24px;
  border-top: 1px solid var(--rd-border-soft);
  padding-top: 14px;
}
#magicHistoryItems > * {
  background: var(--rd-bg-elevated);
  border: 1px solid var(--rd-border-soft);
  border-radius: var(--rd-radius-sm);
  padding: 8px 12px;
  margin-bottom: 6px;
}

/* Format catalog (collapsible list of all 13+ detected formats — SEO content) */
.rd-mb-formats {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--rd-border-soft);
}
.rd-mb-formats-h {
  font-family: var(--rd-font-mono);
  font-size: 0.72rem;
  color: var(--rd-accent-cyan);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.rd-mb-formats h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 12px;
}
.rd-mb-formats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}
@media (min-width: 768px) {
  .rd-mb-formats-grid { grid-template-columns: repeat(2, 1fr); }
}
.rd-mb-format {
  background: var(--rd-bg-surface);
  border: 1px solid var(--rd-border-soft);
  border-radius: var(--rd-radius-sm);
  padding: 12px 14px;
}
.rd-mb-format-name {
  font-family: var(--rd-font-mono);
  font-size: 0.78rem;
  color: var(--rd-text-primary);
  font-weight: 600;
  margin-bottom: 4px;
}
.rd-mb-format-desc {
  font-size: 0.78rem;
  color: var(--rd-text-muted);
  line-height: 1.5;
}
