/* ===========================
   Modal Styles (통합 정리)
   =========================== */

/* ===== 1. 기본 모달 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-50px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 15px; right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  transition: color 0.3s ease;
}
.modal-close:hover { color: #333; }

/* 기본 프로필 사진 */
.modal-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 25px;
  border: 5px solid #f0f0f0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* 이름/메시지 */
.modal-name {
  font-size: 1.8rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
}
.modal-message {
  color: #666;
  line-height: 1.8;
  font-size: 1.1rem;
  font-style: italic;
}

/* ===== 2. Greeting Modal v2 (신랑/신부 탭형) ===== */
:root {
  --g-bg:#fffdfb; --g-surface:#ffffff;
  --g-text:#2d3142; --g-sub:#6b7280; --g-line:#eee8e2;
  --groom-accent:#9fd0ff; --bride-accent:#ffc9d6;
  --chip-bg:#f6f7fb; --chip-text:#4b5563;
  --shadow:0 18px 40px rgba(0,0,0,.08);
}

.greeting-modal-overlay {
  position: fixed; inset: 0; display: none; z-index: 1000;
  align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255,194,204,.18), transparent),
    rgba(20,18,26,.48);
  backdrop-filter: blur(6px) saturate(110%);
}

.greeting-modal {
  position: relative;
  width: min(880px, 100%);
  background: var(--g-surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(8px) scale(.992);
  opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}
.greeting-modal-overlay[aria-hidden="false"] .greeting-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.greeting-close {
  position: absolute;
  top: 12px; right: 14px;
  border: none; background: transparent;
  font-size: 32px; line-height: 1;
  color: #b0b3b8;
  cursor: pointer;
}

/* Tabs */
.greeting-tabs {
  display: flex; gap: 8px; justify-content: center;
  padding: 16px 12px 8px;
  border-bottom: 1px solid var(--g-line);
}
.greeting-tab {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  font-weight: 700;
  color: var(--g-sub);
  border-radius: 12px;
}
.greeting-tab.is-active { color: var(--g-text); background: #f7f7fb; }

/* Slider */
.greeting-slider {
  position: relative;
  display: flex;
  width: 200%;
  transform: translateX(0);
  transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.greeting-slide {
  width: 50%;
  padding: 18px 22px 20px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Card header */
.g-card-header {
  display: flex; gap: 16px; align-items: center;
  padding: 16px; border-radius: 16px; background: var(--g-bg);
}
.g-card-header.groom { box-shadow: inset 0 0 0 2px rgba(159,208,255,.35); }
.g-card-header.bride { box-shadow: inset 0 0 0 2px rgba(255,201,214,.35); }

.g-photo {
  width: 120px; height: 120px;
  border-radius: 16px; object-fit: cover;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

.g-name { display: flex; flex-direction: column; gap: 6px; }
.g-role { font-size: 13px; color: var(--g-sub); }
.g-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.g-name h3 { margin: 0; font-size: 22px; }

.g-pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.g-pill.groom { background:#eef6ff; color:#245c9f; border-color:#dbeafe; }
.g-pill.bride { background:#fff0f4; color:#b24574; border-color:#ffe0ea; }

/* Body */
.g-body { padding: 0 8px; display: flex; flex-direction: column; gap: 14px; }
.g-section-title { margin-top: 8px; font-weight: 800; color: var(--g-text); font-size: 14px; }

.g-badges, .g-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.g-badge {
  background: linear-gradient(180deg, #ffffff, #f7f9ff);
  border: 1px solid var(--g-line);
  border-radius: 14px;
  padding: 6px 10px;
  font-size: 13px; color: var(--g-text);
}
.g-chip {
  background: var(--chip-bg);
  color: var(--chip-text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  border: 1px solid #e8ebf3;
}

/* Quote */
.g-quote {
  position: relative;
  margin: 6px 0;
  padding: 12px 12px 10px 36px;
  background: #faf7f5;
  border-radius: 12px;
  color: #444;
}
.g-quote-mark { position: absolute; left: 12px; top: 8px; font-size: 18px; color: #d2a9a9; }
.g-quote-author { display: block; margin-top: 6px; font-size: 12px; color: #8a8d92; }

.g-promise { margin-top: 6px; }
.g-underline {
  background: linear-gradient(transparent 75%, rgba(255,235,167,.9) 0);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  animation: underlineFill 1.2s ease forwards 250ms;
}
@keyframes underlineFill { to { background-size: 100% 100%; } }

.g-footer { display: flex; justify-content: flex-end; padding: 8px 8px 0; }
.g-share {
  border: none; cursor: pointer; padding: 10px 14px;
  border-radius: 12px; background: #eef6ff;
  color: #3366aa; font-weight: 800;
}
.g-share:hover { filter: brightness(.98); }

/* Nav */
.g-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.92);
  border: none; width: 40px; height: 40px; border-radius: 50%;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 22px; line-height: 38px; text-align: center;
}
.g-arrow.prev { left: 12px; }
.g-arrow.next { right: 12px; }

.g-dots { display: flex; gap: 8px; justify-content: center; padding: 10px 0 18px; }
.g-dots button {
  width: 7px; height: 7px; border-radius: 50%; border: none;
  background: #d8dde7; cursor: pointer;
}
.g-dots button.is-active { background: #8aa5ff; }

/* ===== 3. Invitation에서 옮긴 모달 확장 ===== */

/* 더 작은 프로필 사진 (공통 modal-photo와 차이 줄이기) */
.modal-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  will-change: transform, filter, opacity;
  backface-visibility: hidden;
}

/* 실루엣 → 리빌 */
.is-silhouette {
  opacity: 0;
  transform: scale(1.06);
  filter: blur(10px) brightness(0.35) grayscale(100%);
}
.reveal {
  opacity: 1;
  transform: scale(1);
  filter: blur(0) brightness(1) grayscale(0);
  transition:
    opacity 1200ms ease,
    transform 1200ms cubic-bezier(.2,.8,.2,1),
    filter 1200ms ease;
}
.reveal.glow-once {
  animation: softGlow 1200ms ease-out 150ms 1;
}
@keyframes softGlow {
  0%   { box-shadow: 0 12px 30px rgba(0,0,0,.18), 0 0 0px rgba(255,200,150,0); }
  50%  { box-shadow: 0 12px 30px rgba(0,0,0,.18), 0 0 24px rgba(255,200,150,.45); }
  100% { box-shadow: 0 12px 30px rgba(0,0,0,.18), 0 0 0px rgba(255,200,150,0); }
}

/* 접근성 */
@media (prefers-reduced-motion: reduce) {
  .is-silhouette,
  .reveal {
    transition: none !important;
    animation: none !important;
    opacity: 1; transform: none; filter: none;
  }
}

/* Responsive */
@media (max-width: 640px) {
  .g-photo { width: 96px; height: 96px; }
  .modal-content { padding: 30px 25px; }
  .modal-photo { width: 120px; height: 120px; }
  .modal-name { font-size: 1.5rem; }
  .modal-message { font-size: 1rem; }
}
