* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --background: #0f172a;
  --surface: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --border-radius: 16px;
  --transition: all 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--background) 0%, #1e293b 100%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  border-radius: var(--border-radius);
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.title-icon {
  font-size: 2rem;
  opacity: 0.8;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

h1 {
  font-size: 2.5rem;
  margin: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 24px;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 1.1rem;
}

.btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  padding: 16px 32px;
  font-size: 1.1rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  width: 100%;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  margin-top: 24px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary-color);
  transform: translateX(-4px);
}

.btn-secondary:active {
  transform: translateX(0);
}

.quiz-length-selection {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.btn-length {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 24px;
}

.btn-label {
  font-size: 1.2rem;
  font-weight: 700;
}

.btn-sublabel {
  font-size: 0.9rem;
  opacity: 0.9;
  font-weight: 400;
}

.question-container {
  margin-bottom: 32px;
}

.question-number {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.question-text {
  font-size: 1.3rem;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 16px 20px;
  font-size: 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-weight: 500;
}

.answer-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin-bottom: 32px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
  border-radius: 3px;
}

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

.result-ajah {
  font-size: 3rem;
  font-weight: bold;
  margin: 24px 0 16px 0;
  padding: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.ajah-description {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 32px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

.chart-header {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-weight: 600;
}

#pie-chart {
  margin: 24px auto;
  display: block;
  max-width: 100%;
  height: auto;
}

.chart-container {
  margin: 32px 0;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
}

.chart-bar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.chart-label {
  width: 80px;
  font-weight: 600;
  font-size: 0.9rem;
}

.chart-bar-container {
  flex: 1;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  margin: 0 12px;
}

.chart-bar-fill {
  height: 100%;
  transition: width 0.8s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.chart-percentage {
  min-width: 45px;
  text-align: right;
  font-size: 0.9rem;
  font-weight: 600;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .container {
    padding: 24px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

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

  .result-ajah {
    font-size: 2.5rem;
  }

  .chart-label {
    width: 60px;
    font-size: 0.8rem;
  }

  .quiz-length-selection {
    flex-direction: column;
  }

  .btn-length {
    width: 100%;
  }

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

  #pie-chart {
    width: 250px;
    height: 250px;
  }
}

