/**
 * ====================================================================
 * ESTILOS RESPONSIVOS PARA MOBILE E TABLETS (RESPONSIVE.CSS)
 * ====================================================================
 */

/* Botão hambúrguer no mobile */
.btn-mobile-menu {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 320px;
  }

  .main-content {
    padding: 20px;
  }

  .header-center .global-progress-bar-container {
    width: 90px;
  }
}

@media (max-width: 860px) {
  .btn-mobile-menu {
    display: flex;
  }

  .btn-sidebar-toggle {
    display: none;
  }

  .header-center {
    display: none; /* No mobile, o progresso pode ficar no topo da lista */
  }

  .user-profile-badge span {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Sidebar como gaveta (drawer) no mobile */
  .sidebar {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: 320px;
    transform: translateX(100%);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
    z-index: 150;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* Backdrop quando sidebar está aberta no mobile */
  body.sidebar-open::after {
    content: "";
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 140;
  }

  .main-content {
    padding: 16px;
  }

  .lesson-action-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .action-bar-left,
  .action-bar-right {
    width: 100%;
    justify-content: space-between;
  }

  .btn-complete {
    flex: 1;
    justify-content: center;
  }

  .btn-nav-lesson {
    flex: 1;
    justify-content: center;
  }

  .lesson-header-title {
    font-size: 1.2rem;
  }

  .attachments-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 0 14px;
  }

  .brand-text h1 {
    font-size: 0.95rem;
  }

  .user-profile-badge {
    padding: 4px 8px;
  }

  .user-profile-badge span {
    display: none;
  }

  .modal-content {
    padding: 24px 18px;
  }

  .certificate-sheet {
    padding: 20px;
  }

  .cert-title {
    font-size: 1.5rem;
  }

  .cert-name {
    font-size: 1.3rem;
  }

  .cert-footer-grid {
    flex-direction: column;
    gap: 16px;
    align-items: center;
    text-align: center;
  }
}

/* Modo de Impressão (Certificado) */
@media print {
  body * {
    visibility: hidden;
  }
  .modal-overlay,
  .cert-modal-content,
  .certificate-sheet,
  .certificate-sheet * {
    visibility: visible;
  }
  .modal-overlay {
    position: absolute;
    left: 0;
    top: 0;
    background: transparent;
    padding: 0;
  }
  .cert-modal-content {
    box-shadow: none;
    max-width: 100%;
  }
  .cert-actions,
  .modal-close-btn {
    display: none !important;
  }
}
