/* ====================================================================
   AULA 11 - DESIGN SYSTEM & ESTILOS PRINCIPAIS
   Tema Único: Fundo Branco Gelo, Vermelho, Preto e Tons de Cinza
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Fundo Branco Gelo & Superfícies */
  --bg-primary: #f4f6f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbfc;
  --bg-input: #ffffff;
  --bg-subtle: #edf2f7;
  
  /* Bordas em Tons de Cinza */
  --border-color: #e2e8f0;
  --border-dark: #cbd5e1;
  --border-focus: #dc2626;
  
  /* Tipografia: Preto & Cinzas */
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  /* Identidade Visual: Vermelho & Preto */
  --accent-red: #dc2626;
  --accent-red-hover: #b91c1c;
  --accent-red-light: #fef2f2;
  --accent-red-border: #fecaca;
  --accent-black: #0f172a;
  --accent-gray: #475569;
  
  /* Gradientes em Vermelho & Preto */
  --gradient-brand: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #fcfdfd 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(220, 38, 38, 0.05) 0%, transparent 70%);
  
  /* Sombras Suaves */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 20px rgba(220, 38, 38, 0.15);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', Consolas, monospace;
  
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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;
  background-image: 
    radial-gradient(at 0% 0%, rgba(220, 38, 38, 0.03) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(15, 23, 42, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p {
  color: var(--text-secondary);
  font-size: 0.975rem;
}

a {
  color: var(--accent-red);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  text-decoration: underline;
  color: var(--accent-red-hover);
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border-color);
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
  height: auto;
  padding: 0.65rem 0;
  gap: 1.25rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.25);
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  white-space: nowrap;
}

/* Navigation Tabs */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #edf2f7;
  padding: 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.6);
}

.nav-tab-btn.active {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

/* Hero Section */
.hero-banner {
  padding: 2.5rem 0 1.75rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--gradient-glow);
  position: relative;
}

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

.hero-left {
  max-width: 750px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
}

/* Badges da nova paleta */
.badge-red, .badge-cyan {
  background: var(--accent-red-light);
  color: var(--accent-red);
  border: 1px solid var(--accent-red-border);
}

.badge-dark, .badge-purple {
  background: #f1f5f9;
  color: var(--text-primary);
  border: 1px solid var(--border-dark);
}

.badge-gray, .badge-emerald, .badge-amber {
  background: #f8fafc;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.hero-title {
  font-size: 2.15rem;
  margin-bottom: 0.65rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-metrics {
  display: flex;
  gap: 1rem;
}

.metric-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
  box-shadow: var(--shadow-sm);
}

.metric-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-red);
  font-family: var(--font-mono);
}

.metric-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* Conteúdo Principal das Abas */
.tab-pane {
  display: none;
  padding: 2.5rem 0 4rem;
  animation: fadeIn 0.3s ease-in-out;
}

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

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

/* Cartões e Painéis */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

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

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

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

.card-desc {
  color: var(--text-secondary);
  font-size: 0.925rem;
  margin-bottom: 1.25rem;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

.btn-success {
  background: #0f172a;
  color: white;
  font-weight: 700;
}

.btn-success:hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #f1f5f9;
  border-color: var(--border-dark);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #000;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Grid de Stepper da Prática Guiada */
.stepper-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.step-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: var(--shadow-sm);
}

.step-btn:hover {
  border-color: var(--accent-red);
  background: var(--bg-card-hover);
}

.step-btn.active {
  border-color: var(--accent-red);
  background: var(--accent-red-light);
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.15);
}

.step-number {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-red);
  text-transform: uppercase;
}

.step-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Alertas & Destaques Pedagógicos */
.alert-box {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border-left: 4px solid;
}

.alert-important {
  background: var(--accent-red-light);
  border-color: var(--accent-red);
}

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

.alert-danger {
  background: #fef2f2;
  border-color: var(--accent-red);
}

.alert-success {
  background: #f8fafc;
  border-color: var(--accent-black);
}

.alert-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.alert-body h4 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.alert-body p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Tabelas de Resultados */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin: 1rem 0;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

table.data-table th {
  background: #f8fafc;
  color: var(--accent-red);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-mono);
}

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

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

/* Grade de Exercícios dos 32 Alunos */
.filter-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-dark);
  color: var(--text-primary);
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
}

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

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

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

.student-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.student-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-red);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.12);
}

.student-card.selected {
  border-color: var(--accent-red);
  background: #fffafa;
  box-shadow: 0 0 0 2px var(--accent-red);
}

.student-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.student-num-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.25rem 0.65rem;
  background: var(--accent-red-light);
  color: var(--accent-red);
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-red-border);
}

.student-theme-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.student-company {
  font-size: 0.825rem;
  color: var(--accent-red);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.student-table-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-top: 0.5rem;
}

/* Detalhe do Exercício Expandido */
.exercise-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-top: 1.5rem;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.task-item {
  background: #fafbfc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: border-color var(--transition-fast);
}

.task-item:hover {
  border-color: var(--accent-red);
}

.task-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.task-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  background: var(--accent-black);
  color: white;
  border-radius: var(--radius-sm);
}

.task-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.task-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.task-hint {
  font-size: 0.825rem;
  color: var(--accent-red);
  font-family: var(--font-mono);
  background: var(--accent-red-light);
  border: 1px solid var(--accent-red-border);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Formulário de Geração de Entrega */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-dark);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}

.form-control:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: white;
  border: 1px solid var(--accent-red);
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  animation: slideUp 0.25s ease-out;
}

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

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  text-align: center;
  background: #ffffff;
}

.footer-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Responsividade Avançada */
@media (max-width: 1240px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 0.85rem;
  }
  
  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    border-radius: var(--radius-md);
  }
}

@media (max-width: 900px) {
  .header-inner {
    padding: 0.75rem 0;
  }
  
  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.4rem;
  }

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .guide-layout {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .brand-subtitle {
    display: none;
  }
}

@media (max-width: 640px) {
  .brand-title {
    font-size: 1.1rem;
  }
  
  .hero-title {
    font-size: 1.65rem;
  }
  
  .hero-metrics {
    width: 100%;
    justify-content: space-between;
  }
  
  .metric-pill {
    min-width: unset;
    flex: 1;
    padding: 0.5rem 0.75rem;
  }
}
