/* =============================================
   saju.css — 사주 페이지 스타일
   ============================================= */

/* 생년월일 입력 폼 */
.saju-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
}
.saju-form-row {
  display: flex;
  gap: 12px;
}
.saju-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(245, 235, 250, 0.6);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.3s;
}
.saju-input:focus {
  outline: none;
  border-color: var(--violet-500);
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.12);
}
.saju-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

/* 사주 팔자 차트 */
.saju-chart {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.saju-pillar {
  text-align: center;
  padding: 16px 8px;
  border-radius: var(--radius-md);
  background: rgba(245, 235, 250, 0.5);
  border: 1px solid rgba(167, 139, 250, 0.15);
}
.saju-pillar-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.saju-pillar-char {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

/* 사주 결과 영역 */
.saju-result {
  padding: 24px;
  margin-top: 20px;
  border-radius: var(--radius-md);
}
.saju-result-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}
.saju-result-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* 오행 속성 뱃지 */
.saju-element {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}
.saju-element--wood { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.saju-element--fire { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.saju-element--earth { background: rgba(234, 179, 8, 0.15); color: #facc15; }
.saju-element--metal { background: rgba(226, 232, 240, 0.15); color: #e2e8f0; }
.saju-element--water { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

/* ===== Card Layout ===== */
.saju-card {
  padding: 28px 24px;
  max-width: 520px;
  margin: 0 auto;
}
.saju-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.saju-card-icon {
  font-size: 28px;
  line-height: 1;
}
.saju-card-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
}

/* ===== Form Fields ===== */
.saju-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.saju-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.saju-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239890a8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.saju-select option {
  background: #FFF5EE;
  color: var(--text-primary);
}

/* Radio Buttons */
.saju-radio-group {
  display: flex;
  gap: 20px;
}
.saju-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
}
.saju-radio input[type="radio"] {
  display: none;
}
.saju-radio-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(167, 139, 250, 0.3);
  position: relative;
  transition: border-color 0.3s;
}
.saju-radio input[type="radio"]:checked + .saju-radio-mark {
  border-color: var(--violet-500);
}
.saju-radio input[type="radio"]:checked + .saju-radio-mark::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet-500);
}

/* Toggle Switch */
.saju-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.saju-toggle-label {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.3s;
}
.saju-toggle-label.active {
  color: var(--text-accent);
}
.saju-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.saju-toggle input {
  display: none;
}
.saju-toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(167, 139, 250, 0.2);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.3s;
}
.saju-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--text-accent);
  border-radius: 50%;
  transition: transform 0.3s;
}
.saju-toggle input:checked + .saju-toggle-slider {
  background: rgba(167, 139, 250, 0.4);
}
.saju-toggle input:checked + .saju-toggle-slider::before {
  transform: translateX(20px);
}

/* Submit */
.saju-submit-btn {
  margin-top: 8px;
  width: 100%;
}

/* ===== Loading ===== */
.saju-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}
.saju-loading-bagua {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 24px;
}
.saju-bagua-ring {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid transparent;
}
.saju-bagua-ring:nth-child(1) {
  border-top-color: var(--violet-500);
  border-right-color: rgba(167, 139, 250, 0.3);
  animation: sajuSpin 2s linear infinite;
}
.saju-bagua-ring:nth-child(2) {
  top: 10px; left: 10px;
  width: 80px; height: 80px;
  border-bottom-color: var(--purple-500);
  border-left-color: rgba(168, 85, 247, 0.3);
  animation: sajuSpin 2.5s linear infinite reverse;
}
.saju-bagua-core {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  animation: sajuPulse 1.5s ease-in-out infinite;
}
@keyframes sajuSpin {
  to { transform: rotate(360deg); }
}
@keyframes sajuPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}
.saju-loading-text {
  font-size: 15px;
  color: var(--text-secondary);
  animation: fadeIn 0.6s ease;
}

/* ===== Result Section ===== */
.saju-result-section {
  max-width: 520px;
  margin: 0 auto;
}
.saju-result-card {
  padding: 24px;
  margin-bottom: 16px;
}
.saju-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.saju-result-icon {
  font-size: 22px;
  line-height: 1;
}

/* Pillar element coloring */
.saju-cheongan {
  color: var(--text-accent);
}
.saju-jiji {
  color: var(--gold);
}
.saju-pillar-divider {
  width: 24px;
  height: 1px;
  background: rgba(167, 139, 250, 0.2);
  margin: 6px auto;
}

/* ===== 오행 Bar Chart ===== */
.saju-oheng {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.saju-oheng-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.saju-oheng-name {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.saju-oheng-bar {
  flex: 1;
  height: 10px;
  background: rgba(245, 235, 250, 0.6);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.saju-oheng-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease-out;
}
.saju-oheng-fill[data-element="wood"] { background: linear-gradient(90deg, #22c55e, #4ade80); }
.saju-oheng-fill[data-element="fire"] { background: linear-gradient(90deg, #ef4444, #f87171); }
.saju-oheng-fill[data-element="earth"] { background: linear-gradient(90deg, #eab308, #facc15); }
.saju-oheng-fill[data-element="metal"] { background: linear-gradient(90deg, #94a3b8, #e2e8f0); }
.saju-oheng-fill[data-element="water"] { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.saju-oheng-pct {
  width: 36px;
  text-align: right;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* ===== Lucky Items ===== */
.saju-lucky {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.saju-lucky-item {
  text-align: center;
  padding: 16px 8px;
  background: rgba(245, 235, 250, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(167, 139, 250, 0.1);
}
.saju-lucky-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.saju-lucky-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-accent);
}

/* ===== Action Buttons ===== */
.saju-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  padding-bottom: 20px;
}
.saju-share-btn,
.saju-insta-btn,
.saju-retry-btn {
  flex: 1;
  max-width: 180px;
  text-align: center;
  font-size: 13px;
}
.saju-insta-btn {
  border-color: rgba(225, 48, 108, 0.4);
  color: #E1306C;
}
.saju-insta-btn:hover {
  background: rgba(225, 48, 108, 0.08);
  border-color: #E1306C;
}

/* ===== Profile Summary ===== */
.saju-profile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 20px;
  background: rgba(245, 235, 250, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(167, 139, 250, 0.12);
}
.saju-profile-info {
  font-size: 13px;
  color: var(--text-secondary);
}
.saju-edit-profile-btn {
  font-size: 12px;
  color: var(--text-accent);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== Period Grid ===== */
.saju-period-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.saju-period-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 0 16px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(167, 139, 250, 0.12);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.saju-period-btn:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 36px rgba(167, 139, 250, 0.15), 0 0 20px rgba(251, 191, 36, 0.06);
  border-color: rgba(167, 139, 250, 0.3);
}
.saju-period-btn:active {
  transform: translateY(-2px) scale(0.98);
  transition: transform 0.1s ease;
}
.saju-period-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--violet-400), var(--gold), var(--violet-400), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.saju-period-btn:hover::before {
  opacity: 1;
}
.saju-period-illust {
  width: 100%;
  height: 120px;
  object-fit: cover;
  image-rendering: high-quality;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.saju-period-btn:hover .saju-period-illust {
  transform: scale(1.08);
}
.saju-period-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}
.saju-period-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

/* 기간 버튼 stagger 입장 */
.saju-period-btn {
  animation: sajuPeriodIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.saju-period-btn:nth-child(1) { animation-delay: 0.05s; }
.saju-period-btn:nth-child(2) { animation-delay: 0.12s; }
.saju-period-btn:nth-child(3) { animation-delay: 0.19s; }
.saju-period-btn:nth-child(4) { animation-delay: 0.26s; }
@keyframes sajuPeriodIn {
  0% { opacity: 0; transform: translateY(30px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Category Section ===== */
.saju-category-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 10px;
}
.saju-category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.saju-category-btn {
  padding: 8px 16px;
  font-size: 13px;
  background: rgba(245, 235, 250, 0.5);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.25s;
}
.saju-category-btn:hover {
  background: rgba(167, 139, 250, 0.12);
  border-color: var(--violet-500);
}

/* ===== Save Prompt ===== */
.saju-save-prompt {
  max-width: 520px;
  margin: 0 auto 16px;
  padding: 16px 20px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  text-align: center;
}
.saju-save-prompt p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.saju-save-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.saju-save-profile-btn,
.saju-skip-save-btn {
  font-size: 13px;
  padding: 8px 20px;
}

/* ===== Monthly Fortune ===== */
.saju-monthly-card {
  padding: 24px;
}
.saju-monthly-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.saju-month-item {
  padding: 16px;
  background: rgba(245, 235, 250, 0.4);
  border: 1px solid rgba(167, 139, 250, 0.12);
  border-radius: var(--radius-md);
  transition: all 0.25s;
}
.saju-month-item:hover {
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.25);
}
.saju-month-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.saju-month-emoji {
  font-size: 20px;
}
.saju-month-label {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-accent);
}
.saju-month-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .saju-card {
    padding: 20px 16px;
  }
  .saju-lucky {
    grid-template-columns: 1fr;
  }
  .saju-pillar-char {
    font-size: 20px;
  }
}
