/* ========================================
   프리미엄 사주 페이지 스타일
   SARO Dark + Gold 테마
   ======================================== */

.hidden { display: none !important; }

.premium-page {
  padding-top: 80px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* 프리미엄 뱃지 */
.premium-badge {
  display: inline-block;
  background: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
  color: #1a1c26;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 4px 16px;
  border-radius: 20px;
  margin: 0 auto 0.8rem;
  text-align: center;
}

.premium-page .section-title,
.premium-page .section-desc {
  text-align: center;
}

.premium-page .section-title {
  background: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.3));
}

/* 입력 폼 (기존 사주 스타일 재사용) */
.saju-form {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  position: relative;
  background: rgba(20, 22, 30, 0.4);
  border: 1px solid rgba(205, 170, 80, 0.12);
  border-radius: 20px;
  backdrop-filter: blur(5px);
}

.saju-form::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 190, 70, 0.5), transparent);
}

.form-row { display: flex; gap: 1rem; margin-bottom: 1.2rem; }
.form-group { flex: 1; }
.form-group label { display: block; color: var(--gray); font-size: 0.85rem; margin-bottom: 0.4rem; }

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(20, 22, 30, 0.8);
  border: 1px solid rgba(205, 170, 80, 0.25);
  border-radius: 10px;
  color: var(--white);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: rgba(230, 190, 70, 0.6);
  box-shadow: 0 0 12px rgba(230, 190, 70, 0.15);
}

.form-group input::placeholder { color: rgba(160, 152, 144, 0.5); }
.form-group select option { background: #1a1c26; color: var(--white); }

.gender-btns { display: flex; gap: 0.5rem; }

.gender-btn, .calendar-btn {
  flex: 1;
  padding: 0.75rem;
  background: rgba(20, 22, 30, 0.8);
  border: 1px solid rgba(205, 170, 80, 0.2);
  border-radius: 10px;
  color: var(--gray);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s;
}

.gender-btn.active, .calendar-btn.active {
  background: linear-gradient(145deg, rgba(205, 170, 80, 0.15) 0%, rgba(160, 130, 50, 0.06) 100%);
  border-top-color: rgba(255, 235, 150, 0.4);
  border-left-color: rgba(255, 235, 150, 0.3);
  border-bottom-color: rgba(140, 110, 40, 0.4);
  border-right-color: rgba(140, 110, 40, 0.3);
  color: var(--gold);
  font-weight: 600;
}

.btn-full { width: 100%; margin-top: 0.5rem; padding: 1rem; font-size: 1.1rem; }

.btn-premium {
  background: linear-gradient(135deg, #bf953f, #b38728) !important;
  color: #1a1c26 !important;
  font-weight: 700;
  letter-spacing: 1px;
  border: none;
  box-shadow: 0 4px 20px rgba(179, 135, 40, 0.4);
}

.btn-premium:hover {
  background: linear-gradient(135deg, #d4a84b, #c99a30) !important;
  box-shadow: 0 6px 30px rgba(179, 135, 40, 0.6);
  transform: translateY(-2px);
}

/* ─── 결과 영역 ─── */

.result-header {
  text-align: center;
  margin-bottom: 2rem;
}

.result-summary {
  color: var(--gray);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* 섹션 카드 */
.section-card {
  background: rgba(20, 22, 30, 0.5);
  border: 1px solid rgba(205, 170, 80, 0.12);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(5px);
  position: relative;
}

.section-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230, 190, 70, 0.3), transparent);
}

.card-title {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── 사주팔자 차트 (프리미엄) ─── */

.saju-chart-premium {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pillar-premium {
  text-align: center;
  min-width: 100px;
  flex: 1;
  max-width: 140px;
}

.pillar-header {
  font-size: 0.8rem;
  color: var(--gray);
  margin-bottom: 0.6rem;
  letter-spacing: 1px;
}

.me-tag {
  background: var(--gold);
  color: #1a1c26;
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  font-weight: 700;
}

.pillar-cell {
  width: 80px;
  height: 80px;
  margin: 0 auto 0.3rem;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.6s ease;
  position: relative;
}

.pillar-cell .char {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
}

.pillar-cell .hanja {
  font-size: 0.65rem;
  opacity: 0.6;
  margin-top: 2px;
}

.pillar-cell.gan {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.25);
  color: var(--gold);
}

.pillar-cell.ji {
  background: rgba(205, 170, 80, 0.05);
  border: 1px solid rgba(205, 170, 80, 0.18);
  color: var(--light-purple);
}

.pillar-cell.highlight {
  border: 2px solid var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
  background: rgba(255, 215, 0, 0.12);
}

.day-pillar .pillar-header { color: var(--gold); font-weight: 600; }

/* 오행 색상 */
.oheng-wood { color: #4ade80 !important; border-color: rgba(74, 222, 128, 0.5) !important; }
.oheng-fire { color: #f87171 !important; border-color: rgba(248, 113, 113, 0.5) !important; }
.oheng-earth { color: #fbbf24 !important; border-color: rgba(251, 191, 36, 0.5) !important; }
.oheng-metal { color: #e2e8f0 !important; border-color: rgba(226, 232, 240, 0.5) !important; }
.oheng-water { color: #60a5fa !important; border-color: rgba(96, 165, 250, 0.5) !important; }

/* 십성 태그 */
.pillar-meta {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 0.3rem;
  flex-wrap: wrap;
}

.sipseong-tag {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(205, 170, 80, 0.1);
  border: 1px solid rgba(205, 170, 80, 0.2);
  color: var(--gray);
  white-space: nowrap;
}

.ilgan-tag {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

.unseong-tag {
  font-size: 0.6rem;
  color: rgba(160, 152, 144, 0.7);
  margin-top: 0.3rem;
}

/* ─── 기본 정보 그리드 ─── */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.info-item {
  background: rgba(20, 22, 30, 0.5);
  border: 1px solid rgba(205, 170, 80, 0.12);
  border-radius: 12px;
  padding: 0.8rem;
  text-align: center;
}

.info-item .label {
  font-size: 0.7rem;
  color: var(--gray);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-item .value {
  font-size: 1rem;
  color: var(--gold);
  font-weight: 600;
}

/* ─── 오행 분포 (듀얼) ─── */

.oheng-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.oheng-panel h4 {
  text-align: center;
  color: var(--gray);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.tooltip {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  background: rgba(205, 170, 80, 0.2);
  border-radius: 50%;
  font-size: 0.6rem;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
}

.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 22, 30, 0.95);
  border: 1px solid rgba(205, 170, 80, 0.3);
  color: var(--white);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
  white-space: nowrap;
  z-index: 10;
}

.oheng-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.6rem;
  gap: 0.5rem;
}

.oheng-label {
  width: 50px;
  font-size: 0.75rem;
  text-align: right;
  color: var(--white);
}

.oheng-bar-bg {
  flex: 1;
  height: 18px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9px;
  overflow: hidden;
}

.oheng-bar-fill {
  height: 100%;
  border-radius: 9px;
  transition: width 1s ease;
  width: 0;
}

.oheng-bar-fill.wood { background: linear-gradient(90deg, #22c55e, #4ade80); }
.oheng-bar-fill.fire { background: linear-gradient(90deg, #ef4444, #f87171); }
.oheng-bar-fill.earth { background: linear-gradient(90deg, #d97706, #fbbf24); }
.oheng-bar-fill.metal { background: linear-gradient(90deg, #94a3b8, #e2e8f0); }
.oheng-bar-fill.water { background: linear-gradient(90deg, #3b82f6, #60a5fa); }

.oheng-count {
  width: 40px;
  font-size: 0.8rem;
  color: var(--white);
  font-weight: 600;
  text-align: right;
}

/* ─── 신강/신약 + 용신 ─── */

.strength-yongshin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.strength-card, .yongshin-card {
  text-align: center;
  padding: 1.5rem;
  border-radius: 14px;
  background: rgba(20, 22, 30, 0.4);
  border: 1px solid rgba(205, 170, 80, 0.15);
}

.strength-label, .yongshin-label {
  font-size: 0.75rem;
  color: var(--gray);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.strength-value {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.strength-score {
  font-size: 0.85rem;
  color: var(--gray);
}

.yongshin-value {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.yongshin-desc {
  font-size: 0.8rem;
  color: var(--gray);
  line-height: 1.5;
}

/* 신강 레벨 색상 */
.strength-극왕 { color: #f87171; }
.strength-신강 { color: #fbbf24; }
.strength-중화신강 { color: #4ade80; }
.strength-중화 { color: #60a5fa; }
.strength-중화신약 { color: #4ade80; }
.strength-신약 { color: #fbbf24; }
.strength-극약 { color: #f87171; }

/* ─── 십성 그리드 ─── */

.sipseong-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sipseong-cell {
  background: rgba(20, 22, 30, 0.4);
  border: 1px solid rgba(205, 170, 80, 0.12);
  border-radius: 10px;
  padding: 0.6rem;
  text-align: center;
}

.sipseong-cell .pos { font-size: 0.65rem; color: var(--gray); margin-bottom: 0.2rem; }
.sipseong-cell .name { font-size: 0.9rem; color: var(--gold); font-weight: 600; }
.sipseong-cell .sub { font-size: 0.65rem; color: rgba(160, 152, 144, 0.6); margin-top: 0.1rem; }

.daepyo-sipseong {
  text-align: center;
  padding: 0.8rem;
  background: rgba(205, 170, 80, 0.06);
  border-radius: 10px;
  border: 1px solid rgba(205, 170, 80, 0.15);
}

.daepyo-sipseong .label { font-size: 0.75rem; color: var(--gray); margin-bottom: 0.3rem; }
.daepyo-sipseong .value { color: var(--gold); font-weight: 700; font-size: 1.1rem; }

/* ─── 합충형파해 ─── */

.interactions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.interaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.interaction-chip.합 { background: rgba(74, 222, 128, 0.12); border: 1px solid rgba(74, 222, 128, 0.3); color: #4ade80; }
.interaction-chip.충 { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.3); color: #f87171; }
.interaction-chip.형 { background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.3); color: #fbbf24; }
.interaction-chip.파 { background: rgba(168, 162, 158, 0.12); border: 1px solid rgba(168, 162, 158, 0.3); color: #a8a29e; }
.interaction-chip.해 { background: rgba(196, 181, 253, 0.12); border: 1px solid rgba(196, 181, 253, 0.3); color: #c4b5fd; }

.no-interactions {
  text-align: center;
  color: var(--gray);
  font-size: 0.9rem;
  padding: 1rem;
}

/* ─── 신살 ─── */

.sinsal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.sinsal-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 16px;
  font-size: 0.8rem;
  background: rgba(205, 170, 80, 0.08);
  border: 1px solid rgba(205, 170, 80, 0.2);
  color: var(--gold);
}

.sinsal-chip.good { background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.25); color: #4ade80; }
.sinsal-chip.bad { background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.25); color: #f87171; }

.gongmang-info {
  text-align: center;
  font-size: 0.85rem;
  color: var(--gray);
  padding: 0.8rem;
  background: rgba(20, 22, 30, 0.4);
  border-radius: 10px;
  border: 1px solid rgba(205, 170, 80, 0.1);
}

.gongmang-info .label { color: var(--gray); font-size: 0.7rem; letter-spacing: 1px; }
.gongmang-info .value { color: #f87171; font-weight: 600; margin-top: 0.2rem; }

/* ─── 대운 타임라인 ─── */

.daeun-timeline {
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.daeun-track {
  display: flex;
  gap: 0;
  min-width: max-content;
}

.daeun-item {
  min-width: 80px;
  text-align: center;
  padding: 0.6rem 0.4rem;
  border-left: 1px solid rgba(205, 170, 80, 0.1);
  position: relative;
  transition: background 0.3s;
}

.daeun-item:first-child { border-left: none; }

.daeun-item:hover {
  background: rgba(205, 170, 80, 0.06);
}

.daeun-item.current {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 10px;
}

.daeun-age { font-size: 0.65rem; color: var(--gray); margin-bottom: 0.3rem; }
.daeun-pillar { font-size: 1.2rem; font-weight: 700; color: var(--gold); }
.daeun-pillar .ji-char { color: var(--light-purple); }
.daeun-years { font-size: 0.6rem; color: rgba(160, 152, 144, 0.5); margin-top: 0.2rem; }
.daeun-sipseong { font-size: 0.6rem; color: rgba(160, 152, 144, 0.7); margin-top: 0.15rem; }

/* ─── AI 분석 탭 ─── */

.analysis-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0;
  border-bottom: 1px solid rgba(205, 170, 80, 0.15);
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.analysis-tabs .tab {
  padding: 0.7rem 1rem;
  background: none;
  border: none;
  color: var(--gray);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.analysis-tabs .tab:hover {
  color: var(--white);
}

.analysis-tabs .tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 600;
}

.analysis-content {
  line-height: 1.9;
  white-space: pre-wrap;
  font-size: 0.92rem;
  color: var(--white);
  min-height: 200px;
}

.analysis-section {
  display: none;
}

.analysis-section.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

.analysis-section h4 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(205, 170, 80, 0.15);
}

/* 로딩 */
.loading-spinner { text-align: center; padding: 3rem; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255, 215, 0, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-spinner p { color: var(--gray); font-size: 0.9rem; }

/* 액션 버튼 */
.result-actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

/* 교차 링크 */
.cross-links { border-top: 1px solid rgba(205, 170, 80, 0.12); padding: 2rem 0; }
.cross-links h3 { text-align: center; color: var(--gray); font-size: 1rem; margin-bottom: 1rem; }
.cross-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.cross-card {
  background: rgba(20, 22, 30, 0.5);
  border: 1px solid rgba(205, 170, 80, 0.12);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.cross-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.cross-card span { font-size: 1.5rem; display: block; margin-bottom: 0.5rem; }
.cross-card p { color: var(--gray); font-size: 0.85rem; }

/* 광고 */
.ad-slot { margin: 1.5rem 0; }
.ad-placeholder {
  text-align: center; padding: 1rem;
  color: rgba(160, 152, 144, 0.3); font-size: 0.8rem;
  border: 1px dashed rgba(160, 152, 144, 0.15); border-radius: 10px;
}

/* ─── 모바일 반응형 ─── */

@media (max-width: 768px) {
  .form-row { flex-direction: column; gap: 0.8rem; }

  .saju-chart-premium { gap: 0.3rem; }
  .pillar-cell { width: 65px; height: 65px; }
  .pillar-cell .char { font-size: 1.5rem; }
  .pillar-premium { min-width: 70px; }

  .oheng-dual { grid-template-columns: 1fr; }
  .strength-yongshin { grid-template-columns: 1fr; }
  .sipseong-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }

  .analysis-tabs { flex-wrap: wrap; overflow-x: visible; }
  .analysis-tabs .tab { padding: 0.5rem 0.7rem; font-size: 0.75rem; }

  .daeun-item { min-width: 65px; }
}

@media (max-width: 480px) {
  .pillar-cell { width: 55px; height: 55px; }
  .pillar-cell .char { font-size: 1.3rem; }
  .pillar-premium { min-width: 60px; }
}

/* 인쇄 */
@media print {
  .nav, .footer, .ad-slot, .result-actions, .cross-links, canvas { display: none !important; }
  .premium-page { padding-top: 0; }
  .section-card { break-inside: avoid; border: 1px solid #ccc; }
  body { background: white; color: black; }
}
