@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap");

:root {
  --primary: #f0f0f3;
  --accent: #8ecae6;
  --text: #111111;
  --top-shadow: #f6f1f1;
  --bottom-shadow: #d1d9e6;
  --glow: #1f51ff;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
}

body.dark-mode {
  --primary: #1f1f1f;
  --accent: #00c896;
  --text: #ffffff;
  --top-shadow: #2a2a2a;
  --bottom-shadow: #0d0d0d;
  --glow: #39ff14;
  --success: #059669;
  --error: #dc2626;
  --warning: #d97706;
  --color: var(--text);
  background-color: var(--accent);
  background-image: linear-gradient(
      0deg,
      transparent 24%,
      var(--color) 25%,
      var(--color) 26%,
      transparent 27%,
      transparent 74%,
      var(--color) 75%,
      var(--color) 76%,
      transparent 77%,
      transparent
    ),
    linear-gradient(
      90deg,
      transparent 24%,
      var(--color) 25%,
      var(--color) 26%,
      transparent 27%,
      transparent 74%,
      var(--color) 75%,
      var(--color) 76%,
      transparent 77%,
      transparent
    );
  background-size: 55px 55px;
  background-attachment: fixed;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Outfit", sans-serif;
  background: var(--primary);
}

/* Quiz Container */
.quiz-container {
  /* max-width: 900px; */
  width: 90vw;
  margin: 0 auto;
  background: var(--primary);
  border-radius: 20px;
  padding: 2rem;
  color: var(--text);
  position: relative;
  border: 2px solid;
  border-color: var(--accent);
}

/* Quiz Header */
.quiz-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--accent);
  border-radius: 15px;
  color: var(--text);
}

.quiz-title {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.quiz-info {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.quiz-badge {
  background: var(--primary);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  border: 2px solid var(--accent);
}

.quiz-timer {
  background: var(--primary);
  color: var(--text);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 1.2rem;
}

/* Progress Bar */
.quiz-progress {
  margin-bottom: 2rem;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--accent);
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border: 2px solid var(--accent);
  border-radius: 5px;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  margin-top: 1rem;
  color: var(--text);
  font-weight: 600;
}

/* Question Section */
.quiz-question {
  margin-bottom: 2rem;
}

.question-number {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1rem;
}

.question-text {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: var(--text);
  line-height: 1.4;
}

/* Quiz Options */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--primary);
  border: 2px solid var(--accent);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text);
}

.quiz-option:hover {
  background: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}

.quiz-option.selected {
  background: var(--accent);
  color: var(--text);
  border-color: var(--text);
}

.option-letter {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: var(--text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
}

.option-text {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 500;
}

.option-radio {
  display: none;
}

/* Navigation */
.quiz-navigation {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.nav-btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  background: var(--accent);
  color: var(--text);
  border: 2px solid var(--primary);
}

.nav-btn:hover:not(:disabled) {
  background: var(--primary);
  color: var(--text);
  transform: translateY(-2px);
}

.nav-btn:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Actions */
.quiz-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.action-btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  background: var(--accent);
  color: var(--text);
  border: 2px solid var(--primary);
}

.action-btn:hover {
  background: var(--primary);
  color: var(--accent);
  transform: translateY(-2px);
}

/* Results Modal */
.results-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

/* Player Name Modal */
.player-name-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--primary);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 20px 20px 60px var(--bottom-shadow), -20px -20px 60px var(--top-shadow);
  animation: slideInUp 0.4s ease-out;
  text-align: center;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
}

.modal-header h2 {
  color: var(--text);
  font-size: 1.8rem;
  margin: 0 auto;
}

.close-modal {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-modal:hover {
  background: var(--accent);
  color: var(--text);
}

/* Player Name Input Styles */
#playerNameInput {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--accent);
  border-radius: 10px;
  font-size: 1.1rem;
  background: var(--primary);
  color: var(--text);
  margin-bottom: 1.5rem;
  text-align: center;
}

#playerNameInput:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

#playerNameInput::placeholder {
  color: var(--text);
  opacity: 0.6;
}

.modal-body p {
  color: var(--text);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.score-percentage {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
}

.score-text {
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.8;
}

.score-details {
  flex: 1;
}

.score-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bottom-shadow);
}

.score-label {
  color: var(--text);
  font-weight: 500;
}

.score-value {
  color: var(--accent);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 5px 5px 15px var(--bottom-shadow), -5px -5px 15px var(--top-shadow);
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 8px 8px 20px var(--bottom-shadow), -8px -8px 20px var(--top-shadow);
}

.primary-btn {
  background: var(--accent);
  color: var(--text);
}

.secondary-btn {
  background: var(--primary);
  color: var(--text);
}

/* Quiz Loader */
.quiz-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.quiz-loader .main {
    transform: scale(0.8);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }

  .quiz-container {
    padding: 1.5rem;
  }

  .quiz-title {
    font-size: 1.5rem;
  }

  .quiz-info {
    flex-direction: column;
    gap: 0.5rem;
  }

  .question-text {
    font-size: 1.2rem;
  }

  .quiz-option {
    padding: 1rem;
  }

  .option-letter {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .nav-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .action-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .score-display {
    flex-direction: column;
    gap: 1rem;
  }

  .score-circle {
    width: 100px;
    height: 100px;
  }

  .score-percentage {
    font-size: 1.5rem;
  }

  .modal-actions {
    flex-direction: column;
  }
}
