/**
 * Quiz System Styles
 * Modern, clean styling for the quiz feature
 */

/* Quiz Container */
.quiz-container {
  margin: 2rem 0;
  max-width: 100%;
}

.quiz-wrapper {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Questions Container */
.quiz-questions {
  margin-bottom: 2rem;
}

/* Individual Question */
.quiz-question {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.quiz-question:hover {
  border-color: #e5e7eb;
}

.quiz-question-unanswered {
  border-color: #fbbf24;
  background: #fffbeb;
}

.quiz-question-correct {
  border-color: #10b981;
  background: #f0fdf4;
}

.quiz-question-incorrect {
  border-color: #ef4444;
  background: #fef2f2;
}

/* Question Header */
.quiz-question-header {
  margin-bottom: 1.25rem;
}

.quiz-question-number {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.quiz-question-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  line-height: 1.6;
}

/* Options Container */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Individual Option */
.quiz-option {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.quiz-option:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.quiz-option input[type="radio"] {
  margin-right: 0.75rem;
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: #3b82f6;
}

.quiz-option input[type="radio"]:disabled {
  cursor: not-allowed;
}

.quiz-option-text {
  flex: 1;
  font-size: 1rem;
  color: #374151;
  line-height: 1.5;
}

/* Selected Option States */
.quiz-option:has(input[type="radio"]:checked) {
  border-color: #3b82f6;
  background: #eff6ff;
  font-weight: 500;
}

/* Correct Answer Highlighting */
.quiz-option-correct {
  border-color: #10b981 !important;
  background: #d1fae5 !important;
}

.quiz-option-correct::after {
  content: "✓";
  position: absolute;
  right: 1rem;
  color: #10b981;
  font-weight: bold;
  font-size: 1.25rem;
}

.quiz-option-incorrect {
  border-color: #ef4444 !important;
  background: #fee2e2 !important;
}

.quiz-option-incorrect::after {
  content: "✗";
  position: absolute;
  right: 1rem;
  color: #ef4444;
  font-weight: bold;
  font-size: 1.25rem;
}

.quiz-option-correct-answer {
  border-color: #10b981 !important;
  background: #d1fae5 !important;
}

.quiz-option-correct-answer::after {
  content: "✓ Correct";
  position: absolute;
  right: 1rem;
  color: #10b981;
  font-weight: 600;
  font-size: 0.875rem;
}

/* Feedback */
.quiz-feedback {
  margin-top: 1rem;
  padding: 1rem;
  background: #ffffff;
  border-left: 4px solid #3b82f6;
  border-radius: 4px;
}

.quiz-feedback-content {
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.6;
}

.quiz-question-correct .quiz-feedback {
  border-left-color: #10b981;
}

.quiz-question-incorrect .quiz-feedback {
  border-left-color: #ef4444;
}

/* Submit Button */
.quiz-submit-btn {
  display: block;
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #ffffff;
  background: #6b7280;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 2rem 0;
}

.quiz-submit-btn:hover:not(:disabled) {
  background: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(107, 114, 128, 0.3);
}

.quiz-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.quiz-submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* Results Container */
.quiz-results {
  margin-top: 2rem;
  padding: 2rem;
  background: #ffffff;
  border-radius: 12px;
  color: #111111;
  border: 1px solid #e5e7eb;
}

.quiz-results-content {
  text-align: center;
}

/* Score Display */
.quiz-score {
  margin-bottom: 2rem;
}

.quiz-score h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #111111;
}

.quiz-score-percentage {
  font-size: 3rem;
  font-weight: 800;
  margin: 0;
  color: #0b5fff;
  opacity: 1;
}

/* Badge */
.quiz-badge {
  margin: 2rem 0;
  padding: 2rem;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.quiz-badge-emoji {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.quiz-badge-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #111111;
}

.quiz-badge-message {
  font-size: 1rem;
  color: #111111;
  opacity: 0.9;
  line-height: 1.6;
}

/* Share Section */
.quiz-share {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.quiz-share h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: #111111;
}

/* Review Answers Button */
.quiz-review-btn {
  display: block;
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background: #0b5fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 2rem 0;
}

.quiz-review-btn:hover {
  background: #0949d4;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(11, 95, 255, 0.3);
}

.quiz-review-btn:active {
  transform: translateY(0);
}

.quiz-review-btn:focus {
  outline: 2px solid #0b5fff;
  outline-offset: 2px;
}

.quiz-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.quiz-share-btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ffffff;
  background: #6b7280;
  border: 1px solid #6b7280;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.quiz-share-btn:hover {
  background: #4b5563;
  border-color: #4b5563;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.quiz-share-btn:active {
  transform: translateY(0);
}

.quiz-share-linkedin {
  background: rgba(0, 119, 181, 0.8);
  border-color: rgba(0, 119, 181, 0.9);
}

.quiz-share-linkedin:hover {
  background: rgba(0, 119, 181, 1);
}

.quiz-share-twitter {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(0, 0, 0, 0.9);
}

.quiz-share-twitter:hover {
  background: rgba(0, 0, 0, 1);
}

.quiz-share-copy {
  background: #6b7280;
  border-color: #6b7280;
}

.quiz-share-copied {
  background: rgba(16, 185, 129, 0.8) !important;
  border-color: rgba(16, 185, 129, 0.9) !important;
}

/* Error State */
.quiz-error {
  padding: 1.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  text-align: center;
}

/* Loading State */
.quiz-loading {
  padding: 2rem;
  text-align: center;
  color: #6b7280;
  font-size: 1rem;
}

/* Quiz Open Button */
.quiz-open-btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background: #6b7280;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.quiz-open-btn:hover {
  background: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(107, 114, 128, 0.3);
}

.quiz-open-btn:active {
  transform: translateY(0);
}

.quiz-open-btn:focus {
  outline: 2px solid #0b5fff;
  outline-offset: 2px;
}

/* Modal Overlay */
.quiz-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: quiz-modal-fade-in 0.2s ease;
}

@keyframes quiz-modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Container */
.quiz-modal {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: quiz-modal-slide-in 0.3s ease;
  outline: none;
}

@keyframes quiz-modal-slide-in {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal Header */
.quiz-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.quiz-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.quiz-modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.quiz-modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.quiz-modal-close:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Modal Body */
.quiz-modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.quiz-modal-body .quiz-wrapper {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 2rem;
}

/* Modal Responsive */
@media (max-width: 768px) {
  .quiz-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }

  .quiz-modal-overlay {
    padding: 0;
  }

  .quiz-modal-header {
    padding: 1.25rem 1.5rem;
  }

  .quiz-modal-title {
    font-size: 1.25rem;
  }

  .quiz-modal-body .quiz-wrapper {
    padding: 1.5rem;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .quiz-wrapper {
    padding: 1.5rem;
  }

  .quiz-question {
    padding: 1.25rem;
  }

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

  .quiz-score h2 {
    font-size: 1.5rem;
  }

  .quiz-score-percentage {
    font-size: 2.25rem;
  }

  .quiz-badge-emoji {
    font-size: 3rem;
  }

  .quiz-badge-title {
    font-size: 1.25rem;
  }

  .quiz-share-buttons {
    flex-direction: column;
  }

  .quiz-share-btn {
    width: 100%;
    text-align: center;
  }
}

/* Accessibility */
.quiz-option:focus-within {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.quiz-submit-btn:focus {
  outline: 2px solid #0b5fff;
  outline-offset: 2px;
}

.quiz-share-btn:focus {
  outline: 2px solid #0b5fff;
  outline-offset: 2px;
}

