/**
 * fortune.css
 * 이모지 운세 페이지 스타일
 */

/* ============================================
   1) Hero 섹션
   ============================================ */
.fortune-hero {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  padding: 100px 20px 60px;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fortune-hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.fortune-hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Step Indicator */
.fortune-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
}

.fortune-step {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 10px 16px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.fortune-step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
}

.fortune-step__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.fortune-step__line {
  width: 15px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
}

/* Title & Subtitle */
.fortune-hero__title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  margin: 0 0 20px 0;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.fortune-hero__subtitle {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  line-height: 1.6;
  margin: 0;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* ============================================
   2) Main Content Section
   ============================================ */
.fortune-main {
  padding: 80px 20px;
  background: linear-gradient(180deg, transparent 0%, rgba(102, 126, 234, 0.05) 100%);
  min-height: 60vh;
}

/* ============================================
   3) 감정 선택 섹션
   ============================================ */
.fortune-mood-section {
  max-width: 900px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out;
}

.fortune-mood-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 15px;
}

.fortune-mood-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
}

/* Mood Grid */
.fortune-mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.fortune-mood-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 15px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333;
  min-height: 130px;
}

.fortune-mood-btn:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
}

.fortune-mood-btn:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.fortune-mood-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: white;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
  transform: translateY(-4px) scale(1.05);
}

.fortune-mood-btn__emoji {
  font-size: 2.5rem;
  line-height: 1;
}

.fortune-mood-btn__label {
  font-size: 0.8rem;
}

/* Selected Mood Display */
.fortune-selected-mood {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 8px;
  margin-bottom: 30px;
  animation: slideUp 0.3s ease-out;
}

.fortune-selected-mood-text {
  font-size: 1rem;
  font-weight: 600;
  color: #667eea;
  margin: 0;
}

#selected-mood-emoji {
  font-size: 1.3rem;
  margin: 0 5px;
}

/* ============================================
   4) Button Wrapper
   ============================================ */
.fortune-button-wrapper {
  display: flex;
  justify-content: center;
  margin: 40px 0;
}

.fortune-btn {
  padding: 16px 50px;
  font-size: 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.fortune-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   5) 로딩 상태
   ============================================ */
.fortune-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 60px 20px;
  animation: fadeIn 0.4s ease-out;
}

.fortune-loading__spinner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.fortune-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.fortune-loading__text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #667eea;
  animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.7;
  }
}

/* ============================================
   6) 결과 섹션
   ============================================ */
.fortune-result {
  max-width: 700px;
  margin: 0 auto;
  animation: fadeIn 0.6s ease-out;
}

/* Result Cards */
.fortune-result-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.fortune-result-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.fortune-result-card:hover {
  border-color: #667eea;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
  transform: translateY(-4px);
}

.fortune-message-card {
  border-left: 4px solid #667eea;
}

.fortune-advice-card {
  border-left: 4px solid #764ba2;
}

.fortune-result-card__label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #667eea;
  letter-spacing: 1px;
  margin-bottom: 15px;
  display: block;
}

.fortune-result-card__content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #333;
  margin: 0;
  min-height: 100px;
  display: flex;
  align-items: center;
}

/* Result Action Buttons */
.fortune-result-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.fortune-result-actions .btn {
  padding: 14px 20px;
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
}

/* ============================================
   7) 공유 섹션
   ============================================ */
.fortune-share {
  max-width: 500px;
  margin: 0 auto 50px;
  animation: slideUp 0.6s ease-out;
}

.fortune-share__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
  text-align: center;
  margin-bottom: 20px;
}

.fortune-share__card {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
}

.fortune-share__text {
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
  margin: 0 0 20px 0;
}

.fortune-share-copy-btn {
  width: 100%;
}

/* ============================================
   8) 다시 보기 섹션
   ============================================ */
.fortune-try-again {
  max-width: 500px;
  margin: 0 auto 50px;
  text-align: center;
  animation: slideUp 0.6s ease-out;
}

.fortune-try-again__text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 20px;
}

#try-again-btn {
  min-width: 200px;
}

/* ============================================
   9) Disclaimer 섹션
   ============================================ */
.fortune-disclaimer {
  background: linear-gradient(180deg, transparent 0%, rgba(102, 126, 234, 0.08) 100%);
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid rgba(102, 126, 234, 0.1);
}

.fortune-disclaimer__text {
  font-size: 0.95rem;
  color: #666;
  margin: 0;
  font-weight: 500;
}

/* ============================================
   10) 애니메이션
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   11) 모바일 반응형
   ============================================ */
@media (max-width: 1024px) {
  .fortune-hero {
    padding: 80px 20px 50px;
    min-height: 400px;
  }

  .fortune-mood-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
  }

  .fortune-mood-btn {
    min-height: 120px;
    padding: 15px 10px;
  }

  .fortune-mood-btn__emoji {
    font-size: 2rem;
  }

  .fortune-result-cards {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .fortune-hero {
    padding: 60px 20px 40px;
    min-height: 320px;
  }

  .fortune-hero__title {
    font-size: 2rem;
  }

  .fortune-hero__subtitle {
    font-size: 0.9rem;
  }

  .fortune-steps {
    gap: 10px;
    margin-bottom: 30px;
  }

  .fortune-step {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .fortune-step__number {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .fortune-mood-title {
    font-size: 1.4rem;
    margin-bottom: 30px;
  }

  .fortune-main {
    padding: 50px 15px;
  }

  .fortune-mood-grid {
    grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
    gap: 10px;
  }

  .fortune-mood-btn {
    min-height: 100px;
    padding: 12px 8px;
    font-size: 0.75rem;
  }

  .fortune-mood-btn__emoji {
    font-size: 1.8rem;
  }

  .fortune-button-wrapper {
    margin: 30px 0;
  }

  .fortune-btn {
    padding: 12px 40px;
    font-size: 0.9rem;
  }

  .fortune-result-card {
    padding: 20px;
  }

  .fortune-result-card__content {
    min-height: auto;
    font-size: 1rem;
  }

  .fortune-result-actions {
    gap: 10px;
  }

  .fortune-result-actions .btn {
    padding: 12px 15px;
    font-size: 0.85rem;
  }

  .fortune-share__card {
    padding: 20px;
  }

  .fortune-try-again__text {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .fortune-hero {
    padding: 50px 15px 30px;
    min-height: 280px;
  }

  .fortune-hero__title {
    font-size: 1.6rem;
    margin-bottom: 15px;
  }

  .fortune-hero__subtitle {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .fortune-steps {
    gap: 5px;
    flex-wrap: wrap;
  }

  .fortune-step {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  .fortune-step__line {
    display: none;
  }

  .fortune-main {
    padding: 40px 12px;
  }

  .fortune-mood-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
  }

  .fortune-mood-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .fortune-mood-btn {
    min-height: 90px;
    padding: 10px 6px;
    font-size: 0.7rem;
  }

  .fortune-mood-btn__emoji {
    font-size: 1.5rem;
  }

  .fortune-selected-mood {
    padding: 15px;
    margin-bottom: 20px;
  }

  .fortune-button-wrapper {
    margin: 20px 0;
  }

  .fortune-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
  }

  .fortune-loading {
    padding: 40px 15px;
    gap: 20px;
  }

  .fortune-result-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .fortune-result-actions .btn {
    width: 100%;
  }

  .fortune-result-card {
    padding: 15px;
  }

  .fortune-share__card {
    padding: 15px;
  }

  .fortune-disclaimer__text {
    font-size: 0.85rem;
  }
}

/* ============================================
   12) 다크 모드
   ============================================ */
[data-theme="dark"] .fortune-mood-title,
[data-theme="dark"] .fortune-share__title,
[data-theme="dark"] .fortune-result-card__content {
  color: #e0e0e0;
}

[data-theme="dark"] .fortune-mood-btn {
  background: #2a2a3e;
  border-color: #3a3a4e;
  color: #e0e0e0;
}

[data-theme="dark"] .fortune-mood-btn:hover {
  background: #333349;
  border-color: #667eea;
}

[data-theme="dark"] .fortune-mood-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="dark"] .fortune-selected-mood {
  background: rgba(102, 126, 234, 0.1);
  border: 1px solid rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .fortune-result-card {
  background: #2a2a3e;
  border-color: #3a3a4e;
}

[data-theme="dark"] .fortune-result-card:hover {
  border-color: #667eea;
}

[data-theme="dark"] .fortune-share__card {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .fortune-share__text {
  color: #e0e0e0;
}

[data-theme="dark"] .fortune-try-again__text {
  color: #a8c5ff;
}

[data-theme="dark"] .fortune-disclaimer__text {
  color: #999;
}

/* ============================================
   13) 감소된 동작 모드
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .fortune-hero__content,
  .fortune-mood-section,
  .fortune-result,
  .fortune-share,
  .fortune-try-again {
    animation: none !important;
  }

  .fortune-mood-btn,
  .fortune-result-card,
  .fortune-spinner {
    transition: none !important;
  }
}
