:root {
  --bg-primary: #0a0e27;
  --bg-secondary: #141b3d;
  --bg-card: #1a2349;
  --bg-hover: #232d5a;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #818cf8;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --border: #2d3a5f;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: rgba(0, 0, 0, 0.3);
  --glow: rgba(99, 102, 241, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0a0e27 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Efeito de partículas no fundo */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px var(--glow); }
  50% { box-shadow: 0 0 40px var(--glow), 0 0 60px var(--glow); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Layout Principal */
.container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Barra Lateral Melhorada */
.sidebar {
  width: 280px;
  background: rgba(20, 27, 61, 0.8);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(99, 102, 241, 0.2);
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow-y: auto;
  animation: slideIn 0.5s ease;
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.sidebar-header {
  padding: 35px 25px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  position: relative;
  overflow: hidden;
}

.sidebar-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
}

.sidebar-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.sidebar-header h1::before {
  content: "🎓";
  font-size: 32px;
  animation: pulse 2s ease-in-out infinite;
}

.sidebar-nav {
  padding: 25px 0;
}

.nav-item {
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 15px;
  font-weight: 500;
  position: relative;
  margin: 4px 0;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), transparent);
  transition: width 0.3s ease;
  z-index: -1;
}

.nav-item:hover::before {
  width: 100%;
}

.nav-item:hover {
  color: var(--text-primary);
  border-left-color: var(--accent);
  padding-left: 35px;
  background: rgba(99, 102, 241, 0.1);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), transparent);
  color: var(--accent-light);
  border-left-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.nav-item i {
  font-size: 22px;
  width: 24px;
  text-align: center;
  transition: transform 0.3s ease;
}

.nav-item:hover i {
  transform: scale(1.2) rotate(5deg);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Barra Superior Melhorada */
.topbar {
  background: rgba(20, 27, 61, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  padding: 20px 35px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu-toggle {
  display: none;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 20px var(--glow);
}

.topbar h2 {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 25px;
}

/* Barra de Progresso/Nível Melhorada */
.level-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(26, 35, 73, 0.6);
  backdrop-filter: blur(10px);
  padding: 14px 22px;
  border-radius: 50px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  min-width: 280px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.level-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.3);
  border-color: var(--accent);
}

.level-icon {
  font-size: 28px;
  animation: float 3s ease-in-out infinite;
}

.level-info {
  flex: 1;
}

.level-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.level-number {
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(10, 14, 39, 0.6);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6, var(--accent-light));
  background-size: 200% 100%;
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.6), 0 0 30px rgba(99, 102, 241, 0.3);
  animation: gradientShift 3s ease infinite;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  padding: 10px 18px;
  border-radius: 50px;
  transition: all 0.3s ease;
  background: rgba(26, 35, 73, 0.4);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.user-menu:hover {
  background: rgba(26, 35, 73, 0.8);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  animation: glow 3s ease-in-out infinite;
}

.logout-btn {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  border: none;
  padding: 11px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 14px;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.logout-btn:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(239, 68, 68, 0.5);
}

/* Content Area */
.content {
  flex: 1;
  padding: 35px;
  animation: fadeIn 0.6s ease;
}

/* Stats Cards Melhorados */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
  margin-bottom: 35px;
}

.stat-card {
  background: rgba(26, 35, 73, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.3);
  border-color: var(--accent);
}

.stat-icon {
  width: 70px;
  height: 70px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
  animation: float 4s ease-in-out infinite;
}

.stat-info h3 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--accent-light), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-info p {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Lista de Aulas Melhorada */
.lessons-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 30px;
}

.lesson-item {
  background: rgba(26, 35, 73, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 18px;
  padding: 28px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  animation: fadeIn 0.5s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  position: relative;
  overflow: hidden;
}

.lesson-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), #8b5cf6);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.lesson-item:hover::before {
  transform: scaleY(1);
}

.lesson-item:hover {
  transform: translateX(8px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
  border-color: var(--accent);
  background: rgba(26, 35, 73, 0.8);
}

.lesson-item-content {
  flex: 1;
}

.lesson-item-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}

.lesson-number {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  transition: transform 0.3s ease;
}

.lesson-item:hover .lesson-number {
  transform: scale(1.1) rotate(5deg);
}

.lesson-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.lesson-item:hover .lesson-title {
  background: linear-gradient(135deg, var(--accent-light), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lesson-description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.lesson-meta {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}

.lesson-pages-count,
.lesson-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(10, 14, 39, 0.4);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 500;
}

.lesson-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 25px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.lesson-status.completed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.lesson-status.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

/* Modal de Aula - Visualização Completa */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-primary);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 22px 45px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(20, 27, 61, 0.8);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.modal-title-section {
  flex: 1;
}

.modal-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--accent-light), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-controls {
  display: flex;
  gap: 18px;
  align-items: center;
}

.page-indicator {
  font-size: 14px;
  color: var(--text-secondary);
  background: rgba(26, 35, 73, 0.6);
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.close-modal {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  font-size: 32px;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.close-modal:hover {
  background: var(--danger);
  color: white;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 5px 20px rgba(239, 68, 68, 0.4);
}

.modal-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 45px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

/* Conteúdo da Página */
.lesson-page-content {
  max-width: 1200px;
  width: 100%;
  min-height: min-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 35px;
  animation: fadeIn 0.4s ease;
  padding: 20px 0;
}

.lesson-page-image {
  max-width: 100%;
  max-height: 65vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  object-fit: contain;
  border: 2px solid rgba(99, 102, 241, 0.2);
}

.lesson-page-image:hover {
  transform: scale(1.03);
  box-shadow: 0 20px 60px rgba(99, 102, 241, 0.4);
  border-color: var(--accent);
}

.lesson-page-image.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  z-index: 3000;
  border-radius: 0;
  cursor: zoom-out;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.98);
  padding: 20px;
  border: none;
}

.lesson-page-video {
  max-width: 100%;
  max-height: 65vh;
  width: auto;
  border-radius: 16px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(99, 102, 241, 0.2);
}

.lesson-page-text {
  font-size: 18px;
  line-height: 1.9;
  color: var(--text-primary);
  text-align: center;
  max-width: 850px;
  width: 100%;
  padding: 35px;
  background: rgba(26, 35, 73, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.lesson-page-text-left {
  text-align: left;
}

.lesson-side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 45px;
  width: 100%;
  align-items: start;
  max-width: 1200px;
}

/* Navegação da Aula */
.lesson-navigation {
  padding: 28px 45px;
  border-top: 1px solid rgba(99, 102, 241, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(20, 27, 61, 0.8);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.nav-button {
  padding: 14px 35px;
  border: 2px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  background: rgba(26, 35, 73, 0.6);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 150px;
  justify-content: center;
}

.nav-button:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.nav-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.complete-lesson-btn {
  padding: 14px 45px;
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 6px 25px rgba(16, 185, 129, 0.4);
}

.complete-lesson-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, #059669, #047857);
}

.complete-lesson-btn:disabled {
  background: var(--bg-hover);
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

/* Formulário de Adicionar Aula */
.form-section {
  background: rgba(26, 35, 73, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 18px;
  padding: 35px;
  margin-bottom: 28px;
  animation: fadeIn 0.5s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.form-section h3 {
  font-size: 22px;
  margin-bottom: 25px;
  background: linear-gradient(135deg, var(--accent-light), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  background: rgba(10, 14, 39, 0.6);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  background: rgba(10, 14, 39, 0.8);
}

.form-group textarea {
  min-height: 130px;
  resize: vertical;
}

.form-group input[type="file"] {
  padding: 12px;
  cursor: pointer;
}

.btn {
  padding: 14px 35px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, #8b5cf6, var(--accent));
}

.btn-secondary {
  background: rgba(26, 35, 73, 0.8);
  color: var(--text-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.btn-secondary:hover {
  background: rgba(45, 58, 95, 0.8);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Gestão de Usuários */
.users-table {
  background: rgba(26, 35, 73, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 18px;
  overflow: hidden;
  margin-top: 25px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.users-table table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th {
  background: rgba(10, 14, 39, 0.8);
  padding: 18px 25px;
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-light);
  border-bottom: 2px solid rgba(99, 102, 241, 0.3);
}

.users-table td {
  padding: 18px 25px;
  border-top: 1px solid rgba(45, 58, 95, 0.3);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.users-table tr:hover td {
  background: rgba(35, 45, 90, 0.4);
  color: var(--text-primary);
}

.user-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.user-badge.admin {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
}

.user-badge.student {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
}

/* Botões de Ação */
.btn-action {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-edit {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
}

.btn-edit:hover {
  background: linear-gradient(135deg, #8b5cf6, var(--accent));
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-delete {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
}

.btn-delete:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  padding: 25px;
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.login-box {
  background: rgba(26, 35, 73, 0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 24px;
  padding: 55px;
  width: 100%;
  max-width: 480px;
  animation: fadeIn 0.6s ease;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

.login-box::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6, var(--accent));
  border-radius: 24px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: gradientShift 3s ease infinite;
  background-size: 200% 200%;
}

.login-box:hover::before {
  opacity: 0.3;
}

.login-header {
  text-align: center;
  margin-bottom: 45px;
}

.login-header h1 {
  font-size: 36px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent-light), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  animation: float 3s ease-in-out infinite;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
}

.alert {
  padding: 14px 20px;
  border-radius: 12px;
  margin-bottom: 22px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: var(--success);
}

/* Responsividade */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .lesson-side-by-side {
    grid-template-columns: 1fr;
  }

  .modal-body {
    padding: 30px;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 15px 20px;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .level-bar {
    min-width: auto;
    padding: 10px 15px;
  }

  .user-menu span {
    display: none;
  }

  .content {
    padding: 20px;
  }

  .modal-header {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .modal-controls {
    width: 100%;
    justify-content: space-between;
  }

  .modal-body {
    padding: 20px;
  }

  .lesson-page-text {
    font-size: 16px;
    padding: 20px;
  }

  .lesson-navigation {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
  }

  .nav-button,
  .complete-lesson-btn {
    width: 100%;
  }

  .form-section {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .login-box {
    padding: 35px;
  }

  .lesson-item {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
  }

  .lesson-status {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 100%;
  }

  .topbar-right {
    gap: 10px;
  }

  .logout-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .stat-card {
    flex-direction: column;
    text-align: center;
  }

  .modal-title {
    font-size: 20px;
  }

  .lesson-page-image {
    max-height: 50vh;
  }

  .nav-button {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), #8b5cf6);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8b5cf6, var(--accent));
}

/* Loading */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* Efeitos adicionais */
@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

/* Adicionar glassmorphism em elementos selecionados */
.stat-card,
.lesson-item,
.form-section,
.users-table,
.login-box {
  position: relative;
}

.stat-card::after,
.lesson-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  border-radius: inherit;
  pointer-events: none;
}

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

/* Layout Principal */
.container {
  display: flex;
  min-height: 100vh;
}

/* Barra Lateral */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  transition: transform 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
  animation: slideIn 0.3s ease;
}

.sidebar-header {
  padding: 30px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
}

.sidebar-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header h1::before {
  content: "🎓";
  font-size: 28px;
}

.sidebar-nav {
  padding: 20px 0;
}

.nav-item {
  padding: 15px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 15px;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-left-color: var(--accent);
}

.nav-item.active {
  background: var(--bg-hover);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-item i {
  font-size: 20px;
  width: 20px;
  text-align: center;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Barra Superior */
.topbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
}

.topbar h2 {
  font-size: 22px;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 25px;
}

/* Barra de Progresso/Nível */
.level-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--bg-card);
  padding: 12px 20px;
  border-radius: 50px;
  border: 1px solid var(--border);
  min-width: 250px;
}

.level-icon {
  font-size: 24px;
}

.level-info {
  flex: 1;
}

.level-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.level-number {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 5px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: 10px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  padding: 10px 15px;
  border-radius: 50px;
  transition: background 0.3s;
}

.user-menu:hover {
  background: var(--bg-card);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.logout-btn {
  background: var(--danger);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
  font-size: 14px;
}

.logout-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* Content Area */
.content {
  flex: 1;
  padding: 30px;
  animation: fadeIn 0.5s ease;
}

/* Lista de Aulas */
.lessons-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
}

.lesson-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 25px;
  transition: all 0.3s ease;
  cursor: pointer;
  animation: fadeIn 0.5s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.lesson-item:hover {
  transform: translateX(5px);
  box-shadow: 0 5px 20px var(--shadow);
  border-color: var(--accent);
}

.lesson-item-content {
  flex: 1;
}

.lesson-item-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.lesson-number {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.lesson-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.lesson-description {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.lesson-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.lesson-pages-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
}

.lesson-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.lesson-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  flex-shrink: 0;
}

.lesson-status.completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.lesson-status.pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* Modal de Aula - Visualização Completa */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-primary);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.modal-title-section {
  flex: 1;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 5px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

.page-indicator {
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 32px;
  cursor: pointer;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.close-modal:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow: hidden;
  position: relative;
}

/* Conteúdo da Página */
.lesson-page-content {
  max-width: 1200px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  animation: fadeIn 0.4s ease;
}

.lesson-page-image {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 40px var(--shadow);
  cursor: pointer;
  transition: transform 0.3s;
  object-fit: contain;
}

.lesson-page-image:hover {
  transform: scale(1.02);
}

.lesson-page-image.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  z-index: 3000;
  border-radius: 0;
  cursor: zoom-out;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.98);
  padding: 20px;
}

.lesson-page-video {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  border-radius: 12px;
  box-shadow: 0 10px 40px var(--shadow);
}

.lesson-page-text {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-primary);
  text-align: center;
  max-width: 800px;
  padding: 30px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.lesson-page-text-left {
  text-align: left;
}

.lesson-side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  width: 100%;
  align-items: center;
}

/* Navegação da Aula */
.lesson-navigation {
  padding: 25px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.nav-button {
  padding: 12px 30px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  justify-content: center;
}

.nav-button:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.nav-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.complete-lesson-btn {
  padding: 12px 40px;
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.complete-lesson-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
}

.complete-lesson-btn:disabled {
  background: var(--bg-hover);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Formulário de Adicionar Aula */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 25px;
  animation: fadeIn 0.5s ease;
}

.form-section h3 {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--accent);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.3s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input[type="file"] {
  padding: 10px;
  cursor: pointer;
}

.btn {
  padding: 12px 30px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--border);
}

/* Gestão de Usuários */
.users-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 20px;
}

.users-table table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th {
  background: var(--bg-primary);
  padding: 15px 20px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.users-table td {
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}

.users-table tr:hover td {
  background: var(--bg-hover);
}

.user-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.user-badge.admin {
  background: var(--accent);
  color: white;
}

.user-badge.student {
  background: var(--success);
  color: white;
}

/* Botões de Ação */
.btn-action {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-edit {
  background: var(--accent);
  color: white;
}

.btn-edit:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn-delete {
  background: var(--danger);
  color: white;
}

.btn-delete:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px var(--shadow);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
}

.stat-info h3 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-info p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Login Page */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  padding: 20px;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 50px;
  width: 100%;
  max-width: 450px;
  animation: fadeIn 0.5s ease;
  box-shadow: 0 20px 60px var(--shadow);
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-header h1 {
  font-size: 32px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

/* Responsividade */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .lesson-side-by-side {
    grid-template-columns: 1fr;
  }

  .modal-body {
    padding: 30px;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 15px 20px;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .level-bar {
    min-width: auto;
    padding: 10px 15px;
  }

  .user-menu span {
    display: none;
  }

  .content {
    padding: 20px;
  }

  .modal-header {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }

  .modal-controls {
    width: 100%;
    justify-content: space-between;
  }

  .modal-body {
    padding: 20px;
  }

  .lesson-page-text {
    font-size: 16px;
    padding: 20px;
  }

  .lesson-navigation {
    padding: 15px 20px;
    flex-direction: column;
    gap: 15px;
  }

  .nav-button,
  .complete-lesson-btn {
    width: 100%;
  }

  .form-section {
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .login-box {
    padding: 30px;
  }

  .lesson-item {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
  }

  .lesson-status {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 100%;
  }

  .topbar-right {
    gap: 10px;
  }

  .logout-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .stat-card {
    flex-direction: column;
    text-align: center;
  }

  .modal-title {
    font-size: 20px;
  }

  .lesson-page-image {
    max-height: 50vh;
  }

  .nav-button {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Loading */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}
/* Correção para o Modal Body - evitar corte de conteúdo */
.modal-body {
  flex: 1;
  display: flex;
  align-items: flex-start; /* Mudado de center para flex-start */
  justify-content: center;
  padding: 40px 20px; /* Reduzido padding lateral */
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

/* Correção para o Conteúdo da Página */
.lesson-page-content {
  max-width: 1200px;
  width: 100%;
  min-height: min-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 30px;
  animation: fadeIn 0.4s ease;
  padding: 20px 10px; /* Adicionado padding para evitar corte nas bordas */
  box-sizing: border-box;
}

/* Correção para Imagens - evitar corte */
.lesson-page-image {
  max-width: calc(100% - 40px); /* Garante margem nas laterais */
  max-height: 60vh; /* Reduzido para caber melhor */
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  object-fit: contain;
  border: 2px solid rgba(99, 102, 241, 0.2);
  display: block;
  margin: 0 auto;
}

/* Correção para Vídeos */
.lesson-page-video {
  max-width: calc(100% - 40px);
  max-height: 60vh;
  width: auto;
  border-radius: 16px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(99, 102, 241, 0.2);
  display: block;
  margin: 0 auto;
}

/* Correção para Texto */
.lesson-page-text {
  font-size: 18px;
  line-height: 1.9;
  color: var(--text-primary);
  text-align: center;
  max-width: 850px;
  width: calc(100% - 40px); /* Garante margem nas laterais */
  padding: 30px;
  background: rgba(26, 35, 73, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
  margin: 0 auto;
}

/* Correção para Layout Lado a Lado */
.lesson-side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  width: calc(100% - 40px);
  max-width: 1200px;
  align-items: start;
  box-sizing: border-box;
  margin: 0 auto;
}

/* Responsividade Melhorada para Tablets */
@media (max-width: 1024px) {
  .modal-body {
    padding: 30px 15px;
  }
  
  .lesson-page-content {
    padding: 15px 10px;
    gap: 25px;
  }
  
  .lesson-page-image,
  .lesson-page-video {
    max-height: 50vh;
    max-width: calc(100% - 30px);
  }

  .lesson-page-text {
    width: calc(100% - 30px);
    padding: 25px;
  }

  .lesson-side-by-side {
    grid-template-columns: 1fr;
    width: calc(100% - 30px);
  }
}

/* Responsividade para Smartphones */
@media (max-width: 768px) {
  .modal-body {
    padding: 20px 10px;
  }
  
  .lesson-page-content {
    padding: 15px 5px;
    gap: 20px;
  }

  .lesson-page-image,
  .lesson-page-video {
    max-height: 45vh;
    max-width: calc(100% - 20px);
    border-radius: 12px;
  }

  .lesson-page-text {
    font-size: 16px;
    padding: 20px;
    width: calc(100% - 20px);
    border-radius: 12px;
  }

  .lesson-side-by-side {
    gap: 20px;
    width: calc(100% - 20px);
  }

  /* Ajuste do Header do Modal */
  .modal-header {
    padding: 15px;
    flex-wrap: wrap;
  }

  .modal-title {
    font-size: 20px;
  }

  /* Ajuste da Navegação */
  .lesson-navigation {
    padding: 15px;
    gap: 10px;
  }
}

/* Responsividade para Telas Pequenas */
@media (max-width: 480px) {
  .modal-body {
    padding: 15px 5px;
  }
  
  .lesson-page-content {
    padding: 10px 5px;
  }

  .lesson-page-image,
  .lesson-page-video {
    max-height: 40vh;
    max-width: calc(100% - 10px);
  }

  .lesson-page-text {
    font-size: 15px;
    padding: 15px;
    width: calc(100% - 10px);
  }

  .lesson-side-by-side {
    width: calc(100% - 10px);
    gap: 15px;
  }
}

/* Correção para Fullscreen */
.lesson-page-image.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  z-index: 3000;
  border-radius: 0;
  cursor: zoom-out;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.98);
  padding: 20px;
  border: none;
  margin: 0;
  box-sizing: border-box;
}