/* ============================================================
   KTradeHub 공유 모듈 — image-resize, qr-generator 등에서 사용
   ============================================================ */

/* 오버레이 */
.kth-share-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: kthFadeIn 0.18s ease-out;
}
@keyframes kthFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 시트 */
.kth-share-sheet {
  background: #fff;
  width: 100%; max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  font-family: 'Pretendard','Inter',sans-serif;
  animation: kthSlideUp 0.22s ease-out;
}
@keyframes kthSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
[data-theme="dark"] .kth-share-sheet { background: #1a1f2a; color: #e8ecf0; }

/* 헤더 */
.kth-share-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid #e5e7eb;
}
[data-theme="dark"] .kth-share-header { border-color: #3a4555; }
.kth-share-title { margin: 0; font-size: 1rem; font-weight: 700; }
.kth-share-close {
  background: none; border: none; cursor: pointer;
  width: 32px; height: 32px;
  font-size: 1.4rem; line-height: 1;
  color: #6b7280;
  display: flex; align-items: center; justify-content: center;
}
.kth-share-close:hover { color: #111827; }
[data-theme="dark"] .kth-share-close:hover { color: #fff; }

/* 빠른 액션 (이미지 복사 / 링크 복사 / 스마트 공유) */
.kth-share-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
}
[data-theme="dark"] .kth-share-actions { border-color: #3a4555; }
.kth-share-actions:has(> button:nth-child(3):not([hidden])) { grid-template-columns: 1fr 1fr 1fr; }
.kth-share-action {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px;
  background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 0;
  cursor: pointer; font-size: 0.78rem; font-weight: 600; color: #1f2937;
  font-family: inherit; transition: all 0.12s;
}
.kth-share-action:hover { background: #e5e7eb; border-color: #00A651; }
[data-theme="dark"] .kth-share-action { background: #252b38; border-color: #3a4555; color: #e8ecf0; }
[data-theme="dark"] .kth-share-action:hover { background: #2d3441; }
.kth-share-action svg { width: 22px; height: 22px; color: #00A651; }
.kth-share-native svg { color: #4f46e5; }

/* 플랫폼 그리드 */
.kth-share-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 18px;
}
@media (max-width: 420px) { .kth-share-grid { grid-template-columns: repeat(3, 1fr); } }
.kth-share-platform {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 1px solid transparent; padding: 10px 4px;
  cursor: pointer; font-family: inherit; font-size: 0.74rem; font-weight: 500; color: #1f2937;
  transition: all 0.12s; border-radius: 0;
}
.kth-share-platform:hover { background: #f3f4f6; border-color: #e5e7eb; }
[data-theme="dark"] .kth-share-platform { color: #e8ecf0; }
[data-theme="dark"] .kth-share-platform:hover { background: #252b38; border-color: #3a4555; }
.kth-share-platform-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 800; font-size: 1.05rem; color: #fff;
  flex-shrink: 0;
}
.kth-share-platform-icon svg { width: 22px; height: 22px; }
/* 카카오톡 — 공식 로고(말풍선+TALK)가 노란 원 안에 적절히 */
.kth-share-icon-kakao svg { width: 27px; height: 27px; }

/* 플랫폼별 브랜드 컬러 */
.kth-share-icon-kakao    { background: #FEE500; color: #3C1E1E; }
.kth-share-icon-sms      { background: #34d399; }
.kth-share-icon-facebook { background: #1877F2; }
.kth-share-icon-line     { background: #06C755; }
.kth-share-icon-x        { background: #000; }
.kth-share-icon-email    { background: #6b7280; }
.kth-share-icon-gmail    { background: #EA4335; }
.kth-share-icon-whatsapp { background: #25D366; }
.kth-share-icon-linkedin { background: #0A66C2; }
.kth-share-icon-pinterest{ background: #E60023; }
.kth-share-icon-reddit   { background: #FF4500; }

/* 토스트 */
.kth-share-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 24px;
  font-size: 0.85rem; font-weight: 500; z-index: 2100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  animation: kthToast 0.2s ease-out;
  max-width: calc(100vw - 40px); text-align: center;
}
@keyframes kthToast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 공유 버튼 (호스트 페이지에서 사용) */
.kth-share-trigger {
  padding: 11px;
  background: #fff; color: #00A651; border: 1px solid #00A651; border-radius: 0;
  font-size: 0.88rem; font-weight: 700; cursor: pointer;
  font-family: 'Pretendard','Inter',sans-serif;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.kth-share-trigger:hover { background: #f0fdf4; }
.kth-share-trigger:disabled { opacity: 0.5; cursor: not-allowed; }
.kth-share-trigger svg { width: 16px; height: 16px; }
[data-theme="dark"] .kth-share-trigger { background: #1a1f2a; color: #34d399; border-color: #10b981; }
[data-theme="dark"] .kth-share-trigger:hover { background: #14342a; }

[hidden] { display: none !important; }
