/* ================================
   CMB Área do Aluno — style.css 2.0
   ================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: linear-gradient(135deg, #ffecd2, #fcb69f);
  color: #2c2c2c;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* HEADER */
.header {
  background: #2c3e50;
  color: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  font-size: 18px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filtro-btn {
  background: #3498db;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

.filtro-btn.ativo { background: #1abc9c; }

.btn-sair {
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

/* TELAS */
.acesso-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
}

.acesso-box {
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
}

/* CONTEÚDO */
.conteudo-section { padding: 30px 20px; }

.tabela-container {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,.1);
}

.tabela-conteudo {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.tabela-conteudo th,
.tabela-conteudo td {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.tabela-conteudo th {
  background: #f5f6fa;
}

/* LARGURAS FIXAS */
.tabela-conteudo th:nth-child(1),
.tabela-conteudo td:nth-child(1) { width: 62%; }

.tabela-conteudo th:nth-child(2),
.tabela-conteudo td:nth-child(2) { width: 70px; text-align: center; }

.tabela-conteudo th:nth-child(3),
.tabela-conteudo td:nth-child(3) { width: 380px; }

/* TEXTO DO TÓPICO */
.ref-text {
  font-weight: 800;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* REMOVE PG ABAIXO DO TÓPICO */
td.col-ref .ref-top .ref-pg {
  display: none !important;
}

/* BOTÕES */
.btn-material,
.btn-ghost {
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
}

.btn-simulado { background: #d7f1f3; color: #245b66; }
.btn-pdf      { background: #fde2e7; color: #7a2b3b; }
.btn-video    { background: #e3e7ff; color: #2b3a7a; }
.btn-arquivo  { background: #fff0d6; color: #6b4b12; }

/* DESKTOP: botões sempre alinhados */
td.col-mats {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
}

td.col-mats .btn-material,
td.col-mats .btn-ghost {
  min-width: 92px;
}

/* MOBILE */
@media (max-width: 768px) {

  .tabela-conteudo thead { display: none; }

  .tabela-conteudo tr {
    display: block;
    margin-bottom: 14px;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 14px;
  }

  .tabela-conteudo td.col-pg,
  .tabela-conteudo td.col-mats {
    display: none;
  }

  .ref-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
  }

  .btn-material,
  .btn-ghost {
    width: calc(50% - 6px);
    text-align: center;
  }
}

/* UTIL */
.hide { display: none !important; }


/* ============================
   FIX: não duplicar botões no desktop
   Desktop = só coluna MATERIAIS
   Mobile  = botões embaixo do tópico
   ============================ */

/* Desktop: ESCONDE os botões debaixo do tópico */
@media (min-width: 769px) {
  .ref-buttons { 
    display: none !important;
  }
}

/* Mobile: MOSTRA os botões debaixo do tópico */
@media (max-width: 768px) {
  .ref-buttons { 
    display: flex !important;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
  }
}

/* Remove borda/contorno estranho dos botões (igual estava antes) */
.btn-material, .btn-ghost {
  border: none !important;
  outline: none !important;
}

.btn-material:focus,
.btn-material:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

