/* ==========================================================================
   AULAS EM CASA — ESTILOS VISUAIS (DESIGN SYSTEM)
   Baseado nas cores e diretrizes do Early Childhood Education Roadmap
   ========================================================================== */

:root {
  --font-main: 'Andika', 'Comic Neue', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: Georgia, Cambria, 'Times New Roman', serif;
  
  /* Cores dos 4 Blocos Curriculares (Diagrama Roadmap) */
  --bloco-mat-color: #2563eb;       /* Azul: Bloco 1 (Matemática CPA) */
  --bloco-mat-bg: #eff6ff;
  --bloco-mat-border: #93c5fd;

  --bloco-fon-color: #ea580c;       /* Laranja: Bloco 2 (Fônica & Onomatopeias) */
  --bloco-fon-bg: #fff7ed;
  --bloco-fon-border: #fdba74;

  --bloco-mot-color: #0d9488;       /* Verde-água / Teal: Bloco 3 (Grafomotricidade) */
  --bloco-mot-bg: #f0fdfa;
  --bloco-mot-border: #5eead4;

  --bloco-lei-color: #16a34a;       /* Verde: Bloco 4 (Leitura & Arrumação MEXT) */
  --bloco-lei-bg: #f0fdf4;
  --bloco-lei-border: #86efac;

  /* Trilhas das Crianças */
  --t4-color: #d97706;              /* Âmbar / Leão: Frantiesco (4 anos) */
  --t4-bg: #fffbeb;
  --t4-border: #fcd34d;

  --t5-color: #7c3aed;              /* Roxo / Foguete: Giuseppe (5 anos) */
  --t5-bg: #f5f3ff;
  --t5-border: #c4b5fd;

  /* Superfície e Fundo Neutro */
  --bg-app: #0f172a;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.2), 0 8px 10px -6px rgba(0,0,0,0.2);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   APP CONTAINER & CABEÇALHO SUPERIOR
   ========================================================================== */

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

header.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #1e293b;
  color: #f8fafc;
  padding: 0.6rem 1.2rem;
  border-bottom: 2px solid #334155;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.15rem;
  cursor: pointer;
}

.brand span.badge-logo {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #ffffff;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.selector-group {
  display: flex;
  align-items: center;
  background-color: #0f172a;
  border: 1px solid #475569;
  border-radius: 8px;
  overflow: hidden;
}

.selector-group select {
  background: transparent;
  color: #f8fafc;
  border: none;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-main);
  font-size: 0.95rem;
  cursor: pointer;
  outline: none;
}

.selector-group select option {
  background-color: #1e293b;
  color: #f8fafc;
}

/* Dias da Semana (Tabs) */
.dias-nav {
  display: flex;
  gap: 0.3rem;
  background-color: #0f172a;
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid #475569;
}

.dia-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dia-btn:hover {
  color: #ffffff;
  background-color: #334155;
}

.dia-btn.active {
  background-color: #2563eb;
  color: #ffffff;
}

/* Ferramentas do Header (Timer, Materiais, Fundamentos, Tela Cheia) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-tool {
  background-color: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background-color 0.15s ease;
}

.btn-tool:hover {
  background-color: #475569;
}

.btn-tool.timer-active {
  background-color: #dc2626;
  border-color: #ef4444;
  animation: pulse-timer 1.5s infinite;
}

@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ==========================================================================
   PALCO PRINCIPAL DO SLIDE (PROPORÇÃO 16:9 ADAPTATIVA)
   ========================================================================== */

main.slide-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.slide-card {
  width: 100%;
  max-width: 1400px;
  height: 100%;
  max-height: 850px;
  aspect-ratio: 16 / 9;
  background-color: var(--card-bg);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  border: 3px solid transparent;
  transition: border-color 0.3s ease;
}

/* Barra Superior de Identificação do Bloco */
.slide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.75rem;
  border-bottom: 2px solid var(--border-light);
  background-color: #f8fafc;
}

.bloco-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.bloco-matematica {
  border-color: var(--bloco-mat-color) !important;
}
.bloco-matematica .bloco-pill {
  background-color: var(--bloco-mat-bg);
  color: var(--bloco-mat-color);
  border: 1px solid var(--bloco-mat-border);
}

.bloco-fonica {
  border-color: var(--bloco-fon-color) !important;
}
.bloco-fonica .bloco-pill {
  background-color: var(--bloco-fon-bg);
  color: var(--bloco-fon-color);
  border: 1px solid var(--bloco-fon-border);
}

.bloco-motor {
  border-color: var(--bloco-mot-color) !important;
}
.bloco-motor .bloco-pill {
  background-color: var(--bloco-mot-bg);
  color: var(--bloco-mot-color);
  border: 1px solid var(--bloco-mot-border);
}

.bloco-leitura {
  border-color: var(--bloco-lei-color) !important;
}
.bloco-leitura .bloco-pill {
  background-color: var(--bloco-lei-bg);
  color: var(--bloco-lei-color);
  border: 1px solid var(--bloco-lei-border);
}

.porque-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  background-color: #f1f5f9;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Área de Conteúdo Central do Slide */
.slide-body {
  flex: 1;
  padding: 2rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  text-align: center;
}

.slide-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.slide-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   COMPONENTES VISUAIS ESPECÍFICOS DE SLIDES
   ========================================================================== */

/* 1. Flash Subitização */
.subitizar-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.dot-frame {
  width: 320px;
  height: 220px;
  background-color: #f8fafc;
  border: 3px dashed #cbd5e1;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: opacity 0.2s ease;
}

.dot-container {
  display: grid;
  gap: 20px;
}

.math-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ef4444, #b91c1c);
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.btn-flash {
  background-color: #2563eb;
  color: #ffffff;
  border: none;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.75rem 1.75rem;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.1s ease, background-color 0.15s ease;
}

.btn-flash:hover {
  background-color: #1d4ed8;
  transform: scale(1.03);
}

/* 2. Ligações Numéricas (Number Bonds) */
.number-bond-svg {
  width: 380px;
  height: 260px;
}

.bond-circle {
  fill: #f8fafc;
  stroke: #2563eb;
  stroke-width: 4;
  cursor: pointer;
}

.bond-circle.whole {
  stroke: #1d4ed8;
  stroke-width: 6;
  fill: #eff6ff;
}

.bond-line {
  stroke: #94a3b8;
  stroke-width: 4;
}

.bond-text {
  font-family: var(--font-main);
  font-size: 42px;
  font-weight: 800;
  fill: #0f172a;
  text-anchor: middle;
  dominant-baseline: central;
}

.bond-hidden {
  fill: #e2e8f0;
  cursor: pointer;
}

/* 3. Quadro de Dez (Ten-Frame) */
.ten-frame-grid {
  display: grid;
  grid-template-columns: repeat(5, 70px);
  grid-template-rows: repeat(2, 70px);
  gap: 6px;
  background-color: #0f172a;
  padding: 8px;
  border-radius: 14px;
  border: 4px solid #334155;
  box-shadow: var(--shadow-lg);
}

.ten-frame-cell {
  background-color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frame-dot-red {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ef4444, #991b1b);
}

.frame-dot-blue {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #3b82f6, #1e40af);
}

/* 4. Cartão do Fonema & Onomatopeia */
.fonema-card-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: center;
  width: 100%;
  max-width: 900px;
  text-align: left;
}

.fonema-letter-box {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: #ffffff;
  border-radius: 24px;
  padding: 2rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.fonema-big-char {
  font-size: 7rem;
  font-weight: 900;
  line-height: 1;
}

.fonema-small-char {
  font-size: 2.5rem;
  font-weight: 700;
  opacity: 0.85;
}

.fonema-emoji {
  font-size: 3.5rem;
  margin-top: 0.5rem;
}

.fonema-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-badge {
  display: inline-block;
  background-color: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.onomatopeia-story {
  font-size: 1.35rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}

.articulacao-box {
  background-color: #f8fafc;
  border-left: 5px solid #ea580c;
  padding: 0.85rem 1.25rem;
  border-radius: 0 10px 10px 0;
  font-size: 1.05rem;
  color: #334155;
}

/* 5. Trilhas Diferenciadas (4 anos / 5 anos) */
.trilhas-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
  max-width: 1100px;
  margin-top: 1rem;
}

.trilha-card {
  padding: 1.5rem;
  border-radius: 16px;
  text-align: left;
  border: 2px solid;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.trilha-t4 {
  background-color: var(--t4-bg);
  border-color: var(--t4-border);
}

.trilha-t5 {
  background-color: var(--t5-bg);
  border-color: var(--t5-border);
}

.trilha-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
}

.trilha-t4 .trilha-header { color: var(--t4-color); }
.trilha-t5 .trilha-header { color: var(--t5-color); }

.trilha-text {
  font-size: 1.15rem;
  line-height: 1.5;
  color: #334155;
  flex: 1;
}

/* 6. Leitura Decodificável & Frases */
.decodificavel-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.words-display-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.word-card-large {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  background-color: #f8fafc;
  border: 3px solid #cbd5e1;
  padding: 0.75rem 1.75rem;
  border-radius: 16px;
  color: #0f172a;
  cursor: pointer;
  transition: all 0.15s ease;
}

.word-card-large:hover {
  transform: translateY(-3px);
  border-color: #3b82f6;
  background-color: #eff6ff;
}

.sentence-display {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #1e293b;
  background-color: #f1f5f9;
  padding: 1.2rem 2.5rem;
  border-radius: 16px;
  border-left: 8px solid #2563eb;
}

/* 7. Ônibus da Frase (Segmentação) */
.bus-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(180deg, #fef08a, #facc15);
  padding: 1.5rem 2.5rem;
  border-radius: 24px;
  border: 4px solid #ca8a04;
  box-shadow: var(--shadow-lg);
}

.bus-cap {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #3b82f6, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* 8. Ditado Fônico com Autocorreção */
.ditado-reveal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.ditado-hidden-items {
  display: none;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.ditado-hidden-items.revealed {
  display: flex;
}

.btn-reveal {
  background-color: #16a34a;
  color: #ffffff;
  border: none;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.75rem 2rem;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.1s ease;
}

.btn-reveal:hover {
  background-color: #15803d;
  transform: scale(1.03);
}

/* 9. Checklist Semanal de 80% (Sexta-feira) */
.checklist-wrapper {
  width: 100%;
  max-width: 950px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  text-align: left;
}

.checklist-column {
  background-color: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.25rem;
}

.checklist-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checklist-score {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background-color: #e2e8f0;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
}

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #16a34a;
}

.score-badge-success {
  background-color: #dcfce7 !important;
  color: #15803d !important;
}

.score-badge-review {
  background-color: #fee2e2 !important;
  color: #b91c1c !important;
}

/* ==========================================================================
   RODAPÉ DO SLIDE (NOTAS DO PROFESSOR & BARRA DE PROGRESSO)
   ========================================================================== */

.slide-footer {
  border-top: 1px solid var(--border-light);
  background-color: #f8fafc;
  display: flex;
  flex-direction: column;
}

.teacher-notes-bar {
  padding: 0.6rem 1.75rem;
  background-color: #fffbeb;
  border-top: 1px solid #fde68a;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: #92400e;
  line-height: 1.4;
}

.teacher-notes-bar strong {
  color: #78350f;
  white-space: nowrap;
}

.slide-navigation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.5rem;
}

.nav-arrows {
  display: flex;
  gap: 0.5rem;
}

.btn-nav-arrow {
  background-color: #e2e8f0;
  color: #1e293b;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.btn-nav-arrow:hover:not(:disabled) {
  background-color: #cbd5e1;
}

.btn-nav-arrow:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.slide-counter {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
}

.progress-track {
  flex: 1;
  max-width: 300px;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  margin: 0 1.5rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: #2563eb;
  transition: width 0.2s ease;
}

/* ==========================================================================
   MODAIS (MATERIAIS, FUNDAMENTOS, ATALHOS)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.modal-card {
  background-color: #ffffff;
  border-radius: 20px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  padding: 1.2rem 1.75rem;
  background-color: #1e293b;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
}

.btn-close-modal {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.btn-close-modal:hover {
  color: #ffffff;
}

.modal-body {
  padding: 1.75rem;
  overflow-y: auto;
  line-height: 1.6;
  font-size: 1.05rem;
  color: #334155;
}

.modal-body h3 {
  color: #0f172a;
  margin: 1.25rem 0 0.5rem 0;
}

.modal-body ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.modal-body li {
  margin-bottom: 0.4rem;
}

/* ==========================================================================
   TELA INICIAL DE SELEÇÃO (DASHBOARD QUANDO EM #/)
   ========================================================================== */

.dashboard-container {
  max-width: 1200px;
  width: 100%;
  padding: 2rem;
  overflow-y: auto;
  max-height: 90vh;
  color: #ffffff;
}

.dash-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.dash-header h1 {
  font-size: 2.6rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.dash-header p {
  font-size: 1.2rem;
  color: #94a3b8;
}

.weeks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.week-card {
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}

.week-card:hover {
  transform: translateY(-4px);
  border-color: #3b82f6;
  background-color: #273549;
}

.week-num-badge {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #60a5fa;
  margin-bottom: 0.5rem;
}

.week-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 0.75rem;
}

.week-card-desc {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.4;
  flex: 1;
  margin-bottom: 1rem;
}

.week-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #cbd5e1;
  border-top: 1px solid #334155;
  padding-top: 0.75rem;
}
