/* web/css/share.css — share 모듈 전용 스타일 */

/* 1. 모달 전체 오버레이 & 백드롭 */
.share-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
  animation: share-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 15, 13, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 2. 모달 다이얼로그 본체 */
.share-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  background: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: share-scale-up 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 3. 모달 헤더 */
.share-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: #FFFFFF;
}

.share-dialog-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.share-close-btn {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -6px -4px 0;
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.share-close-btn:hover {
  color: var(--ink);
  background-color: var(--bg);
}

/* 4. 테마 선택 스위처 (노을, 새벽, 숲) */
.share-theme-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: #FAF7F2;
  border-bottom: 1px solid var(--line);
}

.share-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.share-theme-btn:hover {
  color: var(--ink);
  border-color: rgba(217, 119, 6, 0.2);
}

.share-theme-btn.active {
  color: var(--ink);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.share-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.share-swatch-sunset {
  background: linear-gradient(135deg, #5C2240, #DC6B43, #F5A15D);
}

.share-swatch-dawn {
  background: linear-gradient(135deg, #192842, #2B3F63, #757299);
}

.share-swatch-forest {
  background: linear-gradient(135deg, #143122, #224B35, #538868);
}

.share-theme-label {
  line-height: 1;
}

/* 5. 인스타 스토리 9:16 미리보기 영역 */
.share-preview-wrapper {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  background: #F4F1EB;
  overflow: hidden;
}

.share-preview-canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 245px);
  max-height: calc(100dvh - 245px);
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
  margin: 0 auto;
}

/* 6. 액션 버튼 영역 */
.share-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #FFFFFF;
  border-top: 1px solid var(--line);
}

.share-btn {
  height: 44px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease, background-color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.share-btn:active {
  transform: scale(0.98);
}

.share-btn-primary {
  flex: 1;
  background: linear-gradient(45deg, #F58529, #D92E7F 50%, #833AB4);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 4px 14px rgba(217, 46, 127, 0.28);
}

.share-btn-primary:hover {
  opacity: 0.94;
}

.share-btn-secondary {
  flex-shrink: 0;
  padding: 0 16px;
  background: #FAF7F2;
  color: var(--ink);
  border: 1px solid var(--line);
}

.share-btn-secondary:hover {
  background: #F3EFE8;
}

.share-btn-icon {
  flex-shrink: 0;
  display: block;
}

/* 7. 안내 힌트 문구 */
.share-hint {
  margin: 0 16px 12px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #92400E;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
}

/* 8. 링크 복사 토스트 */
.share-toast {
  position: absolute;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(28, 25, 23, 0.92);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.share-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 9. 애니메이션 키프레임 */
@keyframes share-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes share-scale-up {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
