/* Reset e base */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to right, #002366, #4c8bf5);
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

body.dark { background: linear-gradient(to right, #001f4d, #3355aa); color: #f5f5f5; }

/* Header compacto e responsivo */
header {
  text-align: center;
  padding: 8px 15px; /* ainda menor para economizar espaço */
  background-color: #0047AB;
  color: white;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

header h1 {
  font-size: 1.4rem; /* tamanho menor mas legível */
  margin-bottom: 2px;
  text-align: center;
}

header p {
  font-size: 0.95rem;
  margin: 0;
  text-align: center;
}

.lang-mode {
  margin-top: 5px;
  display: flex;
  gap: 5px;
}

.lang-mode button {
  padding: 5px 10px; /* botões menores e compactos */
  font-size: 0.85rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: 0.2s;
  background-color: rgba(255,255,255,0.2);
  color: white;
}

.lang-mode button:hover {
  background-color: #0057d9;
  color: white;
}

/* Responsividade para telas pequenas */
@media(max-width: 480px) {
  header h1 { font-size: 1.2rem; }
  header p { font-size: 0.85rem; }
  .lang-mode button { padding: 4px 8px; font-size: 0.75rem; }
}





/* Layout principal com publicidade */
.container {
  display: flex;
  flex: 1;
  gap: 15px;
  margin-top: 10px;
}

/* Sidebar matérias */
aside#subjects {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 10px;
  border-right: 2px solid rgba(255,255,255,0.2);
  background-color: rgba(0,0,0,0.1);
}
.subject-tab {
  margin: 5px 0;
  padding: 12px 10px;
  font-size: 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background-color: rgba(255,255,255,0.8);
  transition: 0.2s;
}
.subject-tab.active { background-color: #0066cc; color: white; transform: scale(1.05); }

/* Conteúdo central */
main {
  flex: 0 0 65%; /* reduzido para abrir espaço para ads */
  padding: 20px;
  position: relative;
  overflow-y: auto;
  max-height: calc(100vh - 100px);
}

/* Temas */
#themes {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.theme-btn {
  margin: 5px;
  padding: 12px 18px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid #555;
  cursor: pointer;
  transition: 0.2s;
  background-color: rgba(255,255,255,0.85);
}
.theme-btn.active { background-color: #0047AB; color: white; transform: scale(1.05); }
.theme-btn.locked { background-color: #ccc; color: #888; cursor: not-allowed; }

/* Quiz / Perguntas */
#quiz-container { position: relative; width: 100%; overflow: hidden; }
#quiz-slide-wrapper { display: flex; transition: transform 0.5s ease; }

.question {
  min-width: 100%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  position: relative;
  transition: transform 0.5s, box-shadow 0.5s, background 0.3s;
}
body.dark .question { background: rgba(30,30,30,0.4); border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 8px 25px rgba(0,0,0,0.5); }
.question:hover { transform: translateY(-6px) scale(1.02); box-shadow: 0 15px 35px rgba(0,0,0,0.25); }

.question h3 { margin-bottom: 20px; font-size: 1.3rem; font-weight: 600; color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.question label { display: block; margin-bottom: 12px; font-size: 1.1rem; cursor: pointer; color: #f0f0f0; transition: color 0.2s; }
.question label:hover { color: #ffe066; }
.question input[type="radio"] { margin-right: 12px; transform: scale(1.4); vertical-align: middle; accent-color: #0047AB; }

.question button {
  margin-top: 15px;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background-color: #0047AB;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.question button:hover { background-color: #0066cc; transform: scale(1.05); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }

/* Feedback icon */
#feedback-icon {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s, transform 0.5s;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.5);
  z-index: 10;
}
#feedback-icon.show { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }

/* Área de publicidade à direita */
aside#ads {
  flex: 0 0 30%;
  padding: 10px;
  background-color: rgba(255,255,255,0.1);
  border-left: 2px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  text-align: center;
  min-width: 200px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* Footer */
footer {
  text-align: center;
  padding: 5px;
  background-color: #0047AB;
  color: white;
  margin-top: auto;
}

/* Responsividade */
@media(max-width: 1024px){
  .container { flex-direction: column; gap: 10px; }
  main, aside#ads { flex: 1 1 100%; max-height: none; }
  aside#subjects { flex-direction: row; justify-content: center; border-right: none; border-bottom: 2px solid rgba(255,255,255,0.2); padding-bottom: 10px; }
  .subject-tab { margin: 0 5px; padding: 10px; font-size: 1rem; }
}

/* CSS para a barra de progresso */

#quiz-result {
  text-align: center;
  margin-top: 20px;
}

.progress-bar-container {
  width: 80%;
  height: 25px;
  background-color: #ddd;
  border-radius: 12px;
  margin: 10px auto;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  text-align: center;
  line-height: 25px;
  color: white;
  font-weight: bold;
  border-radius: 12px;
  transition: width 1s, background-color 0.5s;
}

.quiz-progress-container {
  width: 80%;
  height: 20px;
  background-color: #ddd;
  border-radius: 10px;
  margin: 10px auto 20px auto;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  width: 0%;
  text-align: center;
  line-height: 20px;
  color: white;
  font-weight: bold;
  border-radius: 10px;
  background-color: #2196f3;
  transition: width 0.3s ease;
}
