/* ============================================
   Simulados - Sistema de Provas Cronometradas
   EntroPlataforma
   ============================================ */

/* ---- Listagem de Simulados ---- */
.simulados-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 90px 24px 40px;
}

.simulados-header {
  margin-bottom: 32px;
}

.simulados-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 12px;
}

.simulados-header h1 i {
  color: var(--primary);
  font-size: 32px;
}

.simulados-header p {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 15px;
}

.simulados-grid {
  display: grid;
  gap: 20px;
}

/* Card de simulado na listagem */
.simulado-card {
  background: var(--bg-surface);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: var(--radius-md, 12px);
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.simulado-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.08);
}

.simulado-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.simulado-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
}

.simulado-card-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.simulado-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.simulado-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.simulado-meta-item i {
  color: var(--primary);
  font-size: 15px;
}

.simulado-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Badges de status */
.simulado-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-ativo {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.badge-encerrado {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
}

.badge-aguardando {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.badge-em-andamento {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

/* Botoes na listagem */
.btn-simulado {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-simulado-iniciar {
  background: var(--primary);
  color: white;
}

.btn-simulado-iniciar:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-simulado-continuar {
  background: #3b82f6;
  color: white;
}

.btn-simulado-continuar:hover {
  background: #2563eb;
}

.btn-simulado-resultado {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-simulado-resultado:hover {
  background: rgba(16, 185, 129, 0.2);
}

/* Estado vazio */
.simulados-empty {
  text-align: center;
  padding: 80px 20px;
}

.simulados-empty i {
  font-size: 48px;
  color: var(--text-muted);
  opacity: 0.4;
}

.simulados-empty p {
  color: var(--text-muted);
  margin-top: 16px;
  font-size: 15px;
}

/* ============================================
   Card de Participacao Presencial
   ============================================ */

.participacao-card {
  background: var(--bg-surface);
  border: 2px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md, 12px);
  padding: 32px;
  margin-bottom: 28px;
  text-align: center;
}

.participacao-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.participacao-icon i {
  font-size: 26px;
  color: var(--primary);
}

.participacao-titulo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.participacao-info {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.participacao-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.participacao-info-item i {
  color: var(--primary);
  font-size: 16px;
}

.participacao-info-item strong {
  color: var(--text-dark);
}

.participacao-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.participacao-btns {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.participacao-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.participacao-btn-sim {
  background: var(--primary);
  color: white;
}

.participacao-btn-sim:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.participacao-btn-nao {
  background: transparent;
  color: var(--text-muted);
  border-color: rgba(100, 116, 139, 0.25);
}

.participacao-btn-nao:hover {
  border-color: rgba(100, 116, 139, 0.5);
  color: var(--text-dark);
}

/* Escolha de local */
.participacao-locais {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.participacao-local-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 32px;
  border-radius: 12px;
  font-family: inherit;
  background: var(--bg-surface);
  border: 2px solid rgba(16, 185, 129, 0.15);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 200px;
}

.participacao-local-btn i {
  font-size: 28px;
  color: var(--primary);
}

.participacao-local-nome {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.participacao-local-btn:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.12);
}

/* Escolha de tipo de simulado */
.participacao-tipos {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.participacao-tipo-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 28px;
  border-radius: 12px;
  font-family: inherit;
  background: var(--bg-surface);
  border: 2px solid rgba(16, 185, 129, 0.15);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 130px;
}

.participacao-tipo-btn i {
  font-size: 26px;
  color: var(--primary);
}

.participacao-tipo-nome {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.participacao-tipo-btn:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.12);
}

.participacao-voltar {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.participacao-voltar:hover {
  color: var(--text-dark);
}

/* Estado confirmado */
.participacao-check {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.participacao-check i {
  font-size: 28px;
  color: #059669;
}

.participacao-check-muted {
  background: rgba(100, 116, 139, 0.1);
}

.participacao-check-muted i {
  color: #64748b;
}

.participacao-confirmado-texto {
  font-size: 15px;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.participacao-alterar {
  background: none;
  border: 1px solid rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.participacao-alterar:hover {
  border-color: rgba(100, 116, 139, 0.4);
  color: var(--text-dark);
}

@media (max-width: 600px) {
  .participacao-card {
    padding: 24px 16px;
  }
  .participacao-info {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  .participacao-locais {
    flex-direction: column;
    align-items: center;
  }
  .participacao-local-btn {
    min-width: 100%;
  }
  .participacao-tipos {
    flex-direction: column;
    align-items: center;
  }
  .participacao-tipo-btn {
    min-width: 100%;
  }
}

/* ============================================
   Pagina da Prova (simulado.html)
   ============================================ */

/* Layout principal da prova */
.prova-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 60px;
}

/* Barra superior fixa da prova */
.prova-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-surface);
  border-bottom: 2px solid rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.prova-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.prova-topbar-logo {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.prova-topbar-titulo {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prova-topbar-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Timer */
.prova-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-dark);
  padding: 6px 16px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.prova-timer i {
  color: var(--primary);
  font-size: 18px;
}

.prova-timer.urgente {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #dc2626;
  animation: pulse-timer 1s ease-in-out infinite;
}

.prova-timer.urgente i {
  color: #dc2626;
}

@keyframes pulse-timer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.prova-progresso-texto {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.prova-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-finalizar-prova {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-finalizar-prova:hover {
  background: #dc2626;
}

/* Sidebar lateral - Mapa de questoes */
.prova-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid rgba(16, 185, 129, 0.12);
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 16px;
  z-index: 50;
}

.prova-sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.mapa-grupo {
  margin-bottom: 16px;
}

.mapa-grupo-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mapa-questoes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mapa-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1.5px solid rgba(16, 185, 129, 0.2);
  background: var(--bg-surface);
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.mapa-btn:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.mapa-btn.respondida {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.mapa-btn.atual {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
}

.mapa-btn.respondida.atual {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  color: white;
}

/* Area principal da questao */
.prova-main {
  flex: 1;
  margin-left: 260px;
  padding: 24px 32px 100px;
  max-width: 860px;
}

.prova-questao-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.prova-questao-numero {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(16, 185, 129, 0.08);
  padding: 6px 14px;
  border-radius: 20px;
}

.prova-questao-materia {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Questao - conteudo */
.prova-questao-conteudo {
  background: var(--bg-surface);
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-md, 12px);
  padding: 28px;
}

.prova-questao-conteudo .questao-texto-base {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.prova-questao-conteudo .questao-enunciado {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-dark);
  margin-bottom: 24px;
}

/* Alternativas na prova (sem feedback) */
.prova-alternativas {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prova-alt-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1.5px solid rgba(16, 185, 129, 0.15);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  font-family: inherit;
  width: 100%;
}

.prova-alt-btn:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.04);
}

.prova-alt-btn.selecionada {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.prova-alt-letra {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.prova-alt-btn.selecionada .prova-alt-letra {
  background: var(--primary);
  color: white;
}

.prova-alt-texto {
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dark);
  padding-top: 4px;
}

/* Navegacao entre questoes */
.prova-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  gap: 16px;
}

.prova-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.prova-nav-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.prova-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   Resultado do Simulado
   ============================================ */

.resultado-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 90px 24px 40px;
}

.resultado-header {
  text-align: center;
  margin-bottom: 40px;
}

.resultado-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.resultado-header p {
  color: var(--text-muted);
  font-size: 15px;
}

/* Resumo geral */
.resultado-resumo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.resultado-stat {
  background: var(--bg-surface);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.resultado-stat-valor {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.resultado-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Desempenho por materia */
.resultado-materias {
  background: var(--bg-surface);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}

.resultado-materias h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.resultado-materias h3 i {
  color: var(--primary);
}

.resultado-materia-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(16, 185, 129, 0.06);
}

.resultado-materia-row:last-child {
  border-bottom: none;
}

.resultado-materia-nome {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 14px;
  flex: 1;
}

.resultado-materia-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.resultado-materia-acertos {
  font-size: 14px;
  color: var(--text-muted);
}

.resultado-materia-pct {
  font-size: 14px;
  font-weight: 700;
  min-width: 45px;
  text-align: right;
}

.resultado-materia-bar {
  width: 100px;
  height: 8px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.resultado-materia-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Questoes no resultado */
.resultado-questoes {
  margin-top: 32px;
}

.resultado-questoes h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.resultado-questoes h3 i {
  color: var(--primary);
}

.resultado-questao-item {
  background: var(--bg-surface);
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.resultado-questao-item.errou {
  border-left: 4px solid #ef4444;
}

.resultado-questao-item.acertou {
  border-left: 4px solid var(--primary);
}

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

.resultado-q-num {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dark);
}

.resultado-q-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.resultado-q-status.acertou {
  color: #059669;
}

.resultado-q-status.errou {
  color: #dc2626;
}

.resultado-q-respostas {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.resultado-q-resolucao {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.1);
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.resultado-q-resolucao-label {
  font-weight: 700;
  color: var(--primary);
  font-size: 13px;
  margin-bottom: 8px;
}

/* Tela de espera (resultado nao liberado) */
.resultado-espera {
  text-align: center;
  padding: 80px 20px;
}

.resultado-espera i {
  font-size: 64px;
  color: #f59e0b;
  margin-bottom: 20px;
}

.resultado-espera h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.resultado-espera p {
  color: var(--text-muted);
  font-size: 15px;
}

/* ============================================
   Modal de confirmacao
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 32px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.modal-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btn-cancel {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-dark);
}

.modal-btn-cancel:hover {
  background: rgba(100, 116, 139, 0.2);
}

.modal-btn-confirm {
  background: var(--primary);
  color: white;
}

.modal-btn-confirm:hover {
  background: #059669;
}

.modal-btn-danger {
  background: #ef4444;
  color: white;
}

.modal-btn-danger:hover {
  background: #dc2626;
}

/* ============================================
   Loading state
   ============================================ */

.simulado-loading {
  text-align: center;
  padding: 80px 20px;
}

.simulado-loading i {
  font-size: 32px;
  color: var(--primary);
  animation: spin 1s linear infinite;
}

.simulado-loading p {
  color: var(--text-muted);
  margin-top: 12px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================
   Botao toggle sidebar mobile
   ============================================ */

.prova-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* ============================================
   Admin - Tab Simulados
   ============================================ */

.admin-simulados-list {
  margin-top: 20px;
}

.admin-simulados-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.admin-simulados-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-simulados-header h3 i {
  color: var(--primary);
}

.btn-criar-simulado {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-criar-simulado:hover {
  background: #059669;
}

.admin-sim-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-sim-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(16, 185, 129, 0.1);
}

.admin-sim-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-dark);
  border-bottom: 1px solid rgba(16, 185, 129, 0.06);
}

.admin-sim-table tr:hover td {
  background: rgba(16, 185, 129, 0.03);
}

.admin-sim-acoes {
  display: flex;
  gap: 8px;
}

.admin-sim-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.2);
  background: var(--bg-surface);
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.15s;
}

.admin-sim-btn:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.admin-sim-btn-danger {
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.admin-sim-btn-danger:hover {
  background: rgba(239, 68, 68, 0.05);
}

/* Admin form simulado */
.admin-sim-form {
  background: var(--bg-surface);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 12px;
  padding: 24px;
}

.admin-sim-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-sim-form-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}

.admin-sim-field {
  margin-bottom: 20px;
}

.admin-sim-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.admin-sim-field input,
.admin-sim-field textarea,
.admin-sim-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dark);
  transition: border-color 0.2s;
}

.admin-sim-field input:focus,
.admin-sim-field textarea:focus,
.admin-sim-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.admin-sim-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* Slider de tempo */
.tempo-slider-container {
  margin-top: 8px;
}

.tempo-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tempo-preset-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid rgba(16, 185, 129, 0.2);
  background: var(--bg-surface);
  color: var(--text-dark);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tempo-preset-btn:hover,
.tempo-preset-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.tempo-custom-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tempo-custom-row input[type="number"] {
  width: 100px;
}

.tempo-custom-row span {
  font-size: 14px;
  color: var(--text-muted);
}

/* Seletor de questoes no admin */
.questao-selector {
  margin-top: 24px;
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 12px;
  padding: 20px;
}

.questao-selector h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.questao-selector h4 i {
  color: var(--primary);
}

.qs-filtros {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.qs-filtros select {
  padding: 8px 12px;
  border: 1.5px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-dark);
}

.qs-ids-input {
  margin-bottom: 16px;
}

.qs-ids-input textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  background: var(--bg-surface);
  font-family: inherit;
  font-size: 13px;
  color: var(--text-dark);
  resize: vertical;
  min-height: 60px;
}

.qs-buscar-btn {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
}

.qs-resultados {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid rgba(16, 185, 129, 0.08);
  border-radius: 8px;
}

.qs-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(16, 185, 129, 0.06);
  cursor: pointer;
  transition: background 0.1s;
}

.qs-item:hover {
  background: rgba(16, 185, 129, 0.03);
}

.qs-item input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--primary);
}

.qs-item-info {
  flex: 1;
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.5;
}

.qs-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Questoes selecionadas */
.qs-selecionadas {
  margin-top: 20px;
}

.qs-selecionadas h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.qs-sel-grupo {
  margin-bottom: 12px;
}

.qs-sel-grupo-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.qs-sel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.04);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}

.qs-sel-item .qs-sel-num {
  font-weight: 700;
  color: var(--primary);
  min-width: 24px;
}

.qs-sel-item .qs-sel-text {
  flex: 1;
  color: var(--text-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qs-sel-item .qs-sel-remove {
  color: #ef4444;
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
  border: none;
  background: none;
}

/* Form actions */
.admin-sim-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: flex-end;
}

.admin-sim-form-actions .btn-simulado {
  padding: 10px 24px;
}

/* Admin participantes */
.admin-participantes-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.admin-participantes-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 2px solid rgba(16, 185, 129, 0.1);
}

.admin-participantes-table td {
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-dark);
  border-bottom: 1px solid rgba(16, 185, 129, 0.06);
}

/* ============================================
   Responsivo
   ============================================ */

@media (max-width: 768px) {
  .simulados-container {
    padding: 80px 16px 32px;
  }

  .simulados-header h1 {
    font-size: 22px;
  }

  .simulado-card {
    padding: 18px;
  }

  /* Prova mobile */
  .prova-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 150;
    width: 280px;
  }

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

  .prova-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .prova-main {
    margin-left: 0;
    padding: 16px 16px 100px;
  }

  .prova-topbar {
    padding: 0 12px;
  }

  .prova-topbar-titulo {
    display: none;
  }

  .prova-timer {
    font-size: 16px;
    padding: 4px 12px;
  }

  .btn-finalizar-prova span {
    display: none;
  }

  /* Resultado mobile */
  .resultado-container {
    padding: 80px 16px 32px;
  }

  .resultado-resumo {
    grid-template-columns: repeat(2, 1fr);
  }

  .resultado-materia-bar {
    width: 60px;
  }

  /* Admin mobile */
  .qs-filtros {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .resultado-resumo {
    grid-template-columns: 1fr 1fr;
  }

  .simulado-card-meta {
    flex-direction: column;
    gap: 8px;
  }

  .prova-timer {
    font-size: 14px;
  }
}

/* ---- Gate de Acesso Restrito ---- */
.simulados-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-page, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
}

.simulados-gate-card {
  background: var(--bg-surface, #fff);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.simulados-gate-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.simulados-gate-card p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.gate-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  text-align: center;
  letter-spacing: 3px;
  background: var(--bg-page, #f8fafc);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.gate-input:focus {
  border-color: var(--primary, #10b981);
}

.gate-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: var(--primary, #10b981);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s;
}

.gate-btn:hover { opacity: 0.9; }

.gate-erro {
  color: #ef4444 !important;
  font-size: 13px !important;
  margin-top: 12px !important;
  margin-bottom: 0 !important;
}

.gate-input.error {
  border-color: #ef4444;
  animation: gate-shake 0.3s;
}

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---- Overlay Finalizando ---- */
#overlay-finalizando {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.overlay-finalizando-content {
  text-align: center;
  color: #fff;
  font-size: 18px;
}
.overlay-finalizando-sub {
  font-size: 14px;
  opacity: 0.7;
  margin-top: 8px;
}
.spinner-finalizando {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin-finalizar 0.8s linear infinite;
}
@keyframes spin-finalizar {
  to { transform: rotate(360deg); }
}
