/* =============================================
   RESET E ESTRUTURA
   ============================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
}

html, body {
  height: 100%;
  background-color: #eef0f3;
}

/* ---------------------- LOGIN ---------------------- */
body:has(.login-box) {
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-box {
  background: linear-gradient(to bottom, #0072ff, #00a1ff);
  padding: 40px 30px;
  border-radius: 16px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login-box .logo {
  font-size: 26px;
  color: white;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.login-box h2 {
  color: white;
  margin-bottom: 30px;
  font-size: 18px;
  font-weight: 500;
}

.login-box label {
  color: white;
  display: block;
  text-align: left;
  margin: 14px 0 6px;
  font-size: 14px;
  font-weight: 500;
}

.login-box input {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-size: 16px;
  background-color: #fff;
  outline: none;
  margin-bottom: 10px;
}

.login-box button {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background-color: #003FA6;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  
  transition: background-color 0.3s;
}

.login-box button:hover {
  background-color: #0056e0;
}

.login-box .footer {
  margin-top: 30px;
  color: #dbe9ff;
  font-size: 13px;
}

/* Responsividade login */
@media (max-width: 480px) {
  .login-box {
    padding: 40px 15px;
    margin: 0 15px;
  }
  .login-box .logo { font-size: 22px; }
  .login-box h2 { font-size: 16px; }
  .login-box input { font-size: 15px; }
}

/* ---------------------- STUDENT ---------------------- */
/* Topbar */
.topbar {
  background: linear-gradient(90deg, #0072ff, #00c6ff);
  color: #fff;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar .logo {
  font-size: 20px;
  font-weight: bold;
}

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

.user-info img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
}

.user-info span { font-weight: bold; }

.user-info button {
  background-color: #fff;
  color: #2A307B;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.user-info button:hover {
  background-color: #e0e0e0;
}

/* Conteúdo principal */
.student-content {
  padding: 30px;
  max-width: 1100px;
  margin: auto;
}

.student-content h1 {
  color: #2A307B;
  font-size: 24px;
  margin-bottom: 10px;
}

.student-content p {
  font-size: 16px;
  color: #555;
  margin-bottom: 30px;
}

/* Abas expansíveis */
.section {
  margin-bottom: 40px;
  border-radius: 12px;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.section-toggle {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(90deg, #0072ff, #00c6ff);
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  text-align: left;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.3s;
}

.section-toggle::after {
  content: '▼';
  position: absolute;
  right: 20px;
  font-size: 14px;
  transition: transform 0.3s ease;
}

.section-toggle.open::after {
  transform: rotate(180deg);
}

.section-content {
  max-height: 0;
  padding: 0 24px;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.section-content.show {
  padding: 24px;
  max-height: 2000px;
}

/* Cards gerais (student e admin unificados) */
.book-card,
.livro-card {
  width: 280px;
  max-width: 100%;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card.dragging,
.livro-card.dragging {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.book-card.invisible,
.livro-card.invisible {
  display: none !important;
}

.book-card img.book-cover,
.livro-card img,
.livro-card img.livro-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  margin-bottom: 12px;
}

.book-card h3,
.livro-card h3 {
  font-size: 18px;
  color: #2A307B;
  margin: 4px 0 8px;
}

.book-card p,
.livro-card p {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

/* Botões de ação nos cards */
.access-btn,
.access-direct,
.locked-btn,
.livro-card a,
.book-card .locked-btn {
  display: block;
  width: 100%;
  padding: 10px;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  border-radius: 8px;
  text-decoration: none;
  margin-top: auto;
  transition: background 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.access-btn,
.access-direct {
  background: linear-gradient(90deg, #0072ff, #00c6ff);
  color: #fff;
  border: none;
}

.access-btn:hover,
.access-direct:hover {
  background: linear-gradient(90deg, #005ed1, #00aaff);
}

.locked-btn {
  background: #aaa;
  color: #fff;
}

.book-card.bloqueado {
  filter: grayscale(1);
  opacity: 0.7;
}

/* Opções extras (PDF / Online) */
.material-options {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  animation: fadeIn 0.3s ease;
}

.material-options.show {
  display: flex;
}

.material-options a {
  padding: 10px 0;
  font-size: 14px;
  font-weight: bold;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.material-options a.pdf {
  background-color: #e74c3c;
  color: #fff;
}

.material-options a.pdf:hover {
  background-color: #c0392b;
}

.material-options a.online {
  background-color: #fff;
  color: #0072ff;
  border: 2px solid #0072ff;
}

.material-options a.online:hover {
  background-color: #f5faff;
}

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

/* =============================================
   GRADES DE CARDS
   ============================================= */
.book-grid,
.extra-grid,
#lista-livros,
#extras,
#lista-livros-books,
#lista-livros-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

/* Responsividade cards */
@media (min-width: 768px) {
  .book-grid,
  .extra-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 600px) {
  .book-card,
  .livro-card {
    max-width: 100%;
  }
  .card-buttons .actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  .card-buttons .pdf,
  .card-buttons .online {
    width: 80%;
  }
}

.card-buttons {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  justify-content: center;
}

/* ---------------------- ADMIN ---------------------- */
.admin-content {
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 20px;
}

.admin-content h1 {
  color: #2A307B;
  font-size: 24px;
  margin-bottom: 20px;
}

/* Tabs e acordeões */
.admin-tabs,
.painel-menu {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-button,
.admin-accordion-button {
  background: linear-gradient(90deg, #0072ff, #00c6ff);
  color: #fff;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: bold;
  text-align: left;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: filter 0.3s;
  width: 100% !important;
  box-sizing: border-box;
}

.tab-button::after,
.admin-accordion-button::after {
  content: '▼';
  position: absolute;
  right: 20px;
  transition: transform 0.3s;
}

.tab-button.open::after,
.admin-accordion-button.open::after {
  transform: rotate(180deg);
}

.tab-button.active,
.tab-button.open {
  background: #1B1F4A;
}

.tab-content,
.admin-accordion-content {
  display: none;
  background: #f9f9f9;
  padding: 12px 10px;
  border-radius: 10px;
}

.tab-content.show,
.admin-accordion.show .admin-accordion-content {
  display: block;
  animation: fadeIn 0.3s ease;
}

.admin-accordion-content {
  background: #fff;
  border-top: 1px solid #eee;
}

/* Painéis internos */
.admin-panel {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  padding: 20px;
  display: flex;
  gap: 0px;
  flex-wrap: wrap;
}

.admin-form,
.admin-lista {
  flex: 1;
  min-width: 300px;
}

.admin-form h2,
.admin-lista h2 {
  font-size: 18px;
  color: #2A307B;
  margin-bottom: 15px;
}

.admin-form input,
.admin-form select,
.admin-form input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}

.btn-blue {
  background-color: #0072ff;
  color: #fff;
  border: none;
  padding: 12px;
  width: 100%;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-blue:hover {
  background-color: #005ed1;
}

.btn-delete {
  background-color: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-delete:hover {
  background-color: #c0392b;
}

/* Tabela de usuários */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
}

table th,
table td {
  text-align: left;
  padding: 10px;
  font-size: 14px;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: middle;
}

.user-badge {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #fff;
  font-size: 1rem;
}

.user-badge.pink { background-color: #e74c3c; }
.user-badge.green { background-color: #27ae60; }
.user-badge.orange { background-color: #e67e22; }

/* Modal overlay */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow-y: auto;
  padding: 20px;
  animation: modalFadeIn 0.3s;
}

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

/* Modal-box (PERMISSÕES) */
.modal-box {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  min-width: 280px;
  min-height: 220px;
  max-height: 80vh;
  box-shadow: 0 10px 25px rgba(0,0,0,0.20);
  animation: modalZoomIn 0.3s;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 24px;
  position: relative;
  box-sizing: border-box;
  transition: max-height 0.3s cubic-bezier(.5,1.5,.5,1.1), min-height 0.3s cubic-bezier(.5,1.5,.5,1.1);
  overflow-y: auto;
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.93) translateY(24px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Fechar com fadeOut se necessário */
.modal.fade-out {
  animation: modalFadeOut 0.25s forwards;
}
@keyframes modalFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Título e conteúdo centralizado */
.modal-box h2 {
  font-size: 20px;
  color: #2A307B;
  margin: 0 auto 10px;
  text-align: center;
}

.modal-box .checkbox-grid,
.modal-box .material-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 8px;
}

.modal-box .modal-buttons,
.modal-box .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Botões padrão */
.modal-box button,
.modal-box .btn-blue,
.modal-box .btn-delete {
  min-width: 80px;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  transition: background 0.3s;
}

.modal-box .btn-blue {
  background-color: #0072ff;
  color: #fff;
}
.modal-box .btn-blue:hover {
  background-color: #005ed1;
}
.modal-box .btn-delete {
  background-color: #e74c3c;
  color: #fff;
}
.modal-box .btn-delete:hover {
  background-color: #c0392b;
}

/* Ocultar com display:none */
.hidden { display: none !important; }

/* Popup de erro */
.popup-error {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff4d4f;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 1;
  transition: all 0.4s ease;
}

/* Fotos e badges na tabela de alunos */
#tabela-alunos img.user-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
}
#tabela-alunos td {
  vertical-align: middle;
  padding: 8px 12px;
}

/* Ajuste geral de responsividade admin */
@media (max-width: 768px) {
  .admin-form,
  .admin-panel,
  .admin-tabs {
    width: 100% !important;
    padding: 10px;
  }
  .tab-button,
  .modal-content,
  .modal-box {
    margin-bottom: 10px;
  }
  .livro-card,
  .register-card {
    width: 100% !important;
    margin-bottom: 12px;
  }
}

.admin-panel .admin-tabs {
  flex: 1 1 100% !important;
  width: 100% !important;
  margin: 0 auto !important;
}

/* Deixa as abas de admin vertical para mobile */
.admin-tabs { flex-direction: column !important; }

/* ----------------------------------------------------
   Modal de edição igual ao modal-box (caso não funcione)
   ---------------------------------------------------- */
.modal-content {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  min-width: 280px;
  min-height: 220px;
  max-height: 80vh;
  box-shadow: 0 10px 25px rgba(0,0,0,0.20);
  animation: modalZoomIn 0.3s;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 24px;
  position: relative;
  box-sizing: border-box;
  transition: max-height 0.3s cubic-bezier(.5,1.5,.5,1.1), min-height 0.3s cubic-bezier(.5,1.5,.5,1.1);
  overflow-y: auto;
}

.modal-content h3 {
  font-size: 20px;
  color: #2A307B;
  margin: 0 auto 10px;
  text-align: center;
  font-weight: bold;
}

/* Inputs centralizados */
.modal-content input[type="text"],
.modal-content input[type="url"],
.modal-content input[type="file"],
.modal-content select {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #d3d3d3;
  border-radius: 8px;
  font-size: 15px;
  box-sizing: border-box;
}

/* Botões lado a lado, centralizados, largura igual */
.modal-content .modal-buttons {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.modal-content .btn-blue,
.modal-content .btn-delete {
  width: 50%;
  min-width: 100px;
  padding: 10px 0;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
  border: none;
}

.modal-content .btn-blue {
  background-color: #0072ff;
  color: #fff;
}
.modal-content .btn-blue:hover {
  background-color: #005ed1;
}
.modal-content .btn-delete {
  background-color: #e74c3c;
  color: #fff;
}
.modal-content .btn-delete:hover {
  background-color: #c0392b;
}

/* ----------------------------------------------------
   Regras específicas para #books em mobile
   ---------------------------------------------------- */
@media (max-width: 600px) {
  #books {
    justify-content: center !important;
    overflow-x: hidden !important;   /* Esconde rolagem horizontal */
    overflow-y: auto !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    padding-right: 24px;
  }
  .book-card {
    width: 100% !important;
    max-width: 420px !important;       /* Limita para um card bonito, mas nunca maior que a tela */
    min-width: 0 !important;
    margin: 0 auto 16px auto !important;
    box-sizing: border-box !important;
    display: flex;
    flex-direction: column;
  }
}

/* Logo genérica (pode aparecer em várias páginas) */
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.logo-img {
  width: 180px; /* ajuste o tamanho como quiser */
  height: auto;
  margin-bottom: 10px;
}

/* ----------------------------------------------------
   Regras específicas para #lessons em mobile
   ---------------------------------------------------- */
@media (max-width: 600px) {
  #lessons {
    justify-content: center !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  .lesson-card {
    width: 100% !important;
    max-width: 420px !important;
    min-width: 0 !important;
    margin: 0 auto 16px auto !important;
    box-sizing: border-box !important;
    display: flex;
    flex-direction: column;
  }
}

/* === AULAS GRAVADAS === */
.aula-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.aula-form select,
.aula-form input[type="text"],
.aula-form input[type="date"],
.aula-form input[type="url"] {
  flex: 1 1 150px;
  padding: 7px 8px;
  border: 1px solid #d3d8e6;
  border-radius: 7px;
  background: #f6f8fb;
  font-size: 1em;
}
.aula-form button {
  min-width: 130px;
}

.aula-filtro {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-lessons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

/* Card das aulas gravadas */
.lesson-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,.06);
  padding: 18px 16px 16px 16px;
  width: 100%;
  max-width: 350px;
  min-width: 260px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.2s;
}

.lesson-card h3 {
  font-size: 1.17em;
  color: #2360e8;
  margin-bottom: 8px;
  font-weight: 600;
  text-align: center;
}

.lesson-aluno {
  font-weight: 500;
  color: #111;
  margin-bottom: 6px;
}

.lesson-card iframe {
  width: 100%;
  min-height: 180px;
  max-width: 100%;
  border-radius: 12px;
  margin-bottom: 12px;
  border: none;
  background: #eee;
  display: block;
}

.lesson-desc {
  font-size: 0.97em;
  color: #444;
  margin-bottom: 8px;
  text-align: center;
  word-break: break-word;
}

.btn-danger {
  background: #ee2344;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 20px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover {
  background: #c41b36;
}

/* Ajustes para a aba “Aulas Gravadas” */
#aba-aulas-gravadas .lesson-card {
  max-width: 270px;      /* Diminui o tamanho máximo do card */
  width: 100%;
  min-width: 0;
  margin: 0;
  /* O restante do estilo se mantém igual */
}

#aba-aulas-gravadas .book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); /* 230px é menor */
  gap: 24px;
  padding: 24px;
  width: 100%;
  box-sizing: border-box;
  justify-items: center; /* Mantém centralizado caso sobre espaço */
}

/* Ajustes gerais para “aulas gravadas” no admin */
#aulas-gravadas-admin.book-grid {
  
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
}

#lessons {
  
  justify-content: flex-start !important;
  flex-wrap: wrap !important;
}

@media (max-width: 768px) {
  #aulas-gravadas-admin.book-grid {
    justify-content: center !important;
  }
}

/* Quando a aba de “lessons” está aberta */
#lessons.section-content.book-grid.show {
  max-height: 2000px !important;
}

/* ==== Botão Marcar como Assistido ==== */
.mark-btn {
  background-color: #fff;
  color: #2980b9;
  border: 2px solid #2980b9;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.4s ease, color 0.4s ease, transform 0.2s ease;
}

.mark-btn:hover {
  transform: scale(1.05);
}

.mark-btn.watched {
  background-color: #27ae60;
  color: #fff;
  border-color: #27ae60;
}

.mark-btn .check {
  margin-left: 6px;
  font-weight: bold;
}

@media (min-width: 992px) {
  /* Em telas largas, usa grid 3 colunas para lessons */
  #lessons.section-content.book-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
  }
  /* Garante que cada lesson-card cresça para preencher a coluna */
  #lessons.section-content.book-grid .lesson-card {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }
}

/* ----------------------------------------------------
   A PARTIR AQUI: CORREÇÃO PARA #extras.extra-grid
   ---------------------------------------------------- */

/* 
   Para que o “Material Extra” (id="extras" com classes
   section-content extra-grid show) se comporte EXATAMENTE
   como o “book-grid” de #lessons, copiei as mesmas regras:
   - Mesmo max-height
   - Scroll vertical (overflow-y)
   - Em telas ≥ 992px, grid de 3 colunas
*/

/* Quando a aba “Material Extra” estiver com classe show */
#extras.section-content.extra-grid.show {
  max-height: 2000px !important;
  overflow-y: auto !important;   /* scroll vertical, igual ao book-grid */
  overflow-x: hidden !important;  /* nada de scroll horizontal */
  padding: 24px !important;
}

/* Em telas maiores (≥ 992px), grid de 3 colunas para extra */
@media (min-width: 992px) {
  #extras.section-content.extra-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
  }
  #extras.section-content.extra-grid .lesson-card {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }
}

/* Se havia alguma regra anterior que aplicava flex-wrap: wrap
   ou grid-template: auto-fit para extra-grid, este bloco
   garante que ela esteja sobrescrita. */

/* =============================================
   FIM DO ARQUIVO CSS
   ============================================= */
#books.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 40px;
}

#extras.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 40px;
}

/* Scroll para as áreas de checkbox de livros e extras */
.checkbox-grid {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 10px;
}

/* Garante que a rolagem não quebre o layout */
.checkbox-grid label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}


.section-content.book-grid.show {
  max-height: 1000px;
  overflow-y: auto;
}

.section-content.book-grid {
  overflow-y: auto;
}
.important-materials {
  padding: 40px 20px;
 
  border-top: 3px solid #2A307B;
}

.important-materials h2 {
  font-size: 28px;
  color: #2A307B;
  margin-bottom: 25px;
  text-align: center;
}

/* 📢 Estilo geral da aba de atualizações */
.updates-section {
  padding: 30px 20px;
  background: #eef0f3;
  border-top: 3px solid #2A307B;
  margin: 0 auto;
  max-width: 1100px;
}

.updates-section h2 {
  font-size: 26px;
  text-align: center;
  color: #2A307B;
  margin-bottom: 25px;
}

/* Formulário de atualizações */
#form-atualizacao textarea,
#form-atualizacao input[type="file"],
#form-atualizacao select {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 15px;
  box-sizing: border-box;
}

#form-atualizacao label {
  font-weight: bold;
  margin-top: 15px;
  display: block;
  color: #2A307B;
}

.checkbox-list {
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  margin-bottom: 15px;
}

.checkbox-list label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  color: #333;
}

/* Estilo da aba #aba-atualizacoes igual .admin-panel */
#aba-atualizacoes {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%; /* ocupa 100% do container pai (.painel-menu) */
  padding: 20px;
  box-sizing: border-box;
  margin: 0 auto 20px auto; /* margem inferior para espaçamento */
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1100px;
}

/* Se quiser usar a classe admin-panel no id */
#aba-atualizacoes.admin-panel {
  background: #f7f9fb;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-top: 20px;
}

/* Posicionamento de #minhas-atualizacoes abaixo do formulário */
#form-atualizacao {
  margin-bottom: 20px;
}

#minhas-atualizacoes {
  margin-top: 10px;
}

/* Título h3 com emoji */
#minhas-atualizacoes h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Cards das atualizações */
.update-card {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-width: 600px;
  margin: 0 auto 20px auto;
  font-family: Arial, sans-serif;
}
.update-card .header {
   display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.update-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #2A307B;
}
/* Título dentro do card */
.update-card h4 {
  font-size: 20px;
  color: #B01F3D;
  margin-bottom: 10px;
}

/* Imagem das atualizações - tamanho fixo consistente */
.update-card .update-img {
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

/* Texto dentro do card */
.update-card p {
  font-size: 16px;
  color: #333;
  margin: 10px;
}

/* Texto forte dentro do card (ex: nome) */
.update-card strong {
  font-size: 17px;
  color: #2A307B;
}

/* Botão vermelho */
.btn-red {
  background-color: #B01F3D;
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  align-self: center; /* centraliza horizontalmente */
  max-width: 120px;
}

.btn-red:hover {
  background-color: #8e162f;
}

/* Limite de altura e barra de rolagem para listas */
#lista-atualizacoes,
#minhas-atualizacoes {
  max-height: 400px; /* altura limitada */
  overflow-y: auto;
  padding-right: 8px; /* evitar corte da barra */
}
#lista-atualizacoes {
max-width: 1100px;
margin: 0 auto; /* <-- centraliza horizontalmente */
padding:20px; /* opcional, para espaçamento lateral em telas menores */

}
.update-header {
  display: flex;
  align-items: center; /* centraliza verticalmente imagem e texto */
  gap: 12px; /* espaçamento horizontal entre imagem e texto */
}

.update-author-name {
  font-weight: 700;
  font-size: 16px;
  color: #2A307B;
  /* remove margem, se houver */
  margin: 0;
}

/* Responsividade */
@media (max-width: 768px) {
  #aba-atualizacoes {
    max-width: 100%;
    padding: 15px;
  }

  .update-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .update-card .update-img {
    margin-bottom: 10px;
  }

  #minhas-atualizacoes h3 {
    font-size: 1.25rem;
  }
}

/* Estrutura de conteúdo dentro do card */
.update-card .update-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.update-card .update-content .author-name {
  font-weight: 700;
  font-size: 18px;
  color: #2A307B;
  text-align: left;
}
.author-name {
  font-weight: 700;
  font-size: 16px;
  color: #2A307B;
  white-space: nowrap; /* impede quebra de linha */
}
.update-card .update-content p {
  font-size: 16px;
  color: #333;
   margin: 0 0 16px 0;
  text-align: left;
  line-height: 1.4;
}

.update-img {
  width: 100%;
  height: auto;
  max-height: 350px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 20px;
}

/* Responsividade */
/* Responsividade */
@media (max-width: 600px) {
  .update-card {
    max-width: 100%;
    padding: 16px 16px 24px 16px;
  }
  
  .update-avatar {
    width: 40px;
    height: 40px;
  }
  
  .author-name {
    font-size: 14px;
  }
  
  .update-img {
    max-height: 240px;
  }
}



body[data-page="teacher"] #aba-livros.admin-panel {
  background-color: transparent !important;
  box-shadow: none !important;
}

.last-bar {

  min-height: 50px;
  background-color: #eef0f3;
  width: 100%;
}


/* Botões menu em coluna no mobile */

@media (max-width: 535px) {
  .painel-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px; /* Espaço entre os botões */
  }

  .painel-menu button {
    width: 100%;
  }
}

/* REMOVER EMAIL DE USUÁRIO EM CELULAR */
@media (max-width: 474px) {
  .admin-lista table td:nth-child(3),
  .admin-lista table th:nth-child(3) {
    display: none;
  }
}


/* REMOVER EMAIL DE PERMISSÕES */
@media (max-width: 474px) {
  #aba-permissoes table th:nth-child(2),
  #aba-permissoes table td:nth-child(2) {
    display: none;
  }
}






/* PLAY – versão flat com gradiente moderno */
.lesson-card .play-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;

  padding:.7rem 1.2rem;
  min-width:128px;
  border-radius:12px;
  border:none;
  background:linear-gradient(90deg, #0072ff, #00c6ff);
  color:#fff;
  font-weight:700;
  font-size:.92rem;
  letter-spacing:.2px;
  cursor:pointer;

  margin: 0px 0 14px;
  transition:background .2s ease, transform .08s ease, opacity .2s ease;
}

.lesson-card .play-btn:hover{
  background:linear-gradient(90deg, #005ed6, #00a6d6); /* versão mais escura */
}

.lesson-card .play-btn:active{
  transform:scale(.98);
}

.lesson-card .play-btn:focus-visible{
  outline:2px solid rgba(0,114,255,.5);
  outline-offset:2px;
}

.lesson-card .play-btn[disabled]{
  opacity:.55;
  cursor:not-allowed;
}

/* Ícone ▶ opcional */
.lesson-card .play-btn .play-icon{
  width:0; height:0;
  border-left:9px solid currentColor;
  border-top:6px solid transparent;
  border-bottom:6px solid transparent;
  display:inline-block;
}





/* BOOK VIEWER */

.hidden{ display:none !important; }

.book-viewer{
  display:flex; flex-direction:column;
  min-height:60vh; margin:16px 0 24px;
  border-radius:16px; background:#fff;
  border:1px solid rgba(0,0,0,.06);
  box-shadow:0 2px 10px rgba(0,0,0,.04);
}
.book-header{
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; border-bottom:1px solid rgba(0,0,0,.06);
  background:#f8fafc; border-top-left-radius:16px; border-top-right-radius:16px;
}
.book-back{
  appearance:none; border:1px solid rgba(0,0,0,.12);
  background:#fff; color:#111827; padding:.5rem .8rem;
  border-radius:10px; font-weight:600; cursor:pointer;
  transition:transform .06s ease, background .15s ease, border-color .15s ease;
}
.book-back:hover{ background:#f3f4f6; border-color:rgba(0,0,0,.18); }
.book-back:active{ transform:scale(.98); }
.book-title{ font-weight:700; color:#2A307B; font-size:1rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.book-frame{
  width:100%; height:calc(100vh - 190px); min-height:520px; border:0;
  border-bottom-left-radius:16px; border-bottom-right-radius:16px;
}



/* ===== Admin – lista de aulas ===== */
#lista-aulas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

#lista-aulas > li{
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) auto auto auto; /* handle | meta | badge | editar | excluir */
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e6ecf6;
  background: #fff;
  border-radius: 12px;
}

#lista-aulas .handle{
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #cfd8e3; border-radius: 8px; background:#f8fafc;
  cursor: grab; user-select: none;
}

/* meta (título/desc) cresce e quebra certinho */
#lista-aulas .meta{ min-width: 0; line-height: 1.25; }
#lista-aulas .meta strong{ margin-right: 4px; }
#lista-aulas .meta small{ display:block; color:#667085; }

/* badge de status */
#lista-aulas .badge{
  padding: 6px 10px; border-radius: 999px;
  background:#e8f0ff; color:#1e3a8a; font-weight: 700; font-size: 12px;
}

/* Botões compactos (sobrescreve .btn-blue global) */
#lista-aulas .btn-blue,
#lista-aulas .btn-delete{
  display: inline-flex !important;
  align-items: center; justify-content: center;
  width: auto !important;
  min-width: 96px;
  height: 36px;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  font-size: 13px !important; font-weight: 700;
  white-space: nowrap;
}

/* estilo do Excluir, caso não exista */
#lista-aulas .btn-delete{
  background:#ef4444; color:#fff; border:0;
}
#lista-aulas .btn-delete:hover{ filter: brightness(.95); }

/* ===== Responsivo: abaixo de 560px, badge e botões descem ===== */
@media (max-width: 560px){
  #lista-aulas > li{
    grid-template-columns: 32px minmax(0,1fr) auto;  /* handle | meta | (coluna direita) */
    grid-auto-rows: auto;
  }
  #lista-aulas .badge{
    grid-column: 2 / -1; justify-self: start; margin-top: 6px;
  }
  #lista-aulas .btn-blue{
    grid-column: 2 / -1; justify-self: start; margin-top: 8px;
  }
  #lista-aulas .btn-delete{
    grid-column: 2 / -1; justify-self: end;  margin-top: 8px;
  }
}
/* ===== Admin – correção mobile para a playlist ===== */
@media (max-width: 600px){
  #lista-aulas > li{
    grid-template-columns: 28px 1fr !important; /* alça | conteúdo */
    align-items: start;
  }

  /* evita que o texto force o grid a alargar */
  #lista-aulas .meta{ min-width: 0; }

  /* badge vira uma linha abaixo do título */
  #lista-aulas .badge{
    grid-column: 2 / 3 !important;
    justify-self: start;
    margin-top: 6px;
  }

  /* botões na MESMA linha (50/50) e quebram se não couber */
  #lista-aulas .btn-blue,
  #lista-aulas .btn-delete{
    grid-column: 2 / 3 !important;
    display: inline-flex !important;
    width: calc(50% - 6px) !important;   /* 2 por linha */
    min-width: 0 !important;
    margin-top: 8px;
  }

  /* se quiser empilhar 1 por linha, troque a largura para 100%: */
  /* #lista-aulas .btn-blue, #lista-aulas .btn-delete{ width:100% !important; } */
}
/* ===== Modais – uniformizar textarea com inputs ===== */
.modal-content textarea {
  resize: none !important;        /* impede o arrastar/redimensionar */
  width: 100% !important;         /* ocupa a largura total igual ao input */
  height: 40px !important;        /* mesma altura padrão do input */
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;

  
}
.admin-tabs h2{margin-top: 10px;}
