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

/* Top navigation */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #3949ab;
  text-decoration: none;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  color: #333;
  border: 1px solid #dadce0;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
  background: #f7f8f8;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.google-icon {
  flex-shrink: 0;
}

.flash-alert {
  background: #fff3cd;
  color: #856404;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: #1a1a2e;
  background: #f8f9fa;
  line-height: 1.6;
}

h1 { color: #1a1a2e; margin-bottom: 0.5rem; }
h2 { color: #2d2d44; margin-bottom: 0.5rem; }

.hero {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.hero h1 { font-size: 2.2rem; }

.subtitle {
  color: #666;
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.quiz-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.quiz-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.quiz-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.quiz-description {
  color: #555;
  margin: 0.5rem 0 1rem;
}

.quiz-meta {
  margin-bottom: 1rem;
}

.question-count {
  background: #e8eaf6;
  color: #3949ab;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  background: #3949ab;
  color: #fff;
}

.btn-primary:hover { background: #283593; }

.btn-secondary {
  background: #e0e0e0;
  color: #333;
  margin-left: 0.5rem;
}

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

/* Question page */
.question-container { padding: 1rem 0; }

.progress-bar {
  background: #e0e0e0;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  background: #3949ab;
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s ease;
}

.progress-text {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.question-body {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.options {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.option-card:hover {
  border-color: #3949ab;
  background: #f5f5ff;
}

.option-card input[type="radio"] { display: none; }

.option-card input[type="radio"]:checked + .option-label {
  background: #3949ab;
  color: #fff;
}

.option-card:has(input:checked) {
  border-color: #3949ab;
  background: #f0f0ff;
}

.option-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8eaf6;
  color: #3949ab;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.option-text { font-size: 1rem; }

/* Results page */
.result-container { padding: 1rem 0; }

.score-card {
  text-align: center;
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.score-number {
  font-size: 3rem;
  font-weight: 700;
  color: #3949ab;
}

.score-percent {
  color: #666;
  font-size: 1.1rem;
  margin-top: 0.25rem;
}

.results-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.result-item {
  background: #fff;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  border-left: 4px solid;
}

.result-item.correct { border-color: #43a047; }
.result-item.incorrect { border-color: #e53935; }

.result-question {
  margin-bottom: 0.5rem;
}

.result-answer {
  color: #555;
  font-size: 0.9rem;
}

.result-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.5rem;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #888;
}

.quiz-detail {
  padding: 2rem 0;
}

.quiz-detail h1 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}
