/* =========================================================================
   MESTRE DAS BATIDAS - ESTILOS MOBILE-FIRST (ÁREA DE MEMBROS)
   Desenvolvido com foco prioritário na experiência do aluno em celulares
   ========================================================================= */

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #131b2e;
  --bg-card: #182238;
  --bg-card-hover: #1f2c49;
  --accent-gold: #f59e0b;
  --accent-neon: #ff007a;
  --accent-cocktail: #ff6b35;
  --accent-gradient: linear-gradient(135deg, #ff6b35 0%, #e11d48 100%);
  --accent-glow: rgba(255, 107, 53, 0.25);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #ff6b35;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --bottom-nav-height: 64px;
}

/* RESET E BASE MOBILE-FIRST */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

/* =========================================================================
   1. NAVBAR / CABEÇALHO MOBILE-FIRST
   ========================================================================= */
.navbar {
  background: rgba(19, 27, 46, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 200;
  width: 100%;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  letter-spacing: 0.3px;
  font-weight: 700;
  white-space: nowrap;
}

.logo-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px rgba(255, 107, 53, 0.6));
}

.logo-text strong {
  color: var(--accent-cocktail);
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

.avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.greeting {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.greeting strong {
  color: var(--text-main);
  max-width: 110px;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
  min-height: 36px;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

/* =========================================================================
   2. BARRA DE ABAS PRINCIPAL (SEGMENTED CONTROL NO TOPO)
   ========================================================================= */
.tabs-bar-wrapper {
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 56px;
  z-index: 150;
  padding: 8px 14px;
  width: 100%;
}

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

.tabs-nav {
  display: flex;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 6px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 44px;
}

.tab-btn .tab-icon {
  font-size: 1.15rem;
}

.tab-btn .tab-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 800;
  color: #fff;
}

.tab-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.4);
}

.tab-btn.active .tab-badge {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.tab-btn:not(.active):hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* =========================================================================
   3. CONTAINER PRINCIPAL E CONTROLE DE PAINÉIS (TABS)
   ========================================================================= */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 14px calc(var(--bottom-nav-height) + 24px) 14px;
  flex: 1;
  width: 100%;
}

.tab-pane {
  display: block;
  animation: fadeInTab 0.25s ease-out;
}

.tab-pane.hidden {
  display: none !important;
}

@keyframes fadeInTab {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* HERO WELCOME */
.hero-welcome {
  margin-bottom: 18px;
}

.badge-tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255, 107, 53, 0.15);
  border: 1px solid rgba(255, 107, 53, 0.3);
  color: var(--accent-cocktail);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}

.hero-welcome h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.25;
  background: linear-gradient(135deg, #fff 40%, #ff9e75 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-welcome p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

/* =========================================================================
   4. ABA DE VIDEOAULAS (PLAYER + PLAYLIST MOBILE-FIRST)
   ========================================================================= */
.classroom-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 32px;
}

.player-column {
  width: 100%;
}

.video-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.video-element {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
  outline: none;
  display: block;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
  border: 1px solid var(--border-color);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-shield-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55px;
  z-index: 10;
  background: transparent;
  pointer-events: auto;
}

.video-shield-bottom {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 80px;
  height: 44px;
  z-index: 10;
  background: transparent;
  pointer-events: auto;
}

.lesson-meta {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-top: 12px;
  border: 1px solid var(--border-color);
}

.lesson-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.lesson-category {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-cocktail);
  letter-spacing: 0.5px;
}

.lesson-status {
  font-size: 0.7rem;
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.lesson-meta h2 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text-main);
}

.lesson-meta p {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.lesson-quick-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.btn-quick-pdf {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.35);
  color: #ff9e75;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 46px;
}

.btn-quick-pdf:active {
  background: var(--accent-cocktail);
  color: #fff;
  transform: scale(0.98);
}

/* PLAYLIST DE AULAS */
.playlist-column {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.playlist-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.lesson-count {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 600;
}

.playlist-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.playlist-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fbbf24;
  padding: 12px 4px 4px;
  border-top: 1px solid rgba(251, 191, 36, 0.2);
  margin-top: 4px;
}

.playlist-card.bonus-card {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.05);
}

.playlist-card.bonus-card:hover {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
}

.playlist-card {
  display: flex;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  width: 100%;
  min-height: 60px;
}

.playlist-card:active {
  transform: scale(0.99);
}

.playlist-card.active {
  background: rgba(255, 107, 53, 0.14);
  border-color: var(--accent-cocktail);
}

.card-thumb {
  position: relative;
  width: 84px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #000;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #fff;
}

.placeholder-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.04);
}

.card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.card-info h4 {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 3px;
  white-space: normal;
}

.card-info span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.playlist-card.pending {
  opacity: 0.55;
  cursor: not-allowed;
}

/* =========================================================================
   5. ABA DE APOSTILAS & PDFs (BIBLIOTECA DEDICADA)
   ========================================================================= */
.materials-section {
  width: 100%;
}

.section-header {
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.25;
  color: #fff;
}

.section-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 14px;
}

/* PÍLULAS DE FILTRAGEM TOUCH-FRIENDLY */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.pill-btn {
  white-space: nowrap;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 38px;
  flex-shrink: 0;
}

.pill-btn.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(255, 107, 53, 0.35);
}

.category-divider {
  margin: 24px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.category-divider h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-group.hidden {
  display: none !important;
}

/* GRID DE CARDS EM PDF */
.pdf-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

.pdf-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
  transition: border-color 0.2s;
  width: 100%;
}

.pdf-card.hidden {
  display: none !important;
}

.pdf-cover-wrap {
  perspective: 600px;
  flex-shrink: 0;
  margin: 0 auto;
}

.pdf-3d-book {
  width: 110px;
  height: 150px;
  border-radius: 3px 8px 8px 3px;
  position: relative;
  box-shadow: 6px 8px 16px rgba(0, 0, 0, 0.6);
  transform: rotateY(-10deg);
  display: flex;
  flex-direction: column;
  padding: 10px;
  justify-content: space-between;
  border-left: 3px solid rgba(255, 255, 255, 0.8);
}

.book-tag {
  font-size: 0.52rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 5px;
  border-radius: 3px;
  display: inline-block;
  color: #fff;
  letter-spacing: 0.5px;
}

.book-cover h3 {
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  margin-top: 4px;
}

.book-cover p {
  font-size: 0.52rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
}

.book-glass {
  font-size: 1.5rem;
  text-align: right;
}

/* VARIANTES DE COR DOS E-BOOKS */
.book-variant-cocktail { background: linear-gradient(135deg, #e11d48, #ff6b35); }
.book-variant-neon     { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.book-variant-gold     { background: linear-gradient(135deg, #d97706, #fbbf24); }
.book-variant-red      { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.book-variant-purple   { background: linear-gradient(135deg, #581c87, #a855f7); }
.book-variant-green    { background: linear-gradient(135deg, #047857, #10b981); }
.book-variant-blue     { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.book-variant-teal     { background: linear-gradient(135deg, #0f766e, #14b8a6); }

.pdf-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.badge-file {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-cocktail);
  margin-bottom: 4px;
  background: rgba(255, 107, 53, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
}

.pdf-details h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
  color: #fff;
}

.pdf-details p {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin-bottom: 14px;
  max-width: 480px;
}

/* BOTÃO DE DOWNLOAD FULL WIDTH NO CELULAR */
.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-gradient);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.35);
  transition: all 0.2s;
  width: 100%;
  min-height: 48px;
}

.btn-download:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.5);
}

/* =========================================================================
   6. BARRA DE NAVEGAÇÃO INFERIOR PARA CELULAR (BOTTOM APP BAR)
   ========================================================================= */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(19, 27, 46, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 500;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.bnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 0;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  min-height: 52px;
}

.bnav-icon {
  font-size: 1.35rem;
  transition: transform 0.2s;
}

.bnav-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.bnav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 20px);
  background: var(--accent-cocktail);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.bnav-btn.active {
  color: var(--accent-cocktail);
}

.bnav-btn.active .bnav-icon {
  transform: scale(1.15);
}

/* =========================================================================
   7. TELAS DE LOGIN & CADASTRO (MOBILE-FIRST)
   ========================================================================= */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at top center, #1e293b 0%, #0b0f19 80%);
  padding: 16px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  padding: 28px 20px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 24px var(--accent-glow);
}

.auth-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 12px var(--accent-cocktail));
}

.auth-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 16px; /* CRÍTICO: Previne o zoom indesejado no Safari do iOS */
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 48px;
}

.form-group input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.35);
  margin-top: 6px;
  min-height: 48px;
  width: 100%;
}

.btn-primary:active {
  transform: scale(0.98);
}

.auth-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.auth-footer a {
  color: var(--accent-cocktail);
  text-decoration: none;
  font-weight: 600;
  padding: 4px;
}

.alert-box {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
}

.alert-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-box.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.hidden {
  display: none !important;
}

/* FOOTER */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 32px;
}

/* =========================================================================
   8. MEDIA QUERIES PROGRESSIVAS (TABLETS & DESKTOP)
   ========================================================================= */

/* Tablets em diante (>= 640px) */
@media (min-width: 640px) {
  html {
    font-size: 16px;
  }

  .nav-container {
    padding: 14px 20px;
  }

  .hero-welcome h1 {
    font-size: 1.75rem;
  }

  .pdf-grid {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  }

  .pdf-card {
    padding: 20px;
  }
}

/* Tablets Paisagem e Desktop Médio (>= 768px) */
@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none; /* Esconde a barra inferior em tablets/desktop */
  }

  .main-content {
    padding-bottom: 40px;
  }

  .pdf-card {
    flex-direction: row;
    text-align: left;
    align-items: center;
    gap: 20px;
  }

  .pdf-details {
    align-items: flex-start;
  }

  .btn-download {
    width: fit-content;
  }
}

/* Telas Grandes / Desktop Completo (>= 992px) */
@media (min-width: 992px) {
  .nav-container {
    padding: 16px 24px;
  }

  .logo {
    font-size: 1.15rem;
  }

  .logo-icon {
    font-size: 1.6rem;
  }

  .greeting strong {
    max-width: 200px;
  }

  .tabs-bar-wrapper {
    top: 64px;
    padding: 12px 24px;
  }

  .tab-btn {
    font-size: 0.95rem;
    padding: 12px 18px;
  }

  .main-content {
    padding: 28px 24px 56px 24px;
  }

  .hero-welcome h1 {
    font-size: 2.1rem;
  }

  .hero-welcome p {
    font-size: 1rem;
  }

  .classroom-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
  }

  .playlist-column {
    height: fit-content;
  }

  .lesson-meta {
    padding: 22px;
  }

  .lesson-meta h2 {
    font-size: 1.35rem;
  }

  .pdf-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}


/* =========================================================================
   PAINEL ADMINISTRATIVO (ADMIN DASHBOARD)
   ========================================================================= */

.btn-nav-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-nav-admin:hover {
  background: #f59e0b;
  color: #000;
}

.btn-back-portal {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-back-portal:hover {
  background: rgba(255, 255, 255, 0.15);
}

.admin-header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.btn-add-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
}

/* KPI GRID */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.kpi-share-card {
  grid-column: span 1;
}

@media (min-width: 900px) {
  .kpi-share-card {
    grid-column: span 2;
  }
}

.kpi-icon {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.05);
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.share-link-row {
  display: flex;
  gap: 8px;
  margin: 6px 0 4px;
}

.share-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: #86efac;
  font-family: monospace;
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  flex: 1;
  outline: none;
}

.btn-copy-link {
  background: var(--accent-cocktail);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-copy-link:hover {
  background: #ff8353;
}

/* TABELA DE ALUNOS */
.admin-table-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-toolbar {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  width: 100%;
  max-width: 380px;
}

.admin-search-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}

.users-count-tag {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

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

.user-avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b35, #e11d48);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.role-admin {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.role-student {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

.date-cell {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.actions-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-action {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.btn-key {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.btn-key:hover {
  background: #f59e0b;
  color: #000;
}

.btn-trash {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-trash:hover {
  background: #ef4444;
  color: #fff;
}

.self-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* MODAIS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 28px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.form-checkbox {
  margin-top: 14px;
}

.form-checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-muted);
}

.form-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}


/* =========================================================================
   PLAYER CUSTOMIZADO BLINDADO (SEM MARCA OU BOTÕES DO YOUTUBE)
   ========================================================================= */

.custom-player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 24px var(--accent-glow);
  border: 1px solid var(--border-color);
}

/* Alvo do iframe do YouTube deslocado para cima para eliminar 100% do título e avatar */
#yt-player-target,
.custom-player-wrapper iframe {
  position: absolute;
  top: -14%;
  left: 0;
  width: 100%;
  height: 128%;
  border: none;
  display: block;
  pointer-events: none;
}

.custom-player-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  object-fit: contain;
}

/* Capa/Poster que cobre o iframe antes do play para ocultar 100% o botão vermelho do YouTube */
.video-poster-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 12;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.video-poster-cover.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Escudo superior com máscara degradê que oculta qualquer resquício de cabeçalho */
.video-shield-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  z-index: 15;
  background: linear-gradient(180deg, rgba(11, 15, 25, 0.98) 0%, rgba(11, 15, 25, 0.6) 60%, transparent 100%);
  pointer-events: auto;
}

/* Overlay central transparente para clique play/pause */
.video-click-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 56px; /* Deixa a barra de controle livre */
  z-index: 20;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.big-center-play-btn {
  width: 72px;
  height: 72px;
  background: rgba(255, 107, 53, 0.9);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  padding-left: 5px;
  box-shadow: 0 0 30px rgba(255, 107, 53, 0.6);
  transition: transform 0.2s, background 0.2s;
  pointer-events: none;
}

.video-click-overlay:hover .big-center-play-btn {
  transform: scale(1.1);
  background: #ff6b35;
}

/* Barra de Controles Exclusiva (Reprodução e Volume) */
.custom-player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: linear-gradient(to top, rgba(11, 15, 25, 0.96) 60%, rgba(11, 15, 25, 0));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 30;
  transition: opacity 0.3s;
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, color 0.15s;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.ctrl-btn:hover {
  transform: scale(1.15);
  color: var(--accent-cocktail);
}

.ctrl-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Barra de Progresso / Linha do Tempo */
.ctrl-timeline-wrap {
  position: relative;
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  cursor: pointer;
  transition: height 0.15s;
}

.ctrl-timeline-wrap:hover {
  height: 10px;
}

.ctrl-buffered-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
}

.ctrl-played-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff6b35, #ff007a);
  border-radius: 999px;
}

.ctrl-scrubber-dot {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Volume */
.ctrl-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ctrl-volume-slider {
  width: 70px;
  height: 5px;
  accent-color: var(--accent-cocktail);
  cursor: pointer;
}

@media (max-width: 600px) {
  .ctrl-volume-slider {
    width: 45px;
  }
  .ctrl-time {
    font-size: 0.72rem;
  }
}
