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

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --success: #0d9e3f;
  --danger: #d93025;
  --warning: #f9ab00;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.navbar {
  background: var(--primary);
  color: white;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
}

.nav-links a {
  color: white;
  text-decoration: none;
  margin-left: 1.5rem;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.nav-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.view {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.view.active {
  display: block;
}

.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, var(--primary), #4285f4);
  color: white;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.hero-sub {
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.btn {
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #f1f3f4;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #0b8a36;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card h3 {
  font-size: 2rem;
  color: var(--primary);
}

.stat-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.syllabus-overview h2 {
  text-align: center;
  margin-bottom: 1rem;
}

.syllabus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.syllabus-card {
  background: var(--card-bg);
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.syllabus-card h4 {
  color: var(--text);
  margin-bottom: 0.25rem;
}

.syllabus-card .weight {
  display: inline-block;
  background: #e8f0fe;
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.syllabus-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

#categories-view h2 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-sub {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.category-card h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.category-card .cat-weight {
  display: inline-block;
  background: #e8f0fe;
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.category-card .cat-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.category-card .cat-start {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.quiz-header {
  margin-bottom: 1.5rem;
}

.quiz-header h2 {
  margin-bottom: 0.5rem;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
  border-radius: 3px;
}

.question-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option {
  padding: 0.85rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.option:hover {
  border-color: var(--primary);
  background: #e8f0fe;
}

.option.selected {
  border-color: var(--primary);
  background: #e8f0fe;
  font-weight: 500;
}

.option.correct {
  border-color: var(--success);
  background: #e6f4ea;
  color: var(--success);
}

.option.wrong {
  border-color: var(--danger);
  background: #fce8e6;
  color: var(--danger);
}

.option.disabled {
  pointer-events: none;
  opacity: 0.7;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.results-card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #4285f4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto;
}

.score-text {
  color: white;
  font-size: 2rem;
  font-weight: 700;
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.result-item {
  padding: 0.75rem;
}

.result-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.result-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.result-value.correct {
  color: var(--success);
}

.result-value.wrong {
  color: var(--danger);
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.answers-review {
  text-align: left;
  margin-top: 2rem;
}

.answers-review h3 {
  margin-bottom: 1rem;
  text-align: center;
}

.answer-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.answer-item.correct-answer {
  background: #e6f4ea;
  border-left: 4px solid var(--success);
}

.answer-item.wrong-answer {
  background: #fce8e6;
  border-left: 4px solid var(--danger);
}

.answer-item .aq {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.answer-item .a-user {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.answer-item .a-correct {
  color: var(--success);
  font-weight: 500;
  font-size: 0.9rem;
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

footer p {
  margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .results-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .quiz-nav {
    flex-direction: column;
  }
  .results-actions {
    flex-direction: column;
  }
}
