/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans KR", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  color: #2c3e50;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Language Toggle */
.language-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 25px;
  padding: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  z-index: 1000;
}

.lang-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  color: #6c757d;
}

.lang-btn.active {
  background: #667eea;
  color: white;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.lang-btn:hover:not(.active) {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

/* Screen Management */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  pointer-events: none;
}

.screen.active {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.content {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 600px;
  text-align: center;
}

/* Typography */
.title {
  font-size: 2.2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 16px;
  line-height: 1.3;
}

.subtitle {
  font-size: 1.1rem;
  color: #6c757d;
  margin-bottom: 24px;
  font-weight: 400;
}

.intro-text {
  font-size: 1rem;
  color: #495057;
  margin-bottom: 32px;
  text-align: left;
  line-height: 1.7;
}

/* Buttons */
.btn {
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
  border: 2px solid rgba(108, 117, 125, 0.2);
}

.btn-secondary:hover {
  background: rgba(108, 117, 125, 0.2);
  transform: translateY(-1px);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
}

.question-counter {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 32px;
  font-weight: 500;
}

/* Question Card */
.question-card {
  text-align: left;
  margin-bottom: 32px;
}

.question-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 16px;
  text-align: center;
}

.question-text {
  font-size: 1.1rem;
  color: #495057;
  margin-bottom: 24px;
  padding: 20px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 12px;
  border-left: 4px solid #667eea;
  font-weight: 500;
}

/* Answer Options */
.answers-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-option {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(102, 126, 234, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.5;
}

.answer-option:hover {
  background: rgba(102, 126, 234, 0.05);
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-1px);
}

.answer-option.selected {
  background: rgba(102, 126, 234, 0.1);
  border-color: #667eea;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

/* Results */
.result-title {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 32px;
}

.result-type {
  margin-bottom: 32px;
  padding: 24px;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  border-radius: 16px;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.result-type-title {
  font-size: 1.4rem;
  color: #667eea;
  margin-bottom: 12px;
  font-weight: 600;
}

.result-description {
  font-size: 1rem;
  color: #495057;
  line-height: 1.6;
}

.result-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: left;
}

.result-section {
  padding: 20px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.result-section h3 {
  font-size: 1.1rem;
  color: #2c3e50;
  margin-bottom: 12px;
  font-weight: 600;
}

.result-section p {
  color: #495057;
  line-height: 1.6;
  margin-bottom: 0;
}

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

.suggestion-item {
  padding: 12px 16px;
  background: rgba(40, 167, 69, 0.05);
  border-radius: 8px;
  border-left: 3px solid #28a745;
  font-size: 0.95rem;
  color: #495057;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .content {
    padding: 24px;
    margin-top: 20px;
  }

  /* Only add more top margin for welcome screen on mobile */
  .welcome-screen .content {
    margin-top: 60px;
  }

  /* Quiz screen needs minimal top margin */
  .quiz-screen .content {
    margin-top: 10px;
  }

  .title {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .intro-text {
    font-size: 0.95rem;
  }

  .question-title {
    font-size: 1.2rem;
  }

  .question-text {
    font-size: 1rem;
    padding: 16px;
  }

  .answer-option {
    padding: 14px 16px;
    font-size: 0.9rem;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
  }

  .result-title {
    font-size: 1.6rem;
  }

  .result-type-title {
    font-size: 1.2rem;
  }

  .language-toggle {
    top: 12px;
    right: 12px;
    padding: 3px;
  }

  .lang-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 16px;
    margin-top: 16px;
  }

  /* Welcome screen specific spacing on small mobile */
  .welcome-screen .content {
    margin-top: 50px;
  }

  /* Quiz screen - even less margin on small mobile */
  .quiz-screen .content {
    margin-top: 8px;
  }

  .title {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .intro-text {
    font-size: 0.85rem;
  }

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

  .question-text {
    padding: 12px;
    font-size: 0.9rem;
  }

  .answer-option {
    padding: 12px;
    font-size: 0.85rem;
  }

  .result-section {
    padding: 16px;
  }

  .result-title {
    font-size: 1.4rem;
  }

  .result-type-title {
    font-size: 1.1rem;
  }

  /* Reduce progress bar and counter spacing */
  .progress-bar {
    margin-bottom: 12px;
  }

  .question-counter {
    margin-bottom: 16px;
    font-size: 0.85rem;
  }

  /* Quiz card spacing optimization */
  .question-card {
    margin-bottom: 20px;
  }

  /* Smaller language toggle on very small screens */
  .language-toggle {
    top: 8px;
    right: 8px;
    padding: 2px;
  }

  .lang-btn {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 15px;
  }
}

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

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Loading State */
.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States */
.btn:focus,
.answer-option:focus,
.lang-btn:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .content {
    background: white;
    border: 2px solid #000;
  }

  .answer-option {
    border-color: #000;
  }

  .answer-option.selected {
    background: #000;
    color: white;
  }
}
