/* Quiz Modal Styles */
.quiz-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.quiz-overlay.active {
  opacity: 1;
  visibility: visible;
}

.quiz-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 0;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  transform: scale(0.8) translateY(50px);
  transition: all 0.3s ease;
}

.quiz-overlay.active .quiz-container {
  transform: scale(1) translateY(0);
}

.quiz-header {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px 30px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.quiz-title {
  color: white;
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 10px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.quiz-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.progress-bar {
  width: 200px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f260, #0575e6);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.quiz-content {
  padding: 30px;
  background: white;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.question-container {
  text-align: center;
  margin-bottom: 30px;
}

.question-number {
  color: #667eea;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.question-text {
  font-size: 20px;
  font-weight: 600;
  color: #2d3748;
  line-height: 1.4;
  margin-bottom: 30px;
}

.options-container {
  display: grid;
  gap: 15px;
  margin-bottom: 30px;
}

.option-btn {
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 500;
  color: #2d3748;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.option-btn:hover {
  border-color: #667eea;
  background: #edf2f7;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.option-btn.selected {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

.option-btn.correct {
  border-color: #48bb78;
  background: #48bb78;
  color: white;
  animation: correctPulse 0.6s ease;
}

.option-btn.wrong {
  border-color: #f56565;
  background: #f56565;
  color: white;
  animation: wrongShake 0.6s ease;
}

.option-btn.disabled {
  pointer-events: none;
  opacity: 0.7;
}

.option-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.option-btn.correct .option-icon,
.option-btn.wrong .option-icon {
  opacity: 1;
}

.quiz-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.next-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.next-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.next-btn:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.close-btn {
  background: #e2e8f0;
  color: #4a5568;
}

.close-btn:hover {
  background: #cbd5e0;
}

.quiz-timer {
  font-size: 18px;
  font-weight: 600;
  color: #667eea;
}

/* Results Screen */
.results-container {
  text-align: center;
  padding: 40px 30px;
}

.results-score {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.results-message {
  font-size: 20px;
  color: #2d3748;
  margin-bottom: 30px;
}

.results-details {
  background: #f7fafc;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
}

.result-stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 16px;
}

.result-stat:last-child {
  margin-bottom: 0;
}

.results-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.restart-btn {
  background: linear-gradient(135deg, #48bb78, #38a169);
  color: white;
}

.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

/* Quiz Trigger Button */
.quiz-trigger-btn {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  z-index: 1000;
}

.quiz-trigger-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

/* Animations */
@keyframes correctPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes wrongShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .quiz-container {
    width: 95%;
    margin: 20px;
  }

  .quiz-content {
    padding: 20px;
  }

  .question-text {
    font-size: 18px;
  }

  .option-btn {
    padding: 12px 15px;
    font-size: 14px;
  }

  .results-score {
    font-size: 36px;
  }

  .quiz-trigger-btn {
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}
