/* ======= JOGOS EDUCATIVOS ======= */
/* Versão moderna - Janeiro 2024 - Atualizado em Junho 2024 */

/* Variáveis para manter consistência com o ad26.css */
:root {
  /* Cores base */
  --jogos-primary: #3700FE;
  --jogos-primary-dark: #2B00C8;
  --jogos-secondary: #00c896;
  --jogos-accent: #ffb800;
  --jogos-accent-dark: #d99000;
  --jogos-success: #00c896;
  --jogos-danger: #ff5252;
  --jogos-warning: #ffb800;
  --jogos-info: #34aadf;
  --jogos-purple: #9c42f5;
  
  /* Cores de texto */
  --jogos-text-dark: #1c1e1f;
  --jogos-text-main: #333333;
  --jogos-text-secondary: #666666;
  --jogos-text-light: #999999;
  --jogos-text-white: #ffffff;
  
  /* Cores de fundo */
  --jogos-bg-white: #ffffff;
  --jogos-bg-light: #f9ffff;
  --jogos-bg-light-blue: #f5f9ff;
  
  /* Sombras */
  --jogos-shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
  --jogos-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --jogos-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  
  /* Transições */
  --jogos-transition: all 0.3s ease;
  
  /* Bordas e raios */
  --jogos-radius-sm: 4px;
  --jogos-radius-md: 8px;
  --jogos-radius-lg: 16px;
  --jogos-radius-xl: 20px;
  --jogos-radius-2xl: 24px;
  --jogos-radius-full: 50px;
  
  /* Animações */
  --jogos-animation-duration: 0.5s;
}

/* Container principal da lista de jogos */
.jogos_lista {
  padding: 2rem 0;
  text-align: center;
}

.jogos_lista h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--jogos-text-dark);
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.jogos_lista h1::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.5rem;
  width: 60px;
  height: 4px;
  background-color: var(--jogos-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.jogos_lista h1:hover::after {
  width: 100%;
}

.jogos_lista .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.jogos_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Animação de carregamento para os cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilo para cada jogo */
.jogo {
  background-color: var(--jogos-bg-white);
  border-radius: var(--jogos-radius-lg);
  overflow: hidden;
  box-shadow: var(--jogos-shadow-md);
  transition: var(--jogos-transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  animation: fadeInUp var(--jogos-animation-duration) ease-out forwards;
  opacity: 0;
}

/* Aplicar atraso na animação para efeito cascata */
.jogo:nth-child(1) { animation-delay: 0.05s; }
.jogo:nth-child(2) { animation-delay: 0.1s; }
.jogo:nth-child(3) { animation-delay: 0.15s; }
.jogo:nth-child(4) { animation-delay: 0.2s; }
.jogo:nth-child(5) { animation-delay: 0.25s; }
.jogo:nth-child(6) { animation-delay: 0.3s; }
.jogo:nth-child(7) { animation-delay: 0.35s; }
.jogo:nth-child(8) { animation-delay: 0.4s; }
.jogo:nth-child(9) { animation-delay: 0.45s; }
.jogo:nth-child(10) { animation-delay: 0.5s; }
.jogo:nth-child(n+11) { animation-delay: 0.55s; }

.jogo:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.jogo:active {
  transform: translateY(-2px);
  transition: transform 0.1s ease;
}

/* Melhorar acessibilidade com foco de teclado */
.jogo:focus-within {
  outline: 3px solid var(--jogos-primary);
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.jogo-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  outline: none;
}

.jogo-link:focus {
  outline: none;
}

.jogo .thumb {
  position: relative;
  overflow: hidden;
  border-radius: var(--jogos-radius-lg) var(--jogos-radius-lg) 0 0;
}

.jogo .thumb::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.02), rgba(0,0,0,0.2));
  z-index: 1;
  transition: var(--jogos-transition);
  opacity: 0;
}

.jogo:hover .thumb::before,
.jogo:focus-within .thumb::before {
  opacity: 1;
}

.jogo .thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  transition: var(--jogos-transition);
  display: block;
}

.jogo:hover .thumb img,
.jogo:focus-within .thumb img {
  transform: scale(1.05);
}

.jogo .thumb::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: url('../imagens/jogar-icon.svg') center center no-repeat;
  background-size: 24px;
  background-color: rgba(55, 0, 254, 0.85);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.jogo:hover .thumb::after,
.jogo:focus-within .thumb::after {
  opacity: 1;
}

/* Adicionar indicador de clique */
.jogo::before {
  content: 'Jogar';
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--jogos-primary);
  color: var(--jogos-text-white);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: var(--jogos-radius-full);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 3;
}

.jogo:hover::before,
.jogo:focus-within::before {
  opacity: 1;
  transform: translateY(0);
}

.jogo .titulo {
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--jogos-text-dark);
  margin: 0;
  text-align: center;
  transition: var(--jogos-transition);
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jogo:hover .titulo,
.jogo:focus-within .titulo {
  color: var(--jogos-primary);
}

/* Mensagem de sem jogos */
.sem-jogos {
  grid-column: 1 / -1;
  background-color: var(--jogos-bg-white);
  border-radius: var(--jogos-radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--jogos-shadow-sm);
  border: 1px dashed rgba(0, 0, 0, 0.1);
  margin: 2rem auto;
  max-width: 500px;
  animation: fadeInUp var(--jogos-animation-duration) ease-out forwards;
}

.sem-jogos p {
  color: var(--jogos-text-secondary);
  font-size: 1.1rem;
  margin: 0;
}

.sem-jogos::before {
  content: '';
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: url('../imagens/no-results.svg') center center no-repeat;
  background-size: contain;
  opacity: 0.7;
}

/* Seção de atividades por disciplina */
.atividades_lista {
  background-color: var(--jogos-bg-white);
  padding: 2.5rem 0;
  margin-top: 2rem;
  border-radius: var(--jogos-radius-xl);
  box-shadow: var(--jogos-shadow-md);
}

.atividades_lista .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.atividades_lista h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--jogos-text-dark);
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
}

.atividades_lista h2::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: var(--jogos-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.atividades_lista h2:hover::after {
  width: 100px;
}

/* Tags de disciplinas */
.tags {
  text-align: center;
}

.tags_container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  padding: 1rem 0;
}

.tags a {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  background-color: var(--jogos-bg-light);
  border-radius: var(--jogos-radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--jogos-text-main);
  text-decoration: none;
  transition: var(--jogos-transition);
  box-shadow: var(--jogos-shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.tags a:hover,
.tags a:focus {
  transform: translateY(-3px);
  box-shadow: var(--jogos-shadow-md);
  background-color: var(--jogos-primary);
  color: var(--jogos-text-white);
  outline: none;
}

/* Responsividade */
@media (max-width: 992px) {
  .jogos_grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 768px) {
  .jogos_lista h1 {
    font-size: 1.75rem;
  }
  
  .atividades_lista h2 {
    font-size: 1.25rem;
  }
  
  .tags_container {
    gap: 0.6rem;
  }
  
  .tags a {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
  
  .sem-jogos {
    padding: 2rem 1.5rem;
  }
  
  .sem-jogos p {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .jogos_grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }
  
  .jogo .thumb img {
    height: 120px;
  }
  
  .jogo .titulo {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .atividades_lista {
    padding: 1.5rem 0;
  }
  
  .sem-jogos::before {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
  }
}

/* Melhorias para acessibilidade */
@media (prefers-reduced-motion: reduce) {
  .jogo {
    animation: none;
    opacity: 1;
  }
  
  .jogo:hover,
  .jogo:focus-within,
  .tags a:hover,
  .tags a:focus {
    transform: none;
  }
} 