/* GEMTI - 나와 어울리는 보석 찾기 */

/* CSS 변수 정의 */
:root {
  --pastel-pink: #FFB5E8;
  --pastel-peach: #FFCBA4;
  --pastel-yellow: #FFF5BA;
  --pastel-green: #B5FFD9;
  --pastel-blue: #B5DEFF;
  --pastel-purple: #DCD3FF;
  --pastel-lavender: #E8B5FF;

  --text-primary: #2D3436;
  --text-secondary: #636E72;
  --white: #FFFFFF;
  --shadow: rgba(0, 0, 0, 0.1);
}

/* 기본 리셋 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(
    135deg,
    var(--pastel-pink) 0%,
    var(--pastel-peach) 15%,
    var(--pastel-yellow) 30%,
    var(--pastel-green) 45%,
    var(--pastel-blue) 60%,
    var(--pastel-purple) 75%,
    var(--pastel-lavender) 90%,
    var(--pastel-pink) 100%
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 배경 보석 애니메이션 */
.gem-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-gem {
  position: absolute;
  font-size: 2rem;
  opacity: 0.3;
  animation: floatUp linear infinite;
  filter: blur(1px);
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* 메인 컨테이너 */
.container {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 화면 전환 */
.screen {
  display: none;
  flex-direction: column;
  min-height: calc(100vh - 40px);
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: flex;
}

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

/* 시작 화면 */
.header {
  text-align: center;
  padding: 40px 0 20px;
}

.logo {
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #FF6B6B, #FFE66D, #4ECDC4, #A66CFF);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
  letter-spacing: 0.1em;
}

@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.intro-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

.gem-icon-large {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: pulse 2s ease-in-out infinite;
}

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

.intro-content h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.8;
}

.features {
  list-style: none;
  margin-bottom: 32px;
}

.features li {
  padding: 8px 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
  padding-left: 24px;
}

.features li::before {
  content: '✨';
  position: absolute;
  left: 0;
}

/* 버튼 스타일 */
.btn {
  padding: 16px 40px;
  font-size: 1.1rem;
  font-weight: 500;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.btn-secondary {
  background: var(--white);
  color: var(--text-primary);
  border: 2px solid var(--pastel-purple);
}

.btn-secondary:hover {
  background: var(--pastel-purple);
  color: var(--white);
}

.footer {
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* 퀴즈 화면 */
.quiz-header {
  padding: 20px 0;
}

.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

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

.progress-text {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.quiz-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 0;
}

.question {
  font-size: 1.3rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.6;
  color: var(--text-primary);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.answer-btn {
  padding: 18px 24px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
  box-shadow: 0 2px 10px var(--shadow);
}

.answer-btn:hover {
  background: var(--white);
  border-color: var(--pastel-purple);
  transform: translateX(8px);
  box-shadow: 0 4px 15px var(--shadow);
}

.answer-btn:active {
  transform: translateX(4px);
}

/* 로딩 화면 */
.loading-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.loading-gems {
  font-size: 3rem;
  margin-bottom: 24px;
}

.loading-gems span {
  display: inline-block;
  animation: bounce 1s ease-in-out infinite;
}

.loading-gems span:nth-child(1) { animation-delay: 0s; }
.loading-gems span:nth-child(2) { animation-delay: 0.2s; }
.loading-gems span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.loading-content h2 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.loading-content p {
  color: var(--text-secondary);
}

/* 결과 화면 */
.result-header {
  text-align: center;
  padding: 30px 0 20px;
}

.result-label {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.gem-name {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

.result-content {
  flex: 1;
  padding: 0 10px;
}

.gem-image-container {
  text-align: center;
  margin-bottom: 24px;
}

.gem-image {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border: 4px solid var(--white);
}

.keywords {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.keyword {
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #5a4a78;
  border: 1px solid rgba(102, 126, 234, 0.3);
}

.gem-description {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px var(--shadow);
}

.gem-description h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text-primary);
  text-align: center;
}

.description-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: center;
}

.description-text p {
  margin-bottom: 8px;
}

.gem-info {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.gem-info h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text-primary);
  text-align: center;
}

.gem-info p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: center;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 10px;
  margin-bottom: 24px;
}

.result-actions .btn {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
}

.result-footer {
  text-align: center;
  padding: 20px;
}

.result-footer p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.copyright {
  font-size: 0.8rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* 반응형 디자인 */
@media (max-width: 480px) {
  .container {
    padding: 15px;
  }

  .logo {
    font-size: 2.8rem;
  }

  .gem-icon-large {
    font-size: 4rem;
  }

  .intro-content h2 {
    font-size: 1.3rem;
  }

  .question {
    font-size: 1.15rem;
    min-height: 70px;
  }

  .answer-btn {
    padding: 15px 20px;
    font-size: 0.95rem;
  }

  .gem-name {
    font-size: 2rem;
  }

  .gem-image {
    width: 160px;
    height: 160px;
  }

  .keyword {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .result-actions {
    flex-direction: column;
    align-items: center;
  }

  .result-actions .btn {
    width: 100%;
    max-width: none;
  }
}

/* 접근성 - 모션 감소 설정 존중 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
  .btn-primary {
    background: #333;
    color: #fff;
  }

  .answer-btn {
    border: 2px solid #333;
  }

  .keyword {
    border: 2px solid #333;
    background: #fff;
  }
}

/* ============================================
   추가 페이지 스타일 (애드센스 필수 페이지)
   ============================================ */

/* 정보 섹션 */
.info-section {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  padding: 24px;
  margin: 20px 0;
  text-align: left;
}

.info-section h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.info-section h4 {
  font-size: 1rem;
  margin: 20px 0 12px;
  color: var(--text-primary);
}

.info-section p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.gem-list-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gem-list-preview span {
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
  border-radius: 15px;
  font-size: 0.8rem;
  color: #5a4a78;
}

/* 푸터 네비게이션 */
.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 16px;
}

.footer-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.disclaimer {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* 페이지 콘텐츠 스타일 */
.page-content {
  padding: 20px 0;
}

.page-header {
  margin-bottom: 24px;
}

.back-btn {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  margin-bottom: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px var(--shadow);
}

.back-btn:hover {
  background: var(--white);
  transform: translateX(-4px);
}

.page-header h1 {
  font-size: 1.8rem;
  color: var(--text-primary);
  text-align: center;
}

.page-body {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 30px 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px var(--shadow);
}

.page-body article {
  max-width: 100%;
}

.page-body h2 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--pastel-purple);
}

.page-body h2:first-child {
  margin-top: 0;
}

.page-body h3 {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin: 20px 0 10px;
}

.page-body p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.page-body ul,
.page-body ol {
  margin: 12px 0;
  padding-left: 24px;
}

.page-body li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.page-body strong {
  color: var(--text-primary);
}

.page-footer {
  text-align: center;
  padding: 20px;
}


/* 반응형 - 페이지 콘텐츠 */
@media (max-width: 480px) {
  .page-header h1 {
    font-size: 1.5rem;
  }

  .page-body {
    padding: 20px 16px;
  }

  .page-body h2 {
    font-size: 1.1rem;
  }

  .footer-nav {
    gap: 4px 12px;
  }

  .footer-link {
    font-size: 0.8rem;
  }

  .info-section {
    padding: 20px 16px;
  }

  .gem-list-preview span {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
}

/* 토스트 메시지 */
.toast-message {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 0.95rem;
  z-index: 9999;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}
