/* Estilos Gerais e Tema Claro */
:root {
  --primary-bg-color: #f4f7f9; /* Cinza muito claro */
  --container-bg-color: #ffffff;
  --text-color: #333333;
  --accent-color: #007bff; /* Azul profissional */
  --accent-glow: rgba(0, 123, 255, 0.2);
  --border-color: #dee2e6;
  --success-color: #28a745;
  --error-color: #dc3545;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --font-family: "Poppins", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, #f4f7f9 0%, #e9ecef 100%);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  line-height: 1.6;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 700px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 20px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.school-info,
.class-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.school-info img {
  width: 160px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.quiz-container,
.container {
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  padding: 20px;
  width: 100%;
  max-width: 700px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 1px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 123, 255, 0.1);
  text-align: center;
  transition: all 0.3s ease;
}

/* Rodapé com Logo e Nome da Turma */
.class-footer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.class-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(0, 123, 255, 0.3);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.class-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
}

/* Tela de Introdução - ÍCONE CORRIGIDO */
.intro-icon-container .fas {
  font-size: 3.5rem;
  color: var(--accent-color);
  margin-bottom: 20px;
}

.intro-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.intro-text {
  font-size: 0.9rem;
  margin-bottom: 20px;
  max-width: 90%;
  line-height: 1.5;
}

/* Formulários */
.student-info-form {
  width: 100%;
  max-width: 400px; /* Limita a largura do formulário */
  margin: 0 auto 20px; /* Centraliza e adiciona espaço */
}

.form-group {
  width: 100%;
  text-align: left;
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

input[type="text"],
input[type="url"],
textarea {
  width: 100%;
  padding: 12px;
  background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid rgba(0, 123, 255, 0.2);
  border-radius: 12px;
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="url"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-glow);
  background: #ffffff;
}

/* Botões */
.btn,
#restart-btn,
#next-btn {
  background: linear-gradient(145deg, var(--accent-color) 0%, #0056b3 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* BOTÃO DE INICIAR - TAMANHO CORRIGIDO */
#start-quiz-btn {
  background: linear-gradient(145deg, var(--accent-color) 0%, #0056b3 100%);
  color: white;
  border: none;
  padding: 12px 25px; /* Padding Reduzido */
  border-radius: 12px;
  font-size: 1rem; /* Fonte Reduzida */
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn:hover,
#start-quiz-btn:hover,
#restart-btn:hover,
#next-btn:hover {
  background: linear-gradient(145deg, #0056b3 0%, #004085 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* Corpo do Quiz e Feedback de Resposta */
.answer-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.answer {
  background: #f8f9fa;
  border: 2px solid rgba(0, 123, 255, 0.2);
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.answer:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.answer .answer-text {
  flex-grow: 1;
}

.answer .feedback-icon {
  font-weight: bold;
  font-size: 1.2rem;
  margin-left: 15px;
}

.answer.correct {
  background-color: #d4edda; /* Light green background */
  border-color: var(--success-color);
  color: #155724; /* Dark green text for better readability */
}

.answer.correct .feedback-icon {
  color: var(--success-color);
}

.answer.correct .feedback-icon::after {
  content: "\f00c"; /* Font Awesome check icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.answer.incorrect {
  background-color: #f8d7da; /* Light red background */
  border-color: var(--error-color);
  color: #721c24; /* Dark red text for better readability */
}

.answer.incorrect .feedback-icon {
  color: var(--error-color);
}

.answer.incorrect .feedback-icon::after {
  content: "\f00d"; /* Font Awesome times icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

.answer.disabled {
  pointer-events: none;
}

#question {
  font-size: 1.7rem;
  margin-bottom: 20px;
}

/* Outros estilos */
.hide {
  display: none;
}

.quiz-header {
  margin-bottom: 15px;
  width: 100%;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

#progress-container {
  width: 100%;
  height: 12px;
  background: linear-gradient(145deg, #e9ecef 0%, #dee2e6 100%);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color) 0%, #0056b3 100%);
  width: 0;
  transition: width 0.3s ease;
  border-radius: 6px;
}

.results-container .fa-trophy {
  font-size: 4rem;
  color: #ffc107;
  filter: drop-shadow(0 4px 8px rgba(255, 193, 7, 0.3));
}

.quiz-footer {
  margin-top: 25px;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .site-header {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    margin-bottom: 15px;
  }

  .school-info img {
    width: 120px;
    height: 45px;
  }

  .class-logo {
    width: 45px;
    height: 45px;
  }

  .quiz-container,
  .container {
    padding: 15px;
    border-radius: 15px;
  }

  .intro-icon-container .fas {
    font-size: 2.7rem;
  }

  .intro-title {
    font-size: 1.7rem;
  }

  .intro-text {
    font-size: 0.8rem;
  }

  .student-info-form {
    max-width: 100%;
  }

  #question {
    font-size: 1.5rem;
  }

  .answer {
    padding: 10px;
    font-size: 0.95rem;
  }

  .btn,
  #restart-btn,
  #next-btn {
    padding: 12px 20px;
    font-size: 1rem;
  }

  #start-quiz-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
  }

  .progress-info {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  #progress-container {
    width: 100%;
  }

  .results-container .fa-trophy {
    font-size: 3rem;
  }
}

/* Estilos para a página de listagem de perguntas */
.question-list-item {
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  border: 2px solid rgba(0, 123, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.question-list-item:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.question-content h4 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 15px;
}

.question-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.question-content li {
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
  font-size: 1rem;
  color: var(--text-color);
}

.question-content li:last-child {
  border-bottom: none;
}

.question-content li.correct {
  font-weight: 600;
  color: var(--success-color);
}

.correct-indicator {
  color: var(--success-color);
  font-weight: bold;
}

.question-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 120px;
}

.btn-delete {
  background: linear-gradient(145deg, var(--error-color) 0%, #c82333 100%);
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-delete:hover {
  background: linear-gradient(145deg, #c82333 0%, #a02622 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-delete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.spinner-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.empty-state-container {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
  font-size: 1.2rem;
}

.empty-state-container p {
  margin: 0;
  font-weight: 500;
}

/* Responsividade para a listagem */
@media (max-width: 768px) {
  .question-list-item {
    flex-direction: column;
    gap: 15px;
  }

  .question-actions {
    flex-direction: row;
    justify-content: center;
  }

  .question-content h4 {
    font-size: 1.2rem;
  }

  .question-content li {
    font-size: 0.95rem;
  }
}
