/* ==========================================================================
   CSS DESIGN SYSTEM: CSS ANCHOR POSITIONING (ATIVIDADE OBJETIVA)
   Professor: Esp. Leandro Gaudio Rosa
   Estética: Dark Modern High-Tech, Limpo, Objetivo e Acessível
   ========================================================================== */

:root {
  --bg-deep: #07090e;
  --bg-main: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1e293b;
  --bg-surface-glass: rgba(17, 24, 39, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #38bdf8;
  --accent-blue: #0284c7;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-code: 'Fira Code', monospace;

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

  --transition-fast: 0.18s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-code);
  font-size: 0.88em;
  background-color: rgba(255, 255, 255, 0.08);
  color: #38bdf8;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   Top Bar & Navbar
   -------------------------------------------------------------------------- */
.announcement-bar {
  background: #111827;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.45rem 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.announcement-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.announcement-content::-webkit-scrollbar { display: none; }

.badge-pill {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.announcement-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-tag {
  flex-shrink: 0;
}

.author-tag strong {
  color: var(--accent-cyan);
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 0;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 2rem;
  width: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-logo:hover {
  text-decoration: none;
}

.logo-icon {
  font-size: 1.3rem;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.6rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: #ffffff;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 1.25rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  animation: pulseAnimation 2s infinite ease-in-out;
}

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

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  max-width: 880px;
  margin: 0 auto 1.2rem;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.1rem;
  max-width: 820px;
  margin: 0 auto 2rem;
  color: #cbd5e1;
}

.hero-meta-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.8rem;
  max-width: 940px;
  margin: 0 auto 2rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.meta-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.author-name { color: #38bdf8; }
.highlight-green { color: var(--accent-green); }
.highlight-cyan { color: var(--accent-cyan); }

.meta-divider {
  width: 1px;
  height: 32px;
  background: var(--border-subtle);
}

.hero-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* --------------------------------------------------------------------------
   Botões
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: #e2e8f0;
  border: 1px solid var(--border-subtle);
}

.btn-outline {
  background: transparent;
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.btn-github {
  background: #24292f;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-github:hover {
  background: #32383f;
  color: #ffffff;
}

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border: 1px solid var(--border-subtle);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Seções Gerais
   -------------------------------------------------------------------------- */
.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border-subtle);
}

.section-darker {
  background-color: var(--bg-deep);
}

.section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 2.5rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-code);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.6rem;
}

.section-subtitle {
  font-size: 0.98rem;
  color: var(--text-secondary);
}

.mt-lg {
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   Sintaxe Cards (Seção 1)
   -------------------------------------------------------------------------- */
.syntax-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.syntax-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
}

.step-badge {
  font-family: var(--font-code);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.4rem;
}

.syntax-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.syntax-card p {
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  flex-grow: 1;
}

.code-block {
  background: #07090e;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: 0.82rem;
  line-height: 1.45;
}

.token-selector { color: #f472b6; }
.token-property { color: #38bdf8; }
.token-value    { color: #a3e635; }

/* --------------------------------------------------------------------------
   Passos da Atividade (Seção 2)
   -------------------------------------------------------------------------- */
.steps-horizontal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.step-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  position: relative;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #07090e;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.step-box h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.step-box p {
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Card de Atenção sobre Tamanho da Imagem */
.aspect-ratio-notice {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  color: #e2e8f0;
  font-size: 0.9rem;
}

.aspect-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.aspect-ratio-notice h4 {
  font-size: 1.05rem;
  color: #38bdf8;
  margin-bottom: 0.25rem;
}

/* --------------------------------------------------------------------------
   Seção de Entrega GitHub Pages
   -------------------------------------------------------------------------- */
.github-delivery-card {
  background: linear-gradient(135deg, #111827 0%, #1e1b4b 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.github-delivery-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.github-logo-icon {
  font-size: 2.2rem;
}

.github-delivery-header h3 {
  font-size: 1.35rem;
  margin-bottom: 0.2rem;
}

.github-delivery-header p {
  font-size: 0.9rem;
  color: #cbd5e1;
}

.github-steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
}

.gh-step-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
}

.gh-badge {
  font-family: var(--font-code);
  font-size: 0.75rem;
  font-weight: 700;
  color: #c084fc;
  display: block;
  margin-bottom: 0.4rem;
}

.gh-step-item h4 {
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
}

.gh-step-item p {
  font-size: 0.85rem;
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Template Tabs (Seção 3)
   -------------------------------------------------------------------------- */
.template-tabs {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tabs-header {
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0.4rem 1rem 0;
  gap: 0.4rem;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-code);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  cursor: pointer;
}

.tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.copy-btn {
  margin-left: auto;
  margin-bottom: 0.4rem;
}

.tab-content {
  display: none;
  padding: 1.25rem;
  background: #07090e;
}

.tab-content.active {
  display: block;
}

.template-code-block {
  font-family: var(--font-code);
  font-size: 0.85rem;
  line-height: 1.55;
  color: #e2e8f0;
  overflow-x: auto;
  max-height: 480px;
}

/* --------------------------------------------------------------------------
   As 32 Temáticas (Seção 4)
   -------------------------------------------------------------------------- */
.theme-manager-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.search-input-group {
  position: relative;
  flex-grow: 1;
  max-width: 440px;
}

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

.input-search {
  width: 100%;
  background: #07090e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 2.2rem 0.6rem 2.5rem;
  color: #ffffff;
  font-family: var(--font-main);
  font-size: 0.88rem;
  outline: none;
}

.input-search:focus {
  border-color: var(--accent-cyan);
}

.btn-clear-input {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.quick-filter-hints {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.4rem;
}

.theme-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.theme-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.35);
}

.theme-card-header {
  margin-bottom: 0.75rem;
}

.student-call-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

.call-prefix {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.call-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.88rem;
  color: #38bdf8;
}

.theme-title {
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
  color: #ffffff;
}

/* Prompt da IA com Botão de Cópia */
.ai-prompt-box {
  background: #07090e;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.ai-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.btn-copy-prompt {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-prompt:hover {
  background: #0284c7;
  color: #ffffff;
}

.ai-prompt-text {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.45;
  font-style: italic;
}

/* Checklist dos 5 Pontos */
.mission-checklist {
  background: #07090e;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.checklist-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.mission-point {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.mission-point:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.point-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.point-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
}

.point-details strong {
  color: #ffffff;
}

.rule-hint {
  font-size: 0.76rem;
  color: #94a3b8;
}

.rule-hint code {
  color: #a3e635;
  background: transparent;
  padding: 0;
}

.fallback-footer-rule {
  font-size: 0.78rem;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
  border: 1px dashed rgba(245, 158, 11, 0.25);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   Rodapé & Toast
   -------------------------------------------------------------------------- */
.footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 1.5rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  display: block;
  margin-bottom: 0.4rem;
}

.credits-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.credits-teacher {
  font-size: 1.15rem;
  color: #38bdf8;
  margin: 0.2rem 0;
}

.credits-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--accent-cyan);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: opacity 0.25s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}

.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   Impressão (@media print)
   -------------------------------------------------------------------------- */
@media print {
  body { background: #fff !important; color: #111 !important; font-size: 10pt; }
  .no-print, .announcement-bar, .navbar, .hero-cta, .toast { display: none !important; }
  .hero { padding: 0.5rem 0; text-align: left; }
  .hero-title { color: #111 !important; font-size: 18pt !important; }
  .gradient-text { -webkit-text-fill-color: #0284c7 !important; }
  .hero-meta-card { background: #f8fafc !important; border: 1px solid #cbd5e1 !important; color: #111 !important; padding: 0.5rem; }
  .theme-card, .step-box, .syntax-card, .github-delivery-card { background: #fff !important; border: 1px solid #94a3b8 !important; color: #111 !important; page-break-inside: avoid; margin-bottom: 0.8rem; }
  .student-call-badge { background: #e0f2fe !important; }
  .call-number { color: #0284c7 !important; }
  .section { padding: 1.2rem 0; }
}

@media (max-width: 800px) {
  .nav-container {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 1.2rem;
  }
  .nav-container::-webkit-scrollbar { display: none; }
  .nav-links {
    display: flex;
    gap: 1rem;
  }
  .footer-content { flex-direction: column; align-items: flex-start; }
}
