/* ============================================================
   QR 코드 모달 + 공유 버튼 스타일
   ============================================================ */

/* ── QR 모달 오버레이 ── */
.qr-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 800;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.qr-modal-overlay.open {
  display: flex;
  animation: overlay-in 0.25s ease;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── QR 모달 바텀 시트 ── */
.qr-modal-sheet {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  animation: sheet-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 92vh;
  overflow-y: auto;
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ── 드래그 핸들 ── */
.qr-modal-handle {
  width: 40px;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin: 12px auto 0;
}

/* ── 모달 헤더 ── */
.qr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 0;
}

.qr-modal-title {
  font-weight: 700;
  font-size: 1.05em;
  color: #1a6b3c;
}

.qr-modal-close {
  background: #f5f5f5;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

/* ── QR 코드 영역 ── */
.qr-display-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 16px;
  gap: 10px;
}

.qr-canvas-box {
  padding: 14px;
  background: #fff;
  border: 1.5px solid #c8dfc0;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(26, 107, 60, 0.12);
  display: inline-block;
}

.qr-canvas-box canvas {
  display: block;
  border-radius: 6px;
}

.qr-url-text {
  font-size: 0.78em;
  color: #6b8f6b;
  word-break: break-all;
  text-align: center;
  max-width: 280px;
}

.qr-candidate-name {
  font-weight: 700;
  font-size: 0.95em;
  color: #1a6b3c;
}

/* ── 다운로드 버튼 ── */
.qr-download-btn {
  width: calc(100% - 40px);
  margin: 0 20px;
  padding: 13px;
  background: #1a6b3c;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95em;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s;
}

.qr-download-btn:hover { background: #2d9e5e; }
.qr-download-btn:active { transform: scale(0.98); }

/* ── 구분선 ── */
.qr-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 20px;
  color: #aaa;
  font-size: 0.78em;
}

.qr-divider::before,
.qr-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

/* ── SNS 공유 버튼 그리드 ── */
.share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 20px 20px;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.share-btn-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  font-weight: 700;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.share-btn:hover .share-btn-icon,
.share-btn:active .share-btn-icon {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.share-btn-label {
  font-size: 0.72em;
  color: #555;
  font-weight: 500;
  white-space: nowrap;
}

/* ── 미니홈피 QR 탭 내 버튼 ── */
.qr-open-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: #1a6b3c;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95em;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
  margin-bottom: 10px;
}

.qr-open-btn:hover { background: #2d9e5e; }

.qr-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

/* ── 토스트 애니메이션 ── */
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── 반응형 ── */
@media (min-width: 480px) {
  .qr-modal-overlay {
    align-items: center;
    padding: 20px;
  }
  .qr-modal-sheet {
    border-radius: 20px;
    max-width: 400px;
    max-height: 85vh;
  }
}
