/* 사주팔자 · 대운 이미지 공유 */

.panel-share-btn {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  margin: 0;
  padding: 0;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  cursor: pointer;
  color: #666;
  font-size: 14px;
  line-height: 1;
}

.panel-share-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #222;
}

.panel-share-btn.is-busy {
  opacity: 0.5;
  cursor: wait;
  pointer-events: none;
}

/* 공유 이미지 생성 중 전체 화면 로딩 */
.wr-saju-share-loading {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 14, 8, 0.42);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
}
.wr-saju-share-loading[hidden] {
  display: none !important;
}
.wr-saju-share-loading__box {
  min-width: 160px;
  max-width: 80vw;
  padding: 22px 28px;
  border-radius: 12px;
  background: #fff;
  color: #3d2914;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}
.wr-saju-share-loading__spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 3px solid #e5e0d8;
  border-top-color: #5a6b4a;
  border-radius: 50%;
  animation: wr-saju-share-spin 0.75s linear infinite;
}
.wr-saju-share-loading__text {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.wr-saju-share-loading__sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: #777;
}
@keyframes wr-saju-share-spin {
  to { transform: rotate(360deg); }
}

.panel-share-btn:disabled,
.panel-share-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

/* 산출 직후 공유 유도 말풍선 */
.panel-share-btn.wr-share-nudge-target {
  position: relative;
  z-index: 2;
  overflow: visible;
  color: var(--theme-green-deep, #5a6b4a);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-green, #8fad6a) 55%, transparent);
}

.window-panel-header-buttons.wr-share-nudge-host {
  overflow: visible;
  z-index: 3;
}

/* 공유 버튼 좌측에서 아이콘을 가리킴 */
.wr-share-nudge {
  position: absolute;
  right: calc(100% + 10px);
  left: auto;
  top: 50%;
  bottom: auto;
  z-index: 60;
  max-width: min(200px, 55vw);
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--color-blue, var(--theme-green-deep, #5a6b4a));
  color: var(--button-text, #fff);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transform: translateY(-50%);
  animation: wr-share-nudge-bob 0.75s ease-in-out 8;
  pointer-events: auto;
}

.wr-share-nudge__text {
  display: block;
}

.wr-share-nudge__arrow {
  position: absolute;
  left: 100%;
  right: auto;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -7px;
  border: 7px solid transparent;
  border-left-color: var(--color-blue, var(--theme-green-deep, #5a6b4a));
}

@keyframes wr-share-nudge-bob {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50% { transform: translateY(-50%) translateX(-5px); }
}

@media (prefers-reduced-motion: reduce) {
  .wr-share-nudge {
    animation: none;
  }
}

html[data-theme="dark"] .wr-share-nudge {
  background: var(--theme-green, #8fad6a);
  color: #1a1a1a;
}

html[data-theme="dark"] .wr-share-nudge__arrow {
  border-left-color: var(--theme-green, #8fad6a);
}

/* 별난보고서 탭 본문 제목 + 공유 */
.wr-fr-tab-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--link-color, var(--border-color, #cbb89a));
}

.wr-fr-tab-titlebar h2 {
  margin: 0;
  font-size: 1.2em;
  font-weight: 700;
  color: var(--text-primary, #222);
  flex: 1;
  min-width: 0;
}

.wr-fr-tab-titlebar .panel-share-btn {
  flex: 0 0 auto;
}

.zodiac-etc-container > .wr-fr-tab-titlebar {
  margin-bottom: 18px;
}

html[data-theme="dark"] .panel-share-btn {
  color: #bbb;
}

html[data-theme="dark"] .panel-share-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
}

/* 오프스크린 캡처 카드 (다크모드와 무관하게 라이트 카드로 고정) */
.wr-saju-share-card {
  box-sizing: border-box;
  width: 720px;
  padding: 28px 28px 20px;
  background: #fff !important;
  color: #222 !important;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  text-align: left;
  --bg-primary: #fff;
  --bg-secondary: #f7f3ee;
  --text-primary: #222;
  --text-secondary: #555;
  --border-color: #e5e0d8;
}

.wr-saju-share-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e0d8;
}

.wr-saju-share-card__head strong {
  font-size: 20px;
  font-weight: 700;
}

.wr-saju-share-card__head span {
  font-size: 12px;
  color: #888;
}

.wr-saju-share-card__info {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: #555;
}

.wr-saju-share-card__block {
  margin-bottom: 18px;
}

.wr-saju-share-card__label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #444;
}

.wr-saju-share-card .saju-table,
.wr-saju-share-card .daeun-table {
  width: 100%;
  border-collapse: collapse;
}

.wr-saju-share-card__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid #e5e0d8;
}

.wr-saju-share-card__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}

.wr-saju-share-card__credit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
  color: #777;
}

.wr-saju-share-card__credit strong {
  font-size: 12px;
  color: #444;
}

.wr-saju-share-card__credit em {
  font-style: normal;
  font-size: 10px;
  color: #999;
}

/* 미리보기 모달 */
.wr-saju-share-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
  overflow: auto;
  background: rgba(20, 14, 8, 0.45);
}

.wr-saju-share-modal[hidden] {
  display: none !important;
}

.wr-saju-share-modal__box {
  width: 100%;
  max-width: 480px;
  margin: auto;
  padding: 16px 16px 18px;
  border-radius: 10px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #222);
  border: 1px solid var(--border-color, #cbb89a);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.wr-saju-share-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.wr-saju-share-modal__head h3 {
  margin: 0;
  font-size: 17px;
}

.wr-saju-share-modal__close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  padding: 0 4px;
}

.wr-saju-share-modal__preview {
  max-height: 55vh;
  overflow: auto;
  border: 1px solid var(--border-color, #e5e0d8);
  border-radius: 6px;
  background: #faf8f5;
  text-align: center;
}

.wr-saju-share-modal__preview img {
  display: block;
  width: 100%;
  height: auto;
}

.wr-saju-share-modal__hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-secondary, #666);
  line-height: 1.4;
}

.wr-saju-share-modal__actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.wr-saju-share-modal__btn {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--border-color, #8b4513);
  border-radius: 6px;
  background: var(--bg-secondary, #f4efe6);
  color: var(--text-primary, #3d2914);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.wr-saju-share-modal__btn.is-primary {
  background: #8b4513;
  border-color: #6b3410;
  color: #fff;
}

.wr-saju-share-modal__btn:hover {
  filter: brightness(0.97);
}

/* —— Pro 텍스트 공유 시트 —— */
.wr-pro-text-share {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
  overflow: auto;
  background: rgba(20, 14, 8, 0.45);
}

.wr-pro-text-share[hidden] {
  display: none !important;
}

.wr-pro-text-share__box {
  width: 100%;
  max-width: 480px;
  margin: auto;
  padding: 16px;
  border-radius: 10px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #222);
  border: 1px solid var(--border-color, #cbb89a);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.wr-pro-text-share__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.wr-pro-text-share__head h3 {
  margin: 0;
  font-size: 17px;
}

.wr-pro-text-share__close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  padding: 0 4px;
}

.wr-pro-text-share__body {
  width: 100%;
  box-sizing: border-box;
  min-height: 200px;
  max-height: 45vh;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #e5e0d8);
  border-radius: 6px;
  background: var(--bg-secondary, #faf8f5);
  color: var(--text-primary, #222);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
}

.wr-pro-text-share__hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-secondary, #666);
  line-height: 1.4;
}

.wr-pro-text-share__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.wr-pro-text-share__btn {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--border-color, #8b4513);
  border-radius: 6px;
  background: var(--bg-secondary, #f4efe6);
  color: var(--text-primary, #3d2914);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.wr-pro-text-share__btn.is-primary {
  background: #8b4513;
  border-color: #6b3410;
  color: #fff;
}
