/* =========================================================
   Responsividade Global - QAPlayground
   Versão refinada e consolidada
   ========================================================= */

/* ===== Estrutura Global ===== */
html,
body {
  overflow-x: hidden;
  overflow-y: auto;
  height: 100%;
}

/* ===== Home ===== */
body.home {
  overflow-y: auto;
}

body.home .container {
  min-height: 100vh;
  display: flex;
}

/* ===== Sidebar ===== */
body.home .sidebar {
  overflow-y: auto;
  max-height: 100vh;
  width: clamp(180px, 25vw, 250px);
  position: relative;
  z-index: 10000;
  flex-shrink: 0;
}

body.home .sidebar ul {
  padding: 0;
  margin: 0;
}

body.home .sidebar li {
  list-style: none;
  margin-bottom: 6px;
}

/* ===== Conteúdo ===== */
body.home .content {
  overflow-y: auto;
  max-height: 100vh;
  flex: 1;
  padding: 20px;
}

/* ===== Requisitos ===== */
body.requisitos .doc-container {
  max-width: 1000px;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.95);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: left;
  line-height: 1.6;
}

/* ===== Componentes ===== */
#btnContatos,
.leitura-audio {
  font-size: clamp(0.8rem, 2vw, 1rem);
  padding: clamp(2px, 1.5vw, 6px) clamp(10px, 2vw, 18px);
  border-radius: clamp(4px, 1vw, 8px);
}

/* =========================================================
   Contadores
   ========================================================= */
#contador-container,
#media-container {
  width: clamp(100px, 30vw, 150px);
  text-align: center;
  font-size: clamp(12px, 2vw, 16px);
  font-weight: bold;
  background: rgba(0, 0, 0, 0.7);
  color: #ffae82;
  padding: clamp(2px, 1.5vw, 8px) clamp(6px, 2vw, 12px);
  border-radius: clamp(2px, 1vw, 6px);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  z-index: 9000;
}

/* Desktop */
#media-container {
  position: fixed;
  bottom: clamp(10px, 3vw, 20px);
  left: clamp(10px, 15vw, 270px);
}

#contador-container {
  position: fixed;
  bottom: clamp(10px, 3vw, 20px);
  right: clamp(10px, 3vw, 20px);
  min-width: clamp(120px, 25vw, 180px);
}

/* ===== Logo ===== */
.logo-home img {
  max-width: clamp(140px, 20vw, 180px);
}

/* ===== Modais ===== */
.modal-content {
  max-width: 90%;
  margin: auto;
  padding: clamp(10px, 4vw, 20px);
  border-radius: 8px;
}

/* ===== Tipografia ===== */
h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

h2,
h3 {
  font-size: clamp(1rem, 3vw, 1.5rem);
}

/* =========================================================
   Breakpoints
   ========================================================= */

/* ===== Notebooks / Tablets grandes ===== */
@media (max-width: 992px) {
  body.requisitos .doc-container {
    max-width: 90%;
    padding: 20px;
  }

  #media-container {
    left: auto;
    right: 10px;
    bottom: 60px;
  }
}

/* ===== Tablets ===== */
@media (max-width: 768px) {
  body.home .container {
    flex-direction: column;
  }

  body.home .sidebar {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    max-height: none;
  }

  body.home .sidebar ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  body.home .sidebar li {
    flex: 1 1 45%;
    margin: 5px;
  }

  body.home .content {
    padding: 15px;
  }
}

/* ===== Celulares ===== */
@media (max-width: 576px) {
  h1,
  h2,
  h3 {
    font-size: 1.2rem;
    text-align: center;
  }

  button,
  input,
  textarea {
    width: 100%;
    font-size: 0.9rem;
  }

  body.home .container {
    flex-direction: column;
    min-height: 100vh;
  }

  body.home .sidebar {
    width: 100%;
    padding: 8px;
  }

  body.home .sidebar ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  body.home .sidebar li {
    flex: 1 1 48%;
    margin: 4px;
  }

  body.home .content {
    padding: 10px;
  }

  #media-container,
  #contador-container {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin: 10px auto;
    transform: none;
    font-size: 0.8rem;
  }
}

/* =========================================================
   Animações
   ========================================================= */
@keyframes destaque {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-25px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}
/* ===== Formulários (Login / Cadastro / similares) ===== */

.login-content {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 4vw, 30px);
}

.form-container {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

/* Inputs mais confortáveis em mobile */
.form-container input {
  font-size: 1rem;
  padding: 10px;
}

/* ===== Botões ===== */

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* Grupo QA separado visualmente */
.button-group.qa-buttons {
  margin-top: 12px;
}

/* Mobile */
@media (max-width: 576px) {
  .form-container {
    max-width: 100%;
  }

  .button-group button {
    width: 100%;
  }
}

/* =========================================================
   Ajustes específicos – Página Requisitos (Cadastro)
   ========================================================= */

/* Listas mais legíveis (principalmente mobile) */
body.requisitos ul {
  padding-left: 20px;
}

body.requisitos li {
  margin-bottom: 6px;
}

/* Botão "Voltar" com respiro visual */
body.requisitos .button-group {
  margin-top: 20px;
}

/* Ajuste de título em telas pequenas */
@media (max-width: 576px) {
  body.requisitos h1 {
    font-size: 1.3rem;
    text-align: center;
  }
}
/* ===== Login (senha + captcha) ===== */

.password-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.password-container input {
  flex: 1;
}

.toggle-btn {
  padding: 8px 10px;
  font-size: 1rem;
  cursor: pointer;
}

/* Captcha */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.captcha-logo {
  max-height: 32px;
}

/* Mobile */
@media (max-width: 576px) {
  .password-container {
    flex-direction: row;
  }

  .toggle-btn {
    padding: 6px 8px;
  }

  .captcha-row {
    justify-content: center;
    text-align: center;
  }

  .captcha-logo {
    margin-top: 6px;
  }
}

/* ===============================
   CATÁLOGO DE BOTÕES - RESPONSIVO
   =============================== */

.catalogo-botoes {
  overflow-x: hidden;
}

/* Área dos botões */
.catalogo-botoes .demo-actions {
  display: flex;
  flex-wrap: nowrap; /* 🔑 NÃO permite quebra no desktop */
  gap: 12px;
  justify-content: center;
}

/* Botões NÃO esticam e NÃO forçam quebra */
.catalogo-botoes .demo-actions button {
  min-width: 120px;
  flex: 0 0 auto;
}

/* ===============================
   TELAS MÉDIAS (notebooks / tablets landscape)
   =============================== */
@media (max-width: 1024px) {
  .catalogo-botoes .demo-actions {
    flex-wrap: wrap; /* aqui PODE quebrar */
    justify-content: center;
  }
}

/* ===============================
   MOBILE
   =============================== */
@media (max-width: 768px) {
  .catalogo-botoes .demo-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .catalogo-botoes .demo-actions button {
    width: 100%;
  }

  .catalogo-botoes .demo-card {
    padding: 16px;
  }
}

/* ===============================
   MOBILE MUITO PEQUENO
   =============================== */
@media (max-width: 480px) {
  .catalogo-botoes h1 {
    font-size: 1.4rem;
    text-align: center;
  }

  .catalogo-botoes h2 {
    font-size: 1.1rem;
    text-align: center;
  }

  .catalogo-botoes p {
    font-size: 0.9rem;
    text-align: center;
  }
}
/* ===============================
   REQUISITOS – RESPONSIVIDADE
   =============================== */

body.requisitos .doc-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

/* Melhora leitura em telas grandes */
body.requisitos h1,
body.requisitos h2,
body.requisitos h3 {
  line-height: 1.3;
}

body.requisitos ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

body.requisitos li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Botão fixo e organizado */
body.requisitos .button-group {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

/* ===============================
   TABLET
   =============================== */
@media (max-width: 1024px) {
  body.requisitos .doc-container {
    padding: 20px;
  }
}

/* ===============================
   MOBILE
   =============================== */
@media (max-width: 768px) {
  body.requisitos .doc-container {
    padding: 16px;
  }

  body.requisitos h1 {
    font-size: 1.4rem;
    text-align: center;
  }

  body.requisitos h2 {
    font-size: 1.2rem;
    margin-top: 24px;
  }

  body.requisitos h3 {
    font-size: 1.05rem;
    margin-top: 16px;
  }

  body.requisitos ul {
    padding-left: 16px;
  }

  body.requisitos .button-group button {
    width: 100%;
    max-width: 320px;
  }
}

/* ===============================
   MOBILE MUITO PEQUENO
   =============================== */
@media (max-width: 480px) {
  body.requisitos p,
  body.requisitos li {
    font-size: 0.9rem;
  }
}

body.login .login-content,
body.formulario .login-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
}
/* =========================================
   Arrastar e Soltar – Layout Base
   ========================================= */

body.arrastar-soltar #game-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

body.arrastar-soltar #hud {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 12px;
}

/* Garante imagens responsivas sem vazar */
body.arrastar-soltar .item-slot img {
  max-width: 100%;
  height: auto;
}

/* =========================================
   TABLET
   ========================================= */
@media (max-width: 768px) {
  body.arrastar-soltar #game-container {
    grid-template-columns: 1fr;
  }

  body.arrastar-soltar #coluna-palavras {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  body.arrastar-soltar #hud {
    justify-content: center;
    text-align: center;
  }
}

/* =========================================
   MOBILE
   ========================================= */
@media (max-width: 576px) {
  body.arrastar-soltar .tag-palavra {
    font-size: 0.9rem;
    padding: 8px;
  }

  body.arrastar-soltar .item-slot {
    min-height: 90px;
  }

  body.arrastar-soltar #hud {
    flex-direction: column;
    gap: 6px;
  }

  body.arrastar-soltar .button-group button {
    width: 100%;
  }
}

/* =========================================
   MOBILE MUITO PEQUENO
   ========================================= */
@media (max-width: 480px) {
  body.arrastar-soltar #coluna-palavras {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   RESPONSIVIDADE – QUEBRA-CABEÇA
   Página: quebra-cabeca.html
   ========================================================= */

/* ===============================
   TABLET
   =============================== */
@media (max-width: 768px) {
  body.quebra-cabeca .tabuleiro-referencia {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
  }

  /* Referência sobe para facilitar visualização */
  body.quebra-cabeca .referencia-container {
    order: -1;
  }

  /* Botões de nível mais organizados */
  body.quebra-cabeca #botoes-niveis {
    justify-content: center;
    gap: 8px;
  }
}

/* ===============================
   MOBILE
   =============================== */
@media (max-width: 576px) {
  body.quebra-cabeca h1 {
    text-align: center;
  }

  body.quebra-cabeca h3 {
    text-align: center;
  }

  /* Botões de nível em coluna */
  body.quebra-cabeca #botoes-niveis {
    flex-direction: column;
  }

  /* Botões de navegação ocupam largura total */
  body.quebra-cabeca #botoes-navegacao button {
    width: 100%;
    max-width: 320px;
  }

  /* Mensagem mais legível */
  body.quebra-cabeca #mensagem {
    text-align: center;
    font-size: 0.95rem;
  }
}

/* ===============================
   MOBILE MUITO PEQUENO
   =============================== */
@media (max-width: 480px) {
  body.quebra-cabeca h3 {
    font-size: 1rem;
  }
}
/* =========================================================
   FIX DEFINITIVO – TABELAS NO MOBILE
   ========================================================= */
@media (max-width: 768px) {
  /* Libera os containers pais */
  .login-content,
  .doc-container {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Cada tabela controla seu próprio scroll */
  [id$="-container"] {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Tabela não tenta se adaptar */
  table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
  }
}
