/* ===== Base / Reset ===== */
* { box-sizing: border-box; }
:root{
  --bg: #f4f6f8;
  --card: #ffffff;
  --primary: #1967d2;
  --primary-600: #145fa8;
  --accent: #2980b9;
  --success: #27ae60;
  --danger: #e63946;
  --muted: #6b7280;
  --shadow: rgba(15,23,42,0.06);
  --radius: 12px;
  --gap: 20px;
}
   
   body {
      font-family: 'Lato', sans-serif;
      background-color: #f0f2f5;
      margin: 0;
      padding: 20px;
      color: #333;
    }

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

    .questao-container {
      background: #fff;
      border-radius: 12px;
      padding: 24px;
      margin-bottom: 30px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
      transition: transform 0.2s, box-shadow 0.2s;
    }

    .questao-container:hover {
      transform: translateY(-4px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }

    .info-questao {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 15px;
    }
    .info-questao .tag {
      background: #e8f0fe;
      color: #1967d2;
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 0.85rem;
    }

    .enunciado {
      font-size: 1.25rem;
      margin-bottom: 18px;
    }

    .alternativa {
      display: flex;
      align-items: center;
      margin: 8px 0;
    }
    .alternativa input[type="radio"] {
      margin-right: 12px;
      accent-color: #1967d2;
      cursor: pointer;
    }
    .alternativa label {
      flex: 1;
      padding: 10px 14px;
      border: 1px solid #ccc;
      border-radius: 6px;
      cursor: pointer;
      transition: background-color 0.2s, border-color 0.2s;
    }
    .alternativa label:hover {
      background-color: #f1f5fc;
      border-color: #1967d2;
    }

    .botao-responder {
      margin-top: 16px;
      padding: 10px 20px;
      background-color: #1967d2;
      color: white;
      border: none;
      border-radius: 6px;
      font-size: 1rem;
      font-weight: bold;
      cursor: pointer;
      transition: background-color 0.3s, transform 0.1s;
    }
    .botao-responder:hover:not(:disabled) {
      background-color: #174ea6;
      transform: translateY(-1px);
    }
    .botao-responder:disabled {
      background-color: #bbb;
      cursor: not-allowed;
      opacity: 0.7;
    }

    .feedback {
      margin-top: 12px;
      font-weight: bold;
      opacity: 0;
      animation: fadeIn 0.6s forwards;
    }

    label.correta {
      background-color: #d4edda !important;
      border-color: #28a745 !important;
      color: #155724;
    }
    label.errada {
      background-color: #f8d7da !important;
      border-color: #dc3545 !important;
      color: #721c24;
    }

    .respondido .alternativa label {
      background-color: #f7f7f7;
      border-color: #ddd;
      color: #888;
      cursor: not-allowed;
    }
    .respondido .alternativa label:hover {
      background-color: #f7f7f7;
    }

    .botao-gabarito {
      margin-top: 12px;
      padding: 6px 14px;
      background-color: #f9c74f;
      color: #333;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-weight: bold;
      transition: background-color 0.3s;
    }
    .botao-gabarito:hover {
      background-color: #f4b429;
    }

    .gabarito {
      overflow: hidden;
      transition: max-height 0.3s ease;
      max-height: 0;
      margin-top: 8px;
      background: #fff3cd;
      padding: 0 12px;
      border-left: 4px solid #ffec99;
      border-radius: 4px;
    }
    .gabarito.show {
      padding: 12px;
      max-height: 100%;
    }


    footer {
      text-align: center;
      margin-top: 40px;
    }
    footer a {
      color: #1967d2;
      text-decoration: none;
      font-weight: bold;
      transition: color 0.2s;
    }
    footer a:hover {
      color: #174ea6;
    }

    @keyframes fadeIn {
      to { opacity: 1; }
    }

    .paginacao a {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 4px;
  border-radius: 6px;
  background-color: #e9ecef;
  color: #333;
  text-decoration: none;
  transition: background-color 0.2s;
}

.paginacao a:hover {
  background-color: #007bff;
  color: white;
}

.paginacao .active-page {
  background-color: #007bff;
  color: white;
  font-weight: bold;
  pointer-events: none;
}
.filtro-form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin: 30px 0;
  padding: 20px;
  background: #f5f8fc;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.filtro-grupo {
  display: flex;
  flex-direction: column;
  min-width: 200px;
}

.filtro-grupo label {
  margin-bottom: 5px;
  font-weight: 600;
  color: #333;
}

.filtro-select {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  background-color: #fff;
  transition: border-color 0.3s;
}

.filtro-select:focus {
  outline: none;
  border-color: #007bff;
}

.filtro-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.filtro-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.3s ease;
}

.filtro-aplicar {
  background-color: #007bff;
  color: white;
}

.filtro-aplicar:hover {
  background-color: #0056b3;
}

.filtro-limpar {
  background-color: #ffc107;
  color: #333;
}

.filtro-limpar:hover {
  background-color: #e0a800;
}

/* Mobile Responsivo */
@media (max-width: 768px) {
  .filtro-form {
    flex-direction: column;
    align-items: center;
  }
  .filtro-grupo {
    width: 100%;
    max-width: 300px;
  }
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 3px solid #ccc;
  border-top: 3px solid #2980b9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.comentario-box {
  background: #f9f9f9;
  border: 1px solid #ccc;
  padding: 15px;
  margin-top: 10px;
  border-radius: 8px;
  max-width: 100%;
  display: none; /* Inicia oculto */
}

.comentarios-list {
  margin-bottom: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 5px;
}

.comentario-input {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #aaa;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 8px;
}

.comentario-item{
  max-width: 100%;
  overflow-wrap: break-word;
}

.comentario-footer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-comentar {
  padding: 6px 12px;
  background-color: #5c90d2;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-comentar:hover {
  background-color: #4a7ab3;
}

.msg-comentario {
  font-size: 14px;
  font-weight: bold;
}

/* ===== Header ===== */
.main-header{
  background: linear-gradient(90deg, var(--primary), var(--primary-600));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1200;
  box-shadow: 0 2px 8px var(--shadow);
}
.header-container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo img{
  max-height: 48px;
  display: block;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.nav-menu{
  display: flex;
  gap: 14px;
  align-items: center;
}
.nav-menu a{
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background .18s ease, transform .12s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-menu a:hover{ background: rgba(255,255,255,0.08); transform: translateY(-1px); }
.logout-link { margin-left: 6px; }
.logout-link button{
  background: #ff6363;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.logout-link button:hover{ background: #d64545; }
.menu-toggle{
  display: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.mobile-menu{
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(255,255,255,0.02));
}
.mobile-menu a{
  color: #fff;
  text-decoration: none;
  padding: 8px 0;
  display: block;
}
@media (max-width: 980px){
  .header-container{ padding: 10px 16px; }
  .dashboard-container{ margin: 20px 16px; padding: 18px; }
}
@media (max-width: 768px){
  .nav-menu{ display: none; }
  .menu-toggle{ display: inline-flex; }
  .mobile-menu{
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.573), rgb(255, 255, 255));
    padding: 12px 20px;
    z-index: 1100;
    flex-direction: column;
  }
  .stats-group{ gap: 14px; }
  .materia-container{ gap: 12px; }
}
@media (max-width: 430px){
  .chart-container{ width: 100%; }
  .stat-numbers p { font-size: 0.95rem; }
  .link-btn { padding: 10px 16px; font-size: 0.95rem; }
  .enunciado p img{ max-width: 350px;}
  .gabarito.show img{ max-width: 320px; max-height: 100%;}
}
