/**
 * Workshop Claude Code — Design System CSS
 *
 * Extraído do index.html (aula inaugural) para compartilhar
 * entre todos os módulos. Contém todos os componentes visuais:
 * slides, cards, typography, code blocks, etc.
 *
 * Novos componentes adicionados:
 * - .slide--exercise (slides de exercício com badge e borda accent)
 * - .exercise-badge (indicador visual de exercício com timer)
 * - .module-nav (link de volta ao índice)
 * - .slide--break (slide de intervalo)
 * - .checklist (lista com checkboxes estilizados)
 */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Warm, Anthropic-inspired palette */
  --bg-primary: #f5f5f0;
  --bg-card: #e8e4dc;
  --bg-card-alt: #d4cfc4;
  --bg-dark: #1a1a1a;
  --bg-code: #2d2d2d;

  --text-primary: #1a1a1a;
  --text-secondary: #5c5c5c;
  --text-tertiary: #8a8a8a;
  --text-light: #f5f5f0;

  --accent: #c97b5d;
  --accent-hover: #b56a4c;
  --accent-light: rgba(201, 123, 93, 0.15);

  --border: #d4d0c8;

  --slide-width: 100vw;
  --slide-height: 100vh;
}

/* ===== DARK MODE — Custom property overrides ===== */
/* Activated by setting data-theme="dark" on <html>.
   Respects prefers-color-scheme via JS (slides-engine.js).
   Toggle: press D on slides, or use the button on the home page. */
[data-theme="dark"] {
  --bg-primary: #1a1a1a;
  --bg-card: #2a2a2a;
  --bg-card-alt: #333333;
  --bg-dark: #111111;
  --bg-code: #2d2d2d;

  --text-primary: #e8e4dc;
  --text-secondary: #b0aca4;
  --text-tertiary: #7a7a7a;
  --text-light: #f5f5f0;

  /* Accent stays the same in dark mode */
  --accent: #c97b5d;
  --accent-hover: #d98b6d;
  --accent-light: rgba(201, 123, 93, 0.2);

  --border: #3d3d3d;
}

/* ===== DARK MODE — Component-specific overrides ===== */

/* Code blocks get a slightly lighter bg so they stand out from dark page bg */
[data-theme="dark"] .code-block,
[data-theme="dark"] .demo-command {
  background: #333338;
}

/* Cards in dark mode need subtle distinction from page background */
[data-theme="dark"] .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* Section slides — use a slightly different dark shade */
[data-theme="dark"] .slide--section {
  background: var(--bg-card);
}

/* Break slides — similar treatment as section */
[data-theme="dark"] .slide--break {
  background: var(--bg-card);
}

/* Title/dark slides — when dark mode is on, these already-dark slides
   get a slightly different shade to differentiate from the page bg */
[data-theme="dark"] .slide--title {
  background: #111111;
}

[data-theme="dark"] .slide--dark {
  background: #111111;
}

/* Dark slide cards still need light-on-dark treatment */
[data-theme="dark"] .slide--dark .card {
  background: rgba(255, 255, 255, 0.08);
  border: none;
}

/* Exercise slides — gradient adjusted for dark mode */
[data-theme="dark"] .slide--exercise {
  background: linear-gradient(
    180deg,
    rgba(201, 123, 93, 0.12) 0%,
    rgba(201, 123, 93, 0.04) 100%
  );
}

/* Highlight box — dark-compatible background */
[data-theme="dark"] .highlight-box {
  background: rgba(201, 123, 93, 0.12);
}

[data-theme="dark"] .highlight-box p {
  color: var(--text-primary);
}

/* Comparison table borders */
[data-theme="dark"] .comparison-table th,
[data-theme="dark"] .comparison-table td {
  border-bottom-color: var(--border);
}

/* Architecture diagram boxes */
[data-theme="dark"] .arch-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* Arch connector line */
[data-theme="dark"] .arch-connector {
  background: var(--border);
}

/* Diagram flow arrows */
[data-theme="dark"] .diagram-flow .diagram-arrow {
  background: var(--border);
}

[data-theme="dark"] .diagram-flow .diagram-arrow::after {
  border-top-color: var(--border);
}

/* Inline code */
[data-theme="dark"] .inline-code {
  background: var(--bg-card);
}

/* Checklist checkbox bg */
[data-theme="dark"] .checklist li::before {
  background: var(--bg-card);
  border-color: var(--border);
}

/* Nav hint kbd in dark mode */
[data-theme="dark"] .nav-hint kbd {
  background: #333;
  color: var(--text-secondary);
}

/* Action button adjustments for dark mode */
[data-theme="dark"] .action-btn {
  background: var(--text-primary);
  color: var(--bg-primary);
}

[data-theme="dark"] .action-btn:hover {
  background: #d4cfc4;
}

[data-theme="dark"] .action-btn--secondary {
  background: var(--bg-card);
  color: var(--text-primary);
}

[data-theme="dark"] .action-btn--secondary:hover {
  background: var(--bg-card-alt);
}

/* Copy button in dark mode — slightly brighter hover */
[data-theme="dark"] .copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Module nav link in dark mode */
[data-theme="dark"] .module-nav:hover {
  color: var(--text-primary);
}

/* Quote text inherits --text-primary */
[data-theme="dark"] .quote {
  color: var(--text-primary);
}

/* Selection color stays accent in dark mode */
[data-theme="dark"] ::selection {
  background: var(--accent);
  color: white;
}

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* ===== BASE ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 400;
  line-height: 1.2;
}

code, pre {
  font-family: 'JetBrains Mono', monospace;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== SLIDE CONTAINER ===== */
.slides-container {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

.slide {
  width: 100vw;
  height: 100vh;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 80px;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.slide.active {
  display: flex;
  opacity: 1;
}

/* ===== SLIDE LAYOUTS ===== */

/* Title slide */
.slide--title {
  background: var(--bg-dark);
  color: var(--text-light);
  text-align: center;
}

.slide--title h1 {
  font-size: clamp(48px, 6vw, 80px);
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.slide--title .subtitle {
  font-size: clamp(20px, 2.5vw, 28px);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 48px;
}

.slide--title .meta {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.5);
}

.slide--title .meta span {
  margin: 0 16px;
}

/* Section slide */
.slide--section {
  background: var(--bg-card);
  text-align: center;
}

.slide--section .section-number {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(64px, 10vw, 120px);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 24px;
}

.slide--section h2 {
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.02em;
}

.slide--section .section-time {
  font-size: 18px;
  color: var(--text-tertiary);
  margin-top: 24px;
}

/* Content slide */
.slide--content {
  background: var(--bg-primary);
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 100px;
}

.slide--content h2 {
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

.slide--content h2 .underline {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 6px;
  text-decoration-thickness: 3px;
}

/* Two column layout */
.slide--two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  max-width: 1400px;
  width: 100%;
}

.slide--two-col .col {
  display: flex;
  flex-direction: column;
}

/* Full width content */
.content-full {
  max-width: 1200px;
  width: 100%;
}

/* List styles */
.list {
  list-style: none;
  font-size: clamp(18px, 2vw, 24px);
}

.list li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.list li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Numbered list */
.list--numbered {
  counter-reset: item;
}

.list--numbered li::before {
  content: counter(item);
  counter-increment: item;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  width: auto;
  height: auto;
  border-radius: 0;
  top: 0;
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  width: 100%;
  max-width: 1400px;
}

.cards-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 40px;
}

.card-number {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 16px;
}

.card h3 {
  font-size: 24px;
  margin-bottom: 12px;
}

.card p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Code block */
.code-block {
  background: var(--bg-code);
  border-radius: 12px;
  padding: 32px;
  color: #e0e0e0;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: auto;
  width: 100%;
  max-width: 1000px;
}

.code-block .comment {
  color: #6a9955;
}

.code-block .keyword {
  color: #569cd6;
}

.code-block .string {
  color: #ce9178;
}

.code-block .function {
  color: #dcdcaa;
}

/* Quote */
.quote {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(28px, 3.5vw, 44px);
  font-style: italic;
  color: var(--text-primary);
  max-width: 900px;
  text-align: center;
  line-height: 1.4;
}

.quote-author {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-style: normal;
  color: var(--text-tertiary);
  margin-top: 32px;
}

/* Badge */
.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 8px 16px;
  border-radius: 20px;
  margin-bottom: 24px;
}

/* Stats */
.stats-row {
  display: flex;
  gap: 64px;
  margin-top: 48px;
}

.stat {
  text-align: center;
}

.stat-value {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 56px;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 16px;
  color: var(--text-tertiary);
  margin-top: 8px;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 800px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  align-items: start;
}

.timeline-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--accent);
  background: var(--accent-light);
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
}

.timeline-content h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.timeline-content p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Comparison table */
.comparison-table {
  width: 100%;
  max-width: 1000px;
  border-collapse: collapse;
  font-size: 16px;
}

.comparison-table th,
.comparison-table td {
  padding: 20px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  font-weight: 600;
  color: var(--text-tertiary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.comparison-table td:first-child {
  font-weight: 500;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

/* Dark slide */
.slide--dark {
  background: var(--bg-dark);
  color: var(--text-light);
}

.slide--dark h2 {
  color: var(--text-light);
}

.slide--dark .quote {
  color: var(--text-light);
}

.slide--dark .list li {
  color: rgba(255, 255, 255, 0.7);
}

.slide--dark .list li strong {
  color: var(--text-light);
}

.slide--dark .card {
  background: rgba(255, 255, 255, 0.08);
}

.slide--dark .card p {
  color: rgba(255, 255, 255, 0.7);
}

/* Highlight box */
.highlight-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 24px 32px;
  border-radius: 0 12px 12px 0;
  margin-top: 32px;
  max-width: 800px;
}

.highlight-box p {
  font-size: 18px;
  color: var(--text-primary);
}

/* Demo section */
.demo-commands {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 900px;
}

.demo-command {
  background: var(--bg-code);
  border-radius: 12px;
  padding: 20px 28px;
  color: #e0e0e0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
}

.demo-command .prompt {
  color: var(--accent);
  margin-right: 8px;
}

/* Architecture diagram */
.architecture {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 800px;
}

.arch-box {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px 48px;
  text-align: center;
  font-weight: 500;
  font-size: 18px;
  min-width: 280px;
}

.arch-box--lead {
  background: var(--accent);
  color: white;
}

.arch-row {
  display: flex;
  gap: 24px;
}

.arch-connector {
  width: 2px;
  height: 32px;
  background: var(--border);
}

.arch-box--small {
  padding: 16px 32px;
  font-size: 16px;
}

/* Progress indicator */
.progress-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--accent);
  transition: width 0.3s ease;
  z-index: 100;
}

/* Slide counter */
.slide-counter {
  position: fixed;
  bottom: 24px;
  right: 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-tertiary);
  z-index: 100;
}

.slide--dark ~ .slide-counter,
.slide--title ~ .slide-counter {
  color: rgba(255, 255, 255, 0.5);
}

/* Navigation hint */
.nav-hint {
  position: fixed;
  bottom: 24px;
  left: 32px;
  font-size: 13px;
  color: var(--text-tertiary);
  z-index: 100;
}

.nav-hint kbd {
  background: var(--bg-card);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  margin: 0 2px;
}

/* Action buttons */
.action-buttons {
  position: fixed;
  top: 24px;
  right: 32px;
  display: flex;
  gap: 12px;
  z-index: 100;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: #333;
  transform: translateY(-1px);
}

.action-btn--secondary {
  background: var(--bg-card);
  color: var(--text-primary);
}

.action-btn--secondary:hover {
  background: var(--bg-card-alt);
}

/* ===== NEW COMPONENTS FOR MODULES ===== */

/* Exercise slide — visually distinct from content slides */
/* Fundo quente alaranjado para sinalizar "mão na massa" */
.slide--exercise {
  background: linear-gradient(
    180deg,
    rgba(201, 123, 93, 0.18) 0%,
    rgba(201, 123, 93, 0.08) 100%
  );
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 100px;
  border-top: 6px solid var(--accent);
}

.slide--exercise h2 {
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

.slide--exercise h2 .underline {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 6px;
  text-decoration-thickness: 3px;
}

/* Exercise badge — shows timer and exercise number */
.exercise-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: white;
  background: var(--accent);
  padding: 10px 20px;
  border-radius: 24px;
  margin-bottom: 24px;
}

.exercise-badge .exercise-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 10px;
  border-radius: 12px;
}

/* Break slide */
.slide--break {
  background: var(--bg-card);
  text-align: center;
}

.slide--break h2 {
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.slide--break .break-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(48px, 8vw, 96px);
  color: var(--accent);
  margin-bottom: 24px;
}

.slide--break .break-hint {
  font-size: 18px;
  color: var(--text-tertiary);
}

/* Module nav — link back to index */
.module-nav {
  position: fixed;
  top: 24px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-decoration: none;
  z-index: 100;
  transition: color 0.2s;
}

.module-nav:hover {
  color: var(--text-primary);
}

.module-nav svg {
  width: 16px;
  height: 16px;
}

/* Checklist — styled checkbox list for setup/recap */
.checklist {
  list-style: none;
  font-size: clamp(18px, 2vw, 22px);
}

.checklist li {
  position: relative;
  padding-left: 40px;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: white;
}

.checklist li.checked::before {
  background: var(--accent);
  border-color: var(--accent);
}

.checklist li.checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 9px;
  width: 12px;
  height: 6px;
  border-left: 2.5px solid white;
  border-bottom: 2.5px solid white;
  transform: rotate(-45deg);
}

.checklist li strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Diagram — vertical flow with arrows */
.diagram-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 600px;
}

.diagram-flow .diagram-arrow {
  width: 2px;
  height: 24px;
  background: var(--border);
  position: relative;
}

.diagram-flow .diagram-arrow::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: -4px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--border);
}

/* Inline code */
.inline-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .slide {
    padding: 60px;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .slide--two-col {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (max-width: 768px) {
  .slide {
    padding: 40px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    flex-direction: column;
    gap: 32px;
  }
}

/* Print / PDF export */
@media print {
  .slide {
    page-break-after: always;
    display: flex !important;
    position: relative;
    height: 100vh;
    width: 100vw;
  }

  .progress-bar,
  .slide-counter,
  .nav-hint,
  .action-buttons,
  .module-nav {
    display: none;
  }
}

/* ===== COPY BUTTON ===== */
/* Botão de copiar para code blocks e demo commands */

.demo-command,
.code-block {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  z-index: 10;
  opacity: 0;
}

.demo-command:hover .copy-btn,
.code-block:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.copy-btn--copied {
  color: #4caf50 !important;
  opacity: 1 !important;
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

/* ===== SELECTION ===== */
::selection {
  background: var(--accent);
  color: white;
}
