/* ============================================================
   Tutorial Page — tutorial.css
   ============================================================ */

/* ── Tutorial Hero ─────────────────────────────────────────── */
.tutorial-hero {
  padding-top: calc(var(--nav-height) + var(--space-4xl));
  padding-bottom: var(--space-2xl);
  text-align: center;
  position: relative;
}

.tutorial-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(95,207,246,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.tutorial-hero h1 {
  margin-bottom: var(--space-md);
}

.tutorial-hero > .container > p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Table of Contents ─────────────────────────────────────── */
.toc-section {
  padding: var(--space-2xl) 0 var(--space-xl);
}

.toc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.new-feature-tag {
  background: var(--cyan);
  color: var(--bg-darker);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: auto;
  flex-shrink: 0;
}

.toc-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.toc-card:hover {
  border-color: var(--card-border-hover);
  background: var(--card-bg-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.toc-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.toc-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toc-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.toc-card h3 {
  font-size: 1.15rem;
  color: var(--text-primary);
}

.toc-card p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.toc-card .toc-link-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--cyan);
  transition: gap var(--duration-fast) var(--ease-out);
}

.toc-card:hover .toc-link-label {
  gap: 10px;
}

/* ── Prerequisites ─────────────────────────────────────────── */
.prereqs-section {
  padding: var(--space-3xl) 0;
}

.prereqs-container {
  max-width: 780px;
  margin: 0 auto;
}

.prereqs-container > h2 {
  margin-bottom: var(--space-xl);
}

.prereq-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-xl);
  margin-bottom: var(--space-md);
}

.prereq-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.prereq-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(95,207,246,0.08);
  border: 1px solid rgba(95,207,246,0.12);
}

.prereq-card h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.prereq-card p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  padding-left: 56px;
}

.prereq-card p a {
  color: var(--cyan);
  font-weight: 500;
}

.prereq-card p a:hover {
  text-decoration: underline;
}

.prereq-tip {
  background: rgba(95,207,246,0.06);
  border: 1px solid rgba(95,207,246,0.12);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.prereq-tip-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.prereq-tip p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 0;
}

.prereq-tip strong {
  color: var(--cyan);
}

/* ── Tutorial Section (Shared) ─────────────────────────────── */
.tutorial-section {
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--card-border);
  scroll-margin-top: calc(var(--nav-height) + var(--space-lg));
}

.tutorial-container {
  max-width: 780px;
  margin: 0 auto;
}

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

.tutorial-section-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  overflow: hidden;
}

.tutorial-section-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tutorial-section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.tutorial-section-header p {
  font-size: 0.95rem;
  margin-top: 4px;
}

/* ── Step Card ─────────────────────────────────────────────── */
.step-tutorial {
  margin-bottom: var(--space-2xl);
}

.step-tutorial-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.step-tutorial-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--bg-dark);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-tutorial-header h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
}

.step-tutorial-content {
  padding-left: 52px;
}

.step-tutorial-content ol {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
}

.step-tutorial-content ol li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 28px;
  margin-bottom: var(--space-md);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.step-tutorial-content ol li::before {
  content: counter(step-counter) ".";
  position: absolute;
  left: 0;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--cyan);
  font-size: 0.9rem;
}

.step-tutorial-content ol li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.step-tutorial-content ol li code {
  background: rgba(95,207,246,0.1);
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'Consolas', 'Monaco', monospace;
}

.step-tutorial-content > p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.step-tutorial-content > p strong {
  color: var(--text-primary);
}

/* ── Info Options List ─────────────────────────────────────── */
.info-options {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0;
}

.info-options li {
  position: relative;
  padding-left: 24px;
  margin-bottom: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.info-options li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--cyan);
  font-weight: 600;
}

.info-options li strong {
  color: var(--text-primary);
}

/* ── Screenshot Placeholder ────────────────────────────────── */
.screenshot-placeholder {
  background: var(--card-bg);
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  margin: var(--space-lg) 0;
  position: relative;
}

.screenshot-placeholder-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  opacity: 0.5;
}

.screenshot-placeholder p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 auto;
  max-width: 400px;
}

/* ── Config Code Block ─────────────────────────────────────── */
.config-block {
  background: var(--bg-darker);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  overflow-x: auto;
}

.config-block-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.config-block pre {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
  white-space: pre;
}

.config-block pre .key {
  color: var(--cyan);
}
.config-block pre .value {
  color: var(--green);
}
.config-block pre .comment {
  color: var(--text-muted);
}

/* ── Folder Structure Block ────────────────────────────────── */
.folder-structure {
  background: var(--bg-darker);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
}

.folder-structure-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
}

.folder-structure pre {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
  white-space: pre;
}

.folder-structure pre .folder {
  color: var(--cyan);
  font-weight: 600;
}

.folder-structure pre .label {
  color: var(--text-muted);
  font-style: italic;
}

/* ── Warning / Tip Banners ─────────────────────────────────── */
.tutorial-warning {
  background: rgba(252,223,93,0.06);
  border: 1px solid rgba(252,223,93,0.15);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.tutorial-warning-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.tutorial-warning p {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--yellow);
  padding-left: 0;
}

.tutorial-warning.orange {
  background: rgba(255, 120, 0, 0.08);
  border-color: rgba(255, 120, 0, 0.2);
}

.tutorial-warning.orange p {
  color: #ff9d42;
}

.tutorial-warning.green {
  background: rgba(87,188,144,0.08);
  border-color: rgba(87,188,144,0.2);
}

.tutorial-warning.green p {
  color: #7ce8b8;
}

.tutorial-tip {
  background: rgba(87,188,144,0.06);
  border: 1px solid rgba(87,188,144,0.12);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.tutorial-tip-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.tutorial-tip p {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--green);
  padding-left: 0;
}

.tutorial-tip strong {
  color: #7ce8b8;
}

/* ── Screenshot Images ─────────────────────────────────────── */
.tutorial-screenshot {
  margin: var(--space-lg) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  background: var(--bg-darker);
  position: relative;
  /* Reserve space to prevent layout shift during scroll */
  aspect-ratio: 16 / 9;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform var(--duration-slow) var(--ease-out);
}

.tutorial-screenshot:hover img {
  transform: scale(1.015);
}

/* ── CTA Section ───────────────────────────────────────────── */
.tutorial-cta {
  text-align: center;
  padding: var(--space-3xl) 0;
  border-top: 1px solid var(--card-border);
}

.tutorial-cta p {
  font-size: 1rem;
  margin: 0 auto var(--space-lg);
  max-width: 500px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .toc-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .tutorial-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .step-tutorial-content {
    padding-left: 0;
  }

  .prereq-card p {
    padding-left: 0;
    margin-top: var(--space-sm);
  }

  .prereq-card-header {
    flex-direction: row;
  }
}

@media (max-width: 480px) {
  .tutorial-section-icon {
    width: 44px;
    height: 44px;
  }

  .step-tutorial-number {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  .config-block pre,
  .folder-structure pre {
    font-size: 0.75rem;
  }
}
