:root {
  --primary: #4285f4;
  --primary-dark: #3367d6;
  --accent: #34a853;
  --success: #34a853;
  --error: #ea4335;
  --light: #ffffff;
  --dark: #202124;
  --gray: #5f6368;
  --bg-light: #f8f9fa;
  --text-dark: #202124;
  --border-radius: 12px;
  --box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  min-height: 100vh;
  padding: 2rem;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Header */
.quiz-header {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
}

.quiz-badge {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.quiz-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.quiz-description {
  color: var(--gray);
  margin-bottom: 2rem;
  font-size: 1.1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Quiz Container */
.quiz-container {
  background: var(--light);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  box-shadow: var(--box-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

/* Timer & Progress */
.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: rgba(0, 0, 0, 0.03);
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.quiz-timer {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dark);
}

.timer-icon {
  color: var(--primary);
}

.time-critical {
  color: var(--error);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 300px;
}

.progress-text {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  color: var(--gray);
}

.progress-bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 5px;
  flex-grow: 1;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.3) 100%
  );
  animation: shine 2s infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Questions */
.question-card {
  margin-bottom: 2rem;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.question-text {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
  line-height: 1.4;
}

.options {
  display: grid;
  gap: 1rem;
}

.option {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  color: var(--text-dark);
}

.option:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.option input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.option.selected {
  border-color: var(--primary);
  background: rgba(66, 133, 244, 0.1);
  box-shadow: 0 0 0 2px var(--primary);
}

.option.correct {
  border-color: var(--success);
  background: rgba(52, 168, 83, 0.1);
  box-shadow: 0 0 0 2px var(--success);
  animation: correctPulse 0.5s;
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.option.incorrect {
  border-color: var(--error);
  background: rgba(234, 67, 53, 0.1);
  box-shadow: 0 0 0 2px var(--error);
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* Buttons */
.quiz-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(66, 133, 244, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-dark);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

/* Results */
.result-container {
  text-align: center;
  padding: 3rem;
  background: var(--light);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  display: none;
  animation: fadeIn 0.5s ease-out;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.result-badge {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 3rem;
  box-shadow: 0 8px 32px rgba(66, 133, 244, 0.3);
  animation: bounce 1s;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.result-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result-score {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-family: 'Poppins', sans-serif;
  color: var(--text-dark);
}

.result-message {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-dark);
}

.fact-box {
  background: rgba(0, 0, 0, 0.03);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin: 2rem auto;
  text-align: left;
  border-left: 4px solid var(--accent);
  max-width: 600px;
}

.fact-box h4 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fact-box p {
  line-height: 1.6;
  color: var(--text-dark);
}

/* Confetti */
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: var(--primary);
  opacity: 0;
  animation: confetti-fall 3s linear forwards;
  z-index: 10;
}

@keyframes confetti-fall {
  0% { 
    transform: translateY(-100px) rotate(0deg); 
    opacity: 1;
  }
  100% { 
    transform: translateY(1000px) rotate(720deg); 
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }
  .quiz-title {
    font-size: 2rem;
  }
  .quiz-container, .result-container {
    padding: 1.5rem;
  }
  .quiz-meta {
    flex-direction: column;
    gap: 1rem;
  }
  .progress-container {
    max-width: 100%;
  }
  .quiz-footer {
    flex-direction: column-reverse;
    gap: 1rem;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
}