/* ==========================================================================
   PORTAL DA AULA 07: PADRÃO JSON E THUNDER CLIENT
   Tema: Branco Gelo, Vermelho, Preto e Tons de Cinza
   ========================================================================== */

:root {
  /* Branco Gelo e Superfícies Neutras */
  --bg-primary: #f3f5f8;       /* Branco gelo de fundo */
  --bg-secondary: #ffffff;     /* Branco puro para cartões */
  --bg-card: #ffffff;          /* Cartões brancos limpos */
  --bg-card-hover: #fafafa;
  --bg-code: #111827;          /* Preto grafite para contraste de código */
  --bg-subtle: #f8fafc;        /* Cinza gelo suave */

  /* Bordas em Tons de Cinza */
  --border-subtle: #e2e8f0;    /* Cinza claro refinado */
  --border-medium: #cbd5e1;    /* Cinza médio */
  --border-highlight: rgba(220, 38, 38, 0.35); /* Destaque em Vermelho */

  /* Tipografia: Preto e Tons de Cinza */
  --text-primary: #0f172a;     /* Preto profundo de alta legibilidade */
  --text-secondary: #475569;   /* Cinza chumbo escuro */
  --text-muted: #64748b;       /* Cinza neutro */

  /* Cores de Acento: Vermelho, Preto e Variações */
  --accent-primary: #dc2626;       /* Vermelho institucional vibrante */
  --accent-primary-hover: #b91c1c; /* Vermelho escuro */
  --accent-red-subtle: rgba(220, 38, 38, 0.08);
  --accent-black: #0f172a;        /* Preto de destaque */
  --accent-cyan: #dc2626;         /* Vermelho técnico */
  --accent-emerald: #16a34a;      /* Sucesso / Validação */
  --accent-amber: #d97706;        /* Alertas pedagógicos */
  --accent-rose: #dc2626;         /* Erros / Alertas */

  /* Badges de Métodos HTTP */
  --badge-get: #0f172a;
  --badge-get-bg: #f1f5f9;
  --badge-get-border: #cbd5e1;
  --badge-post: #dc2626;
  --badge-post-bg: rgba(220, 38, 38, 0.08);
  --badge-post-border: rgba(220, 38, 38, 0.3);

  /* Sombras Suaves */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.1);
  --shadow-glow-red: 0 4px 20px rgba(220, 38, 38, 0.2);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Efeito ambiente suave de fundo (Gelo com leve toque vermelho técnico) */
body::before {
  content: '';
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 450px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.04) 0%, rgba(15, 23, 42, 0.02) 60%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* Layout Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   HEADER & HERO
   ========================================================================== */
.header {
  padding: 2.25rem 0 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(243, 245, 248, 0.92);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--accent-red-subtle);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-badge .dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.title-group h1 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.title-group h1 span.highlight-red {
  color: var(--accent-primary);
}

.title-group p {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

.header-quick-stats {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.stat-chip {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.stat-chip strong {
  color: var(--accent-primary);
  font-weight: 700;
}

/* ==========================================================================
   NAVIGATION TABS
   ========================================================================== */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.35rem;
  background: #ffffff;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: #f8fafc;
  border-color: var(--border-medium);
}

.tab-btn.active {
  color: #ffffff;
  background: var(--accent-primary);
  border-color: var(--accent-primary-hover);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
}

.tab-btn .tab-count {
  padding: 0.15rem 0.55rem;
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
}

.tab-btn.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ==========================================================================
   SECTIONS & VIEWS
   ========================================================================== */
.main-content {
  padding: 2.5rem 0 4.5rem;
}

.view-section {
  display: none;
  animation: fadeIn 0.28s ease forwards;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Titles */
.section-header {
  margin-bottom: 2rem;
}

.section-tag {
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
  display: block;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-description {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 820px;
  margin-top: 0.4rem;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  color: var(--text-primary);
}

/* HTTP Method Badges */
.badge-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-method.get {
  color: var(--badge-get);
  background: var(--badge-get-bg);
  border: 1px solid var(--badge-get-border);
}

.badge-method.post {
  color: var(--badge-post);
  background: var(--badge-post-bg);
  border: 1px solid var(--badge-post-border);
}

/* ==========================================================================
   MÓDULO 1: GUIA E MODELO PASSO A PASSO
   ========================================================================== */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.step-card {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-md);
}

.step-number {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent-black) 0%, var(--accent-primary) 100%);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.35rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.25);
}

.step-number span {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #fca5a5;
  font-weight: 700;
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.step-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.step-header p {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin-top: 0.35rem;
}

/* Syntax Rule Grid */
.rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.rule-box {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
}

.rule-box.correct {
  border-color: rgba(22, 163, 74, 0.4);
  background: rgba(22, 163, 74, 0.04);
}

.rule-box.wrong {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.04);
}

.rule-box-header {
  font-size: 0.88rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.rule-box.correct .rule-box-header { color: #15803d; }
.rule-box.wrong .rule-box-header { color: var(--accent-primary); }

/* Code Blocks */
.code-wrapper {
  background: var(--bg-code);
  border: 1px solid #27272a;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 0.75rem;
  min-width: 0;
  max-width: 100%;
  box-shadow: var(--shadow-sm);
}

.code-header {
  background: #18181b;
  border-bottom: 1px solid #27272a;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #a1a1aa;
  font-weight: 600;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e4e4e7;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-copy:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

pre {
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #f4f4f5;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
}

/* Callout Box */
.callout {
  padding: 1.15rem 1.4rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-primary);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-left-width: 4px;
  border-left-color: var(--accent-primary);
  color: var(--text-secondary);
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.callout strong {
  color: var(--text-primary);
}

.callout.warning {
  border-left-color: var(--accent-amber);
  background: rgba(217, 119, 6, 0.05);
}

/* ==========================================================================
   MÓDULO 2: CENTRAL DE 32 EXERCÍCIOS INDIVIDUAIS
   ========================================================================== */
.roulette-hero {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-top: 4px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.roulette-hero h2 {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.roulette-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 650px;
  margin: 0 auto 1.75rem;
}

.roulette-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.8rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #991b1b 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(220, 38, 38, 0.35);
  transition: var(--transition-normal);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(220, 38, 38, 0.45);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--text-secondary);
}

/* Quick Student Number Grid (1 to 32) */
.student-selector-wrap {
  margin-bottom: 2rem;
}

.selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.selector-header h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.search-input-wrap {
  position: relative;
  width: 290px;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.4rem;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 0.55rem;
  margin-bottom: 2rem;
}

.student-pill {
  height: 50px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
  position: relative;
}

.student-pill:hover {
  background: #f8fafc;
  color: var(--accent-primary);
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.student-pill.active {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-black) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  transform: scale(1.05);
}

/* ACTIVE EXERCISE SHOWCASE CARD */
.exercise-detail-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.25rem;
  position: relative;
  transition: var(--transition-normal);
}

.exercise-badge-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.75rem;
}

.student-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.student-avatar {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--accent-black) 0%, var(--accent-primary) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.25);
}

.student-text h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.student-text span {
  font-size: 0.88rem;
  color: var(--accent-primary);
  font-weight: 700;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.business-story {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-primary);
  padding: 1.35rem 1.6rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 2rem;
  color: var(--text-primary);
  font-size: 1.02rem;
  line-height: 1.65;
}

.routes-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.75rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .routes-split {
    grid-template-columns: 1fr;
  }
}

.route-panel {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.route-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.route-path {
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.route-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Fields Table */
.fields-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.5rem 0;
}

.fields-table th {
  text-align: left;
  padding: 0.6rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.fields-table td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.fields-table td.mono {
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-weight: 700;
}

.type-tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
}

.type-string { background: #e0f2fe; color: #0369a1; }
.type-number { background: #fef3c7; color: #b45309; }
.type-boolean { background: #dcfce7; color: #15803d; }

/* Checklist */
.checklist-container {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  margin-top: 1.5rem;
}

.checklist-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.check-item.checked span {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* ==========================================================================
   MÓDULO 3: VALIDADOR E SIMULADOR JSON
   ========================================================================== */
.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 960px) {
  .lab-grid {
    grid-template-columns: 1fr;
  }
}

.editor-box {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-width: 0;
  width: 100%;
}

.editor-header {
  background: #f8fafc;
  padding: 0.9rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.editor-header h4 {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.json-textarea {
  width: 100%;
  min-height: 380px;
  padding: 1.35rem;
  background: var(--bg-code);
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.6;
  border: none;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}

.editor-footer {
  padding: 0.9rem 1.35rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Simulation Result Box */
.simulation-box {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
  width: 100%;
}

.status-badge-lg {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
}

.status-badge-lg.ok {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.3);
}

.status-badge-lg.error {
  background: rgba(220, 38, 38, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.feedback-details {
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  min-width: 0;
  word-break: break-word;
}

.feedback-details h5 {
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.error-explanation {
  color: #991b1b;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  padding: 0.85rem;
  background: #fef2f2;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-primary);
  word-break: break-word;
}

.success-explanation {
  color: #14532d;
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  padding: 0.85rem;
  background: #f0fdf4;
  border-radius: var(--radius-sm);
  border-left: 3px solid #16a34a;
  word-break: break-word;
}

/* Quick Test Buttons */
.presets-group {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-preset {
  padding: 0.35rem 0.75rem;
  background: #ffffff;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.btn-preset:hover {
  background: #f1f5f9;
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* ==========================================================================
   MÓDULO 4: PAINEL DO PROFESSOR (VISÃO GERAL DOS 32)
   ========================================================================== */
.overview-table-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.overview-table-header {
  padding: 1.35rem 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background: #f8fafc;
  flex-wrap: wrap;
  gap: 1rem;
}

.overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.overview-table th {
  padding: 0.95rem 1.25rem;
  text-align: left;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.overview-table td {
  padding: 1.05rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.overview-table tr:hover td {
  background: #f8fafc;
}

.overview-table td.aluno-id {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--accent-primary);
}

.overview-table td.aluno-tema {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-action-view {
  padding: 0.4rem 0.95rem;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: var(--accent-primary);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-action-view:hover {
  background: var(--accent-primary);
  color: #fff;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  border: 1px solid var(--accent-primary);
  color: #fff;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 0 0 20px rgba(220, 38, 38, 0.2);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28), opacity 0.3s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Sorteio Overlay Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.roulette-modal-card {
  background: #ffffff;
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(220, 38, 38, 0.25);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.modal-overlay.show .roulette-modal-card {
  transform: scale(1);
}

.spinning-number {
  font-size: 5.5rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  background: linear-gradient(135deg, var(--accent-black) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0.8rem 0;
}

/* ==========================================================================
   CARDS DE NÍVEIS PEDAGÓGICOS (JORNADA DE 7 AULAS)
   ========================================================================== */
.levels-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.level-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border-left-width: 5px;
  position: relative;
}

.level-card.level-1 { border-left-color: #64748b; }
.level-card.level-2 { border-left-color: #2563eb; }
.level-card.level-3 { border-left-color: var(--accent-primary); }

.level-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.level-badge.l1 { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.level-badge.l2 { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.level-badge.l3 { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.level-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.level-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* ==========================================================================
   PRINT STYLES FOR CLASSROOM HANDOUTS
   ========================================================================== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  body::before { display: none !important; }
  .header, .nav-tabs, .roulette-hero, .student-selector-wrap, .btn-primary, .btn-secondary, .btn-copy, .toast {
    display: none !important;
  }
  .view-section { display: block !important; }
  .exercise-detail-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    background: #fff !important;
    color: #000 !important;
  }
  .card-title, .student-text h3, .route-path {
    color: #000 !important;
  }
  .business-story {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-left: 4px solid #dc2626 !important;
  }
  pre {
    background: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
  }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .step-card {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }
  .step-number {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }
  .header-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .title-group h1 {
    font-size: 1.6rem;
  }
}
