/**
 * 토스 스타일 모달(팝업) 컴포넌트
 * 부드러운 애니메이션과 backdrop blur 효과
 */

/* ============================
   모달 오버레이 (배경)
   ============================ */
.modern-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  
  /* 초기 상태 (숨김) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* 모달 열림 상태 */
.modern-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* 배경 블러 효과 (토스 스타일) */
.modern-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ============================
   모달 콘텐츠
   ============================ */
.modern-modal__content {
  position: relative;
  z-index: 1;
  background: #FFFFFF;
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  
  /* 애니메이션 */
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease;
}

/* 모달 열림 시 콘텐츠 애니메이션 */
.modern-modal.is-open .modern-modal__content {
  transform: scale(1) translateY(0);
}

/* ============================
   모달 헤더
   ============================ */
.modern-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modern-modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #191F28;
  margin: 0;
}

/* 닫기 버튼 */
.modern-modal__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #8B95A1;
  transition: all 0.2s ease;
}

.modern-modal__close:hover {
  background: #F2F4F6;
  color: #191F28;
}

/* ============================
   모달 바디
   ============================ */
.modern-modal__body {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #4E5968;
  margin-bottom: 1.5rem;
}

/* ============================
   모달 푸터
   ============================ */
.modern-modal__footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* 모바일에서 버튼 풀 너비 */
@media (max-width: 480px) {
  .modern-modal__footer {
    flex-direction: column-reverse;
  }
  
  .modern-modal__footer .btn {
    width: 100%;
  }
}

/* ============================
   바텀시트 스타일 (모바일)
   ============================ */
.modern-modal--bottom-sheet {
  align-items: flex-end;
  padding: 0;
}

.modern-modal--bottom-sheet .modern-modal__content {
  max-width: 100%;
  border-radius: 20px 20px 0 0;
  max-height: 80vh;
  transform: translateY(100%);
}

.modern-modal--bottom-sheet.is-open .modern-modal__content {
  transform: translateY(0);
}

/* ============================
   모달 사이즈 변형
   ============================ */

/* 작은 모달 */
.modern-modal__content--sm {
  max-width: 400px;
}

/* 큰 모달 */
.modern-modal__content--lg {
  max-width: 700px;
}

/* 전체 화면 모달 */
.modern-modal__content--full {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 12px;
}

/* ============================
   토스 스타일 확인 모달
   ============================ */
.modern-modal--confirm .modern-modal__header {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.modern-modal--confirm .modern-modal__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #F2F4F6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.modern-modal--confirm .modern-modal__title {
  font-size: 1.5rem;
}

.modern-modal--confirm .modern-modal__body {
  text-align: center;
  color: #6B7684;
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
  .modern-modal__content {
    background: #1A1A1A;
    color: #FFFFFF;
  }
  
  .modern-modal__title {
    color: #FFFFFF;
  }
  
  .modern-modal__body {
    color: #A0A0A0;
  }
  
  .modern-modal__close:hover {
    background: #2A2A2A;
    color: #FFFFFF;
  }
}

/* ============================
   애니메이션 감소 설정
   ============================ */
@media (prefers-reduced-motion: reduce) {
  .modern-modal,
  .modern-modal__content {
    transition: none;
  }
  
  .modern-modal__content {
    transform: none !important;
  }
}



