@charset "UTF-8";

.for-share {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Pretendard';
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, #000 48.16%);
  backdrop-filter: blur(10px);
}

/* 중앙 컨텐츠 래퍼 */
.for-share-content {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 32px;
  position: relative;
  height: 100%;
}

/* Phase 1 텍스트 */
.for-share-text {
  font-size: 32px;
  color: #FFFFFF;
  font-weight: 700;
  line-height: 130%;
  letter-spacing: -0.3px;
  position: absolute;
  opacity: 0;
  transition: opacity 0.6s;
}

.for-share.phase1 .for-share-text {
  opacity: 1;
}

.for-share.phase2 .for-share-text {
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* 이 사실 알리기 버튼 — Phase 1, 2 모두 유지 */
.for-share-btn {
  padding: 16px 0;
  color: #FFFFFF;
  width: calc(100% - 40px);
  font-size: 18px;
  font-weight: 700;
  line-height: 140%;
  letter-spacing: -0.17px;
  cursor: pointer;
  transition: background 0.3s, opacity 0.6s;
  border-radius: 15px;
  background: #008588;
  position: absolute;
  bottom: 40px;
  opacity: 0;
}

.for-share.phase1 .for-share-btn,
.for-share.phase2 .for-share-btn {
  opacity: 1;
}

.for-share-btn:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

.for-share.phase2 .for-share-btn {
  margin-top: 24px;
}

/* Phase 2 텍스트 */
.for-share-text-after {
  font-size: 32px;
  font-weight: 800;
  line-height: 130%;
  letter-spacing: -0.3px;
  color: #FFFFFF;
  opacity: 0;
  transition: opacity 0.6s;
}

.for-share.phase2 .for-share-text-after {
  opacity: 1;
  height: auto;
}

/* 공유 카드 */
.share-card {
  width: 280px;
  height: 280px;
  padding: 28px;
  margin-top: 24px;
  border-radius: 14px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  -webkit-touch-callout: default;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.share-card-back{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.share-card-txt-wrap {
  position: relative;
  z-index: 1;
}

.share-card-title {
  z-index: 1;
}

.for-share.phase2 .share-card,
.for-share.phase2 .share-card-img {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.6s 0.2s, transform 0.6s 0.2s;
}

/* 이미지로 변환된 카드 */
.share-card-img {
  width: 280px;
  height: 280px;
  margin-top: 24px;
  border-radius: 14px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  -webkit-touch-callout: default;
  -webkit-user-select: none;
  user-select: none;
}

.share-card-txt-wrap{
  text-align: left;
  color: #FFF;
  font-size: 24px;
  font-weight: 700;
  line-height: 160%;
  letter-spacing: -0.24px;
}

.share-card-txt-wrap li:nth-child(4) span{
  color: #FFF;
  background: #008588;
  width: fit-content;
}

.share-card-title{
  position: absolute;
  bottom: 20px;
  text-align: left;
  color: #949BA7;
  font-family: Pretendard;
  font-size: 14px;
  font-weight: 500;
  line-height: 140%;
  letter-spacing: -0.048px;
}

/* 카드 아래 안내 말풍선 */
.share-card-guide {
  margin-top: 20px;
  padding: 4px 12px;
  background: #F0F2F3;
  border-radius: 12px;
  color: #333D4B;
  font-size: 14px;
  line-height: 150%;
  letter-spacing: -0.056px;
  opacity: 0;
  pointer-events: none;
  position: relative;
}

.share-card-guide:before{
  position: absolute;
  content: "";
  width: 14px;
  height: 9px;
  background: #F0F2F3;
  display: block;
  top: -8px;
  left: calc(50% - 7px);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0% 100%);
}

.for-share.phase2 .share-card-guide {
  opacity: 1;
  transition: opacity 0.6s 0.4s;
}

/* 추천 모달 */
.recommend-modal {
  position: fixed;
  top: 0;
  height: 100%;
  inset: 0;
  z-index: 30;
  font-family: pretendard;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.recommend-modal.active {
  opacity: 1;
  visibility: visible;
}

.recommend-modal-card {
  width: 100%;
  max-width: 700px;
  background: #FFFFFF;
  border-radius: 20px 20px 0 0;
  padding: 36px 24px 24px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.5s ease-out;
}

.recommend-modal.active .recommend-modal-card {
  transform: translateY(0);
}

.recommend-modal-card::before{
  position: absolute;
  top: 8px;
  border-radius: 4px;
  width: 55px;
  height: 4px;
  left: calc(50% - 22.5px);
  background-color: #D4D9E2;
  content: "";
  display: block;
}

.recommend-modal-card li:nth-child(1){
  position: relative;
}

.recommend-modal-subtitle {
  color: #4E5968;
  font-size: 14px;
  font-weight: 500;
  line-height: 150%;
  letter-spacing: -0.056px;
  margin: 0 0 4px 12px;
}

.recommend-modal-title {
  color: #191F28;
  font-size: 18px;
  font-weight: 700;
  line-height: 140%;
  letter-spacing: -0.2px;
  margin: 0 0 28px 12px;
}

.recommend-modal-img{
  position: absolute;
  right: 12px;
  top: 0;
  height: 100%;
  width: auto;
  border-radius: 4px;
}

.recommend-modal-actions {
  display: flex;
  gap: 12px;
}

.recommend-modal-cancel {
  flex: 1;
  padding: 14.5px;
  border-radius: 15px;
  background: #F0F2F3;
  color: #4E5968;
  font-size: 18px;
  font-weight: 600;
  line-height: 150%;
  letter-spacing: -0.072px;
  cursor: pointer;
  transition: background 0.2s;
}

.recommend-modal-cancel:hover {
  background: #F5F5F5;
}

.recommend-modal-read {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: #D4D9E2;
  color: #191F28;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  z-index: 0;
}

/* 검은색 카운트다운 오버레이 */
.recommend-modal-read::before {
  content: "지금 읽기";
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  font-size: 18px;
  font-weight: 600;
  color: #FFF;
  text-align: center;
  background: #191F28;
  border-radius: inherit;
  display: flex;
  justify-content: center;
  align-items: center;
  clip-path: inset(0 100% 0 0);
}

.recommend-modal-read.counting::before {
  animation: countdownShrink 10s linear forwards;
}

@keyframes countdownShrink {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

.recommend-modal-read:hover {
  background: #F5F5F5;
}

@media all and (min-width: 876px){
  .share-card{
    width: 400px;
    height: 400px;
    padding: 36px;
  }

  .share-card-img {
    width: 400px;
    height: 400px;
  }

  /* Phase 1 텍스트 */
  .for-share-text {
    font-size: 44px;
  }

  .for-share-btn {
    font-size: 24px;
  }
  .for-share-text-after {
    font-size: 44px;
  }

  .share-card-txt-wrap{
    font-size: 40px;
    line-height: 130%;
    font-weight: 500;
  }
  
  .share-card-txt-wrap li:nth-child(4) span{
    font-weight: 500;
  }

  .share-card-title{
    font-size: 18px;
    bottom: 36px;
  }

  .share-card-guide {
    font-size: 20px;
  }

  .recommend-modal-card {
    border-radius: 20px;
    margin-bottom: 60px;
  }

  .recommend-modal-card::before{
    display: none;
  }

  .recommend-modal-subtitle {
    font-size: 16px;
    margin: 0 0 4px 24px;
  }

  .recommend-modal-title {
    font-size: 28px;
    margin: 0 0 28px 24px;
  }

  .recommend-modal-img{
    right: 24px;
  }
}