/* Quiz-specific styles */

/* Quiz Hero Section */
.quiz-hero {
  background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-blue));
  padding: 3rem 0 2rem;
  position: relative;
  overflow: hidden;
}

.quiz-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="quiz-pattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23quiz-pattern)"/></svg>');
  opacity: 0.3;
}

.quiz-header {
  text-align: center;
  color: var(--white);
  position: relative;
  z-index: 2;
}

.quiz-title {
  font-family: 'VT323', monospace;
  font-size: 3.5rem;
  margin-bottom: 1rem;
  letter-spacing: 3px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.quiz-subtitle {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.quiz-description {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Quiz Section */
.quiz-section {
  padding: 4rem 0;
  background: var(--soft-bg);
  min-height: 60vh;
}

.quiz-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  overflow: hidden;
}

/* Quiz Progress */
.quiz-progress-container {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--gray-300);
}

.quiz-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-300);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pastel-pink), var(--pastel-blue));
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

.quiz-progress-text {
  text-align: center;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.9rem;
}

/* Quiz Introduction */
.quiz-intro {
  padding: 3rem 2rem;
  text-align: center;
}

.quiz-intro-content h2 {
  font-family: 'VT323', monospace;
  font-size: 2.5rem;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  letter-spacing: 2px;
}

.quiz-intro-content p {
  font-size: 1.125rem;
  color: var(--gray-700);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.quiz-topics {
  background: var(--gray-100);
  padding: 2rem;
  border-radius: 0.5rem;
  margin: 2rem 0;
  text-align: left;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.quiz-topics h3 {
  color: var(--horror-red);
  margin-bottom: 1rem;
  font-size: 1.25rem;
  text-align: center;
}

.quiz-topics ul {
  list-style: none;
  padding: 0;
}

.quiz-topics li {
  padding: 0.5rem 0;
  font-size: 1rem;
  color: var(--gray-700);
  display: flex;
  align-items: center;
}

.start-quiz-btn {
  background: var(--horror-red);
  color: var(--white);
  border: none;
  padding: 1rem 3rem;
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.start-quiz-btn:hover {
  background: var(--red-600);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 0, 0, 0.4);
}

.quiz-icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* Quiz Form */
.quiz-form {
  padding: 2rem;
}

.question-block {
  margin-bottom: 2rem;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-300);
}

.question-title {
  font-family: 'VT323', monospace;
  font-size: 1.75rem;
  color: var(--horror-red);
  letter-spacing: 1px;
}

.question-counter {
  background: var(--pastel-blue);
  color: var(--text-dark);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
}

.question-text {
  font-size: 1.25rem;
  color: var(--text-dark);
  margin-bottom: 2rem;
  line-height: 1.6;
  font-weight: 500;
}

.question-answers {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.answer-option {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  border: 2px solid var(--gray-300);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  background: var(--white);
}

.answer-option:hover {
  border-color: var(--pastel-pink);
  background: rgba(255, 192, 203, 0.05);
}

.answer-option input[type="radio"] {
  margin-right: 1rem;
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--horror-red);
}

.answer-option input[type="radio"]:checked + .answer-text {
  color: var(--horror-red);
  font-weight: 600;
}

.answer-option:has(input[type="radio"]:checked) {
  border-color: var(--horror-red);
  background: rgba(255, 0, 0, 0.05);
}

.answer-text {
  flex: 1;
  font-size: 1rem;
  color: var(--text-dark);
  transition: all 0.3s ease;
}

.answer-indicator {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--gray-400);
  transition: all 0.3s ease;
}

.answer-option:has(input[type="radio"]:checked) .answer-indicator {
  background: var(--horror-red);
  border-color: var(--horror-red);
}

/* Quiz Navigation */
.quiz-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  border-top: 1px solid var(--gray-300);
  gap: 1rem;
}

.quiz-nav-btn,
.quiz-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.quiz-nav-btn.prev {
  background: var(--gray-600);
  color: var(--white);
}

.quiz-nav-btn.next {
  background: var(--pastel-blue);
  color: var(--text-dark);
}

.quiz-submit-btn {
  background: var(--horror-red);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.quiz-nav-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.quiz-nav-btn.prev:hover:not(:disabled) {
  background: var(--gray-700);
}

.quiz-nav-btn.next:hover:not(:disabled) {
  background: #9AC8D4;
}

.quiz-submit-btn:hover {
  background: var(--red-600);
  box-shadow: 0 6px 16px rgba(255, 0, 0, 0.4);
}

.quiz-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.nav-icon,
.submit-icon {
  width: 1rem;
  height: 1rem;
}

/* Quiz Results */
.quiz-results {
  padding: 3rem 2rem;
  text-align: center;
}

.results-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 3rem;
}

.results-score {
  flex-shrink: 0;
}

.score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-blue));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.score-number {
  font-family: 'VT323', monospace;
  font-size: 2.5rem;
  color: var(--white);
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.score-label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.results-info {
  flex: 1;
  text-align: left;
}

.result-title {
  font-family: 'VT323', monospace;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.result-description {
  font-size: 1.125rem;
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.result-stats {
  display: flex;
  gap: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: var(--horror-red);
  font-family: 'VT323', monospace;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 500;
}

/* Result Tier Colors */
.quiz-results.expert .result-title {
  color: #FFD700;
}

.quiz-results.devoted .result-title {
  color: var(--green-600);
}

.quiz-results.pragmatist .result-title {
  color: var(--orange-600);
}

.quiz-results.observer .result-title {
  color: var(--pastel-blue);
}

.quiz-results.newcomer .result-title {
  color: var(--gray-600);
}

/* Result Actions */
.result-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 1rem;
}

.action-btn.primary {
  background: var(--horror-red);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.action-btn.secondary {
  background: var(--pastel-blue);
  color: var(--text-dark);
}

.action-btn.tertiary {
  background: var(--gray-600);
  color: var(--white);
}

.action-btn:hover {
  transform: translateY(-2px);
}

.action-btn.primary:hover {
  background: var(--red-600);
  box-shadow: 0 6px 16px rgba(255, 0, 0, 0.4);
}

.action-btn.secondary:hover {
  background: #9AC8D4;
}

.action-btn.tertiary:hover {
  background: var(--gray-700);
}

.action-icon {
  width: 1rem;
  height: 1rem;
}

/* Share Modal */
.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.share-modal-content {
  background: var(--white);
  padding: 2rem;
  border-radius: 1rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.share-modal-content h3 {
  font-family: 'VT323', monospace;
  font-size: 2rem;
  color: var(--horror-red);
  margin-bottom: 1rem;
}

.share-modal-content p {
  color: var(--gray-700);
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

.share-text-container {
  position: relative;
  margin-bottom: 2rem;
}

#share-text {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  resize: none;
  height: 80px;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--pastel-blue);
  color: var(--text-dark);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: #9AC8D4;
}

.close-modal-btn {
  background: var(--gray-600);
  color: var(--white);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.close-modal-btn:hover {
  background: var(--gray-700);
}

/* Related Content Section */
.related-content {
  padding: 4rem 0;
  background: var(--white);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.related-card {
  background: var(--gray-100);
  padding: 2rem;
  border-radius: 0.5rem;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.related-card:hover {
  transform: translateY(-4px);
  border-color: var(--pastel-pink);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.related-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.related-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.related-card p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.related-link {
  display: inline-block;
  background: var(--horror-red);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.related-link:hover {
  background: var(--red-600);
  transform: translateY(-2px);
}

/* Review Modal Styles */
.review-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 1rem;
}

.review-modal-content {
  background: var(--white);
  border-radius: 1rem;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.review-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--gray-300);
}

.review-modal-header h3 {
  font-family: 'VT323', monospace;
  font-size: 2rem;
  color: var(--horror-red);
  margin: 0;
}

.close-review-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--gray-600);
  transition: color 0.3s ease;
}

.close-review-btn:hover {
  color: var(--horror-red);
}

.close-review-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

.review-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 2rem;
}

.review-modal-footer {
  padding: 1rem 2rem 2rem;
  border-top: 1px solid var(--gray-300);
  text-align: center;
}

.review-summary {
  background: var(--gray-100);
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.review-summary h4 {
  color: var(--horror-red);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.all-correct {
  text-align: center;
  padding: 3rem 2rem;
}

.perfect-score-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
}

.all-correct h4 {
  font-family: 'VT323', monospace;
  font-size: 2rem;
  color: var(--green-600);
  margin-bottom: 1rem;
}

.all-correct p {
  font-size: 1.125rem;
  color: var(--gray-700);
  line-height: 1.6;
}

.review-item {
  background: var(--white);
  border: 2px solid var(--gray-300);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.review-item:hover {
  border-color: var(--pastel-pink);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.review-question-number {
  font-family: 'VT323', monospace;
  font-size: 1.125rem;
  color: var(--horror-red);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.review-question-text {
  font-size: 1.125rem;
  color: var(--text-dark);
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.review-answers {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.review-answer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
}

.your-answer {
  background: rgba(255, 0, 0, 0.05);
  border-left: 4px solid var(--red-500);
}

.correct-answer {
  background: rgba(56, 161, 105, 0.05);
  border-left: 4px solid var(--green-500);
}

.answer-label {
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 120px;
}

.answer-value {
  flex: 1;
  font-size: 1rem;
  font-weight: 500;
}

.answer-value.incorrect {
  color: var(--red-600);
}

.answer-value.correct {
  color: var(--green-600);
}

/* Review Button Style */
.action-btn.review {
  background: var(--orange-500);
  color: var(--white);
}

.action-btn.review:hover {
  background: var(--orange-600);
}

/* Responsive Design for Review Modal */
@media (max-width: 768px) {
  .review-modal-content {
    margin: 1rem;
    max-height: 95vh;
  }

  .review-modal-header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .review-content {
    padding: 1rem 1.5rem;
  }

  .review-modal-footer {
    padding: 1rem 1.5rem 1.5rem;
  }

  .review-item {
    padding: 1rem;
  }

  .review-answers {
    gap: 0.75rem;
  }

  .review-answer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .answer-label {
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .review-modal {
    padding: 0.5rem;
  }

  .review-modal-header h3 {
    font-size: 1.5rem;
  }

  .review-question-text {
    font-size: 1rem;
  }

  .perfect-score-icon {
    font-size: 3rem;
  }

  .all-correct h4 {
    font-size: 1.5rem;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .quiz-title {
    font-size: 2.5rem;
  }

  .quiz-subtitle {
    font-size: 1.25rem;
  }

  .quiz-container {
    margin: 0 1rem;
    border-radius: 0.5rem;
  }

  .quiz-intro,
  .quiz-form,
  .quiz-results {
    padding: 2rem 1.5rem;
  }

  .quiz-progress-container {
    padding: 1.5rem 1.5rem 1rem;
  }

  .question-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .question-title {
    font-size: 1.5rem;
  }

  .results-content {
    flex-direction: column;
    gap: 2rem;
  }

  .results-info {
    text-align: center;
  }

  .result-stats {
    justify-content: center;
  }

  .quiz-navigation {
    flex-direction: column;
    gap: 1rem;
  }

  .quiz-nav-btn,
  .quiz-submit-btn {
    width: 100%;
    justify-content: center;
  }

  .result-actions {
    flex-direction: column;
    align-items: center;
  }

  .action-btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .quiz-title {
    font-size: 2rem;
  }

  .quiz-hero {
    padding: 2rem 0 1.5rem;
  }

  .quiz-description {
    font-size: 1rem;
  }

  .quiz-container {
    margin: 0 0.5rem;
  }

  .quiz-intro,
  .quiz-form,
  .quiz-results {
    padding: 1.5rem 1rem;
  }

  .quiz-topics {
    padding: 1.5rem;
    margin: 1.5rem 0;
  }

  .start-quiz-btn {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
  }

  .question-text {
    font-size: 1.125rem;
  }

  .answer-option {
    padding: 0.875rem 1rem;
  }

  .score-circle {
    width: 120px;
    height: 120px;
  }

  .score-number {
    font-size: 2rem;
  }

  .result-title {
    font-size: 2rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .share-modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }

  .related-card {
    padding: 1.5rem;
  }
}

/* Animation for quiz transitions */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.question-block {
  animation: slideIn 0.3s ease-out;
}

/* Loading animation for async content */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Focus states for accessibility */
.answer-option:focus-within {
  outline: 2px solid var(--horror-red);
  outline-offset: 2px;
}

.quiz-nav-btn:focus,
.quiz-submit-btn:focus,
.action-btn:focus {
  outline: 2px solid var(--horror-red);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .answer-option {
    border-width: 3px;
  }

  .answer-option:hover {
    border-color: var(--text-dark);
  }

  .quiz-progress-fill {
    background: var(--text-dark);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .question-block {
    animation: none;
  }

  .quiz-nav-btn:hover,
  .action-btn:hover {
    transform: none;
  }

  .related-card:hover {
    transform: none;
  }
}