/**
 * Tema Espacial Simplificado para Reveal.js (Versão 3.0)
 * Design inspirado na vastidão do espaço com layout mais flexível
 */

/* =============================================
   VARIÁVEIS DE COR E CONFIGURAÇÃO GLOBAL
   ============================================= */
:root {
  --space-black: #0a0a0f;
  --deep-blue: #1a237e;
  --star-blue: #4fc3f7;
  --nebula-blue: rgba(79, 195, 247, 0.15);
  --text-color: #e0e0e0;
  --accent-color: #64b5f6;
  --highlight-color: #ff5a5f;
  
  /* Cores para seções específicas */
  --math-bg: rgba(79, 195, 247, 0.05);
  --history-bg: rgba(26, 35, 126, 0.2);
  --problem-bg: rgba(26, 35, 126, 0.1);
  
  /* Cores para vetores */
  --vector-position: #1E88E5;  /* Azul */
  --vector-velocity: #43A047;  /* Verde */
  --vector-acceleration: #E53935;  /* Vermelho */
  --vector-force: #FFB300;  /* Amarelo */
  --vector-unit: #FFFFFF;  /* Branco */
}

/* =============================================
   AMBIENTE ESPACIAL BASE
   ============================================= */
.reveal {
  background: var(--space-black);
  color: var(--text-color);
  position: relative;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 95%; /* Reduzimos ligeiramente o tamanho base da fonte */
}

/* Campo estelar estático */
.reveal::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(2px 2px at 20px 30px, #fff, rgba(0, 0, 0, 0)) calc(50px * 1)
      calc(50px * 1),
    radial-gradient(2px 2px at 40px 70px, #fff, rgba(0, 0, 0, 0)) calc(50px * 2)
      calc(50px * 2),
    radial-gradient(2px 2px at 50px 160px, #fff, rgba(0, 0, 0, 0))
      calc(50px * 3) calc(50px * 3),
    radial-gradient(2px 2px at 90px 40px, #fff, rgba(0, 0, 0, 0)) calc(50px * 4)
      calc(50px * 4),
    radial-gradient(2px 2px at 130px 80px, #fff, rgba(0, 0, 0, 0))
      calc(50px * 5) calc(50px * 5),
    radial-gradient(3px 3px at 160px 120px, var(--star-blue), rgba(0, 0, 0, 0))
      calc(50px * 6) calc(50px * 6),
    radial-gradient(2px 2px at 200px 150px, #fff, rgba(0, 0, 0, 0))
      calc(50px * 7) calc(50px * 7),
    radial-gradient(2px 2px at 250px 250px, #fff, rgba(0, 0, 0, 0))
      calc(50px * 8) calc(50px * 8),
    radial-gradient(3px 3px at 300px 350px, var(--star-blue), rgba(0, 0, 0, 0))
      calc(50px * 9) calc(50px * 9);
  background-size: 500px 500px;
  opacity: 0.8;
  pointer-events: none;
  z-index: -1;
}

/* =============================================
   ASTEROIDES (SIMPLIFICADOS)
   ============================================= */
@keyframes asteroid1 {
  from { transform: translate(-100vw, -50vh) rotate(30deg); opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  to { transform: translate(100vw, 50vh) rotate(30deg); opacity: 0; }
}

@keyframes asteroid2 {
  from { transform: translate(100vw, -30vh) rotate(-45deg); opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  to { transform: translate(-100vw, 30vh) rotate(-45deg); opacity: 0; }
}

.reveal .asteroid {
  position: fixed;
  width: 3px;
  height: 3px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}

.reveal .asteroid::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background: linear-gradient(to right, #fff, transparent);
  transform: translateX(-100%);
}

.reveal .asteroid:nth-child(1) {
  top: 20%;
  animation: asteroid1 20s linear infinite;
  animation-delay: 0s;
}

.reveal .asteroid:nth-child(2) {
  top: 60%;
  animation: asteroid2 25s linear infinite;
  animation-delay: 10s;
}

/* =============================================
   ESTRUTURA DOS SLIDES (MAIS FLEXÍVEL)
   ============================================= */
.reveal .slides {
  text-align: center;
  height: 100%;
  width: 100%;
}

.reveal .slides section {
  padding: 15px;
  font-size: 22px;
  text-align: center;
  box-sizing: border-box;
  width: 100%; /* Voltamos para 100% */
  max-width: 100%;
  max-height: 100%;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* =============================================
   TÍTULOS
   ============================================= */
.reveal h1 {
  color: var(--star-blue);
  font-size: 2.2em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 0 15px rgba(79, 195, 247, 0.5);
  margin-bottom: 0.6em;
  width: 100%;
  text-align: center;
}

.reveal h2 {
  color: var(--star-blue);
  font-size: 1.6em;
  margin-bottom: 0.4em;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.3);
  width: 100%;
  text-align: center !important;
}

.reveal h3 {
  color: var(--accent-color);
  font-size: 1.2em;
  width: 100%;
  text-align: center;
  margin-bottom: 0.4em;
}

/* =============================================
   CONTEÚDO TEXTUAL
   ============================================= */
.reveal p {
  line-height: 1.4;
  margin: 0.3em 0;
  max-width: 100%;
}

/* =============================================
   LISTAS
   ============================================= */
.reveal ul,
.reveal ol {
  text-align: left;
  margin: 0.3em 0;
  width: 100%;
  padding-left: 1.5em; /* Reduzir o padding para listas */
}

.reveal ul li,
.reveal ol li {
  margin: 0.3em 0;
  line-height: 1.3;
  padding-left: 0.3em;
}

/* =============================================
   ELEMENTOS MATEMÁTICOS
   ============================================= */
.reveal .math {
  font-size: 1.1em;
  margin: 0.5em 0;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 1;
}

.katex { 
  font-size: 1em; 
}

/* =============================================
   BLOCOS DE CÓDIGO
   ============================================= */
.reveal pre {
  background: rgba(26, 35, 126, 0.3);
  box-shadow: 0 0 20px rgba(79, 195, 247, 0.1);
  margin: 1em auto;
  padding: 1em;
  text-align: left;
  width: 100%;
  overflow-x: auto;
}

.reveal code {
  background: rgba(26, 35, 126, 0.3);
  color: var(--star-blue);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

/* =============================================
   CITAÇÕES
   ============================================= */
.reveal blockquote {
  background: rgba(26, 35, 126, 0.3);
  border-left: 4px solid var(--accent-color);
  box-shadow: 0 0 20px rgba(79, 195, 247, 0.1);
  margin: 1em 0;
  padding: 1em;
  width: 100%;
  text-align: left;
}

/* =============================================
   LINKS
   ============================================= */
.reveal a {
  color: var(--star-blue);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.reveal a:hover {
  color: var(--accent-color);
  text-shadow: 0 0 8px rgba(79, 195, 247, 0.5);
}

/* =============================================
   ELEMENTOS DE NAVEGAÇÃO
   ============================================= */
.reveal .controls {
  color: var(--accent-color);
}

.reveal .progress {
  background: rgba(79, 195, 247, 0.2);
  height: 3px;
}

.reveal .progress span {
  background: var(--accent-color);
}

/* =============================================
   IMAGENS
   ============================================= */
.reveal img {
  max-width: 100%;
  height: auto;
  margin: 1em auto;
  box-shadow: 0 0 20px rgba(79, 195, 247, 0.1);
  display: block;
}

/* =============================================
   COMPONENTES ESPECIALIZADOS (SIMPLIFICADOS)
   ============================================= */

/* Seção de conteúdo matemático (Mais simples) */
.math-section {
  background: var(--math-bg);
  padding: 12px;
  margin: 8px 0;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

/* Seção de contextualização histórica (Mais simples) */
.history-section {
  background: var(--history-bg);
  border-left: 3px solid var(--highlight-color);
  padding: 12px 15px;
  margin: 15px 0;
  width: 100%;
  position: relative;
  text-align: left;
  box-sizing: border-box;
}

.history-section p {
  text-align: left;
  font-style: italic;
  margin: 0.2em 0;
}

.history-section strong {
  color: var(--highlight-color);
}

.history-label {
  position: absolute;
  left: -2px;
  top: -8px;
  background: var(--highlight-color);
  color: white;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  box-sizing: border-box;
  z-index: 5;
  transform: none;
}

/* Seção de problemas (Mais simples) */
.problem-section {
  background: var(--problem-bg);
  padding: 12px;
  margin: 8px 0;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.problem-section p {
  text-align: left;
}

.problem-section strong {
  color: var(--highlight-color);
}

/* Canvas para visualizações */
.visualization-canvas {
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--accent-color);
  border-radius: 5px;
  margin: 0 auto;
  display: block;
  max-width: 100%;
  max-height: 70vh;
}

/* =============================================
   CONTROLES DE INTERAÇÃO (MAIS MODERNOS)
   ============================================= */
.controls-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px auto;
  width: 100%;
  z-index: 10;
}

.control-slider {
  display: flex;
  align-items: center;
  background: rgba(26, 35, 126, 0.3);
  padding: 4px 8px;
  border-radius: 15px;
  font-size: 0.9em;
}

.control-slider label {
  margin-right: 8px;
  white-space: nowrap;
}

.control-slider input {
  width: 120px;
}

.control-button {
  background: rgba(26, 35, 126, 0.5);
  color: var(--text-color);
  border: 1px solid var(--accent-color);
  border-radius: 15px;
  padding: 4px 12px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.control-button:hover {
  background: rgba(79, 195, 247, 0.3);
  transform: scale(1.05);
}

/* Nova classe para soluções compactas */
.compact-solution {
  background: var(--math-bg);
  padding: 8px 10px;
  margin: 8px 0;
  width: 100%;
  text-align: left;
}

/* Nova classe para dois painéis lado a lado */
.dual-panel {
  display: flex;
  width: 100%;
  gap: 15px;
  margin: 8px 0;
}

.dual-panel > div {
  flex: 1;
}

/* =============================================
   RESPONSIVIDADE
   ============================================= */
@media screen and (max-width: 768px) {
  .reveal h1 {
    font-size: 2em;
  }
  
  .reveal h2 {
    font-size: 1.5em;
  }
  
  .reveal pre {
    font-size: 0.9em;
  }
  
  .reveal .slides section {
    padding: 10px;
  }
  
  .math-section, 
  .history-section, 
  .problem-section,
  .compact-solution {
    padding: 10px;
  }
  
  .dual-panel {
    flex-direction: column;
    gap: 10px;
  }
  
  .control-slider {
    width: 100%;
    justify-content: space-between;
  }
  
  .control-slider input {
    width: 120px;
  }
}
