/* Quiz Page Styles */

.site-header .nav,
.site-header .header-actions {
  display: none;
}

.quiz-main {
  width: min(900px, 92vw);
  margin: 0 auto;
  padding: 32px 0 96px;
  min-height: calc(100vh - 200px);
}

/* Topic Selector */
.topic-selector {
  max-width: 700px;
  margin: 0 auto;
}

.selector-header {
  text-align: center;
  margin-bottom: 32px;
}

.selector-header h1 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.selector-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.selector-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.topics-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.topic-checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 2px solid rgba(249, 115, 22, 0.15);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.topic-checkbox:hover {
  border-color: rgba(249, 115, 22, 0.3);
  background: rgba(249, 115, 22, 0.03);
}

.topic-checkbox.is-selected {
  border-color: var(--primary);
  background: rgba(249, 115, 22, 0.08);
}

.topic-checkbox input {
  display: none;
}

.topic-checkbox .checkbox-mark {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(249, 115, 22, 0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
  color: transparent;
}

.topic-checkbox.is-selected .checkbox-mark {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.topic-checkbox .topic-name {
  font-weight: 500;
  font-size: 0.95rem;
}

.selector-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(249, 115, 22, 0.1);
}

.selected-count {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.selected-count span {
  font-weight: 700;
  color: var(--primary);
}

/* Flashcard Screen */
.flashcard-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.quiz-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-progress {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.quiz-progress span:first-child {
  color: var(--primary);
  font-size: 1.3rem;
}

/* Flashcard */
.flashcard-container {
  perspective: 1000px;
  width: 100%;
  max-width: 550px;
}

.flashcard {
  width: 100%;
  height: 380px;
  cursor: pointer;
  position: relative;
}

.flashcard-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard.is-flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.flashcard-front {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(249, 115, 22, 0.05) 100%);
  border: 2px solid rgba(249, 115, 22, 0.15);
}

.flashcard-back {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08) 0%, var(--surface) 100%);
  border: 2px solid var(--primary);
  transform: rotateY(180deg);
  justify-content: flex-start;
  padding-top: 28px;
}

/* Front card styles */
.card-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  font-weight: 700;
  padding: 6px 14px;
  background: rgba(249, 115, 22, 0.1);
  border-radius: 999px;
  margin-bottom: 20px;
}

.card-word {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.card-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* Back card styles */
.card-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 8px;
  width: 100%;
  text-align: left;
}

.card-label--example {
  margin-top: 20px;
}

.card-definition {
  font-size: 1.15rem;
  line-height: 1.5;
  font-weight: 500;
  color: var(--text);
  width: 100%;
  text-align: left;
}

.card-example {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  font-style: italic;
  width: 100%;
  text-align: left;
}

.card-questions-section {
  margin-top: 20px;
  width: 100%;
}

.card-label--questions {
  margin-top: 20px;
}

.card-questions {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.card-questions li {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--text-muted);
  padding: 6px 0;
  padding-left: 16px;
  position: relative;
}

.card-questions li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.card-topic {
  font-size: 0.8rem;
  color: var(--primary);
  margin-top: auto;
  padding: 6px 14px;
  background: rgba(249, 115, 22, 0.1);
  border-radius: 999px;
}

/* Flashcard Controls */
.flashcard-controls {
  display: flex;
  gap: 16px;
}

.flashcard-controls .btn span {
  font-size: 1.1rem;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  max-width: 550px;
  height: 6px;
  background: rgba(249, 115, 22, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

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

/* Quiz Complete */
.quiz-complete {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.complete-content {
  text-align: center;
}

.complete-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 24px;
}

.complete-content h2 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.complete-content > p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

.complete-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 600px) {
  .flashcard {
    height: 340px;
  }

  .flashcard-front,
  .flashcard-back {
    padding: 24px;
  }

  .card-word {
    font-size: 1.3rem;
  }

  .card-definition {
    font-size: 1rem;
  }

  .topics-checklist {
    grid-template-columns: 1fr 1fr;
  }

  .quiz-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .flashcard-controls {
    width: 100%;
  }

  .flashcard-controls .btn {
    flex: 1;
  }
}
