/* PropVis 인터랙티브 튜토리얼 — 오버레이 전용 CSS
 *
 * 2026-09-10 재작성: 예전에는 이 파일(tutorial.css)이 앱 UI 를 통째로 흉내 냈는데,
 * 그 사본이 낡으면서 튜토리얼만 4월 디자인에 머물렀다.
 * 이제 화면 스타일은 **실제 앱 CSS(/css/**)를 직접 불러** 쓰고,
 * 이 파일에는 튜토리얼에만 있는 것(스포트라이트·말풍선·토스트·완료모달·진행바)만 남긴다.
 */

/* 이 파일에 남은 옛 변수 3개만 정의한다(나머지 색·간격은 앱 CSS 토큰을 그대로 쓴다) */
:root { --pv-border: #e0d3d1; --pv-muted: #9c908e; --pv-text3: #6b5f5d; }

/* ============ 화면 전환 ============ */
/* ============ 화면 전환 애니메이션 ============ */
.view {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
.view.is-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}


/* ============ 스포트라이트 강조 ============ */
@property --mask-r {
  syntax: '<length>';
  inherits: false;
  initial-value: 2000px;
}

.tut-highlight {
  position: relative;
  z-index: 600;
  outline: 3px solid #D61919;
  outline-offset: 3px;
  border-radius: 4px;
  pointer-events: auto !important;
}

/* 전체 화면 오버레이 — 바깥에서 강조 대상으로 어둠이 모여드는 애니메이션 */
.tut-block {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  --mask-x: 50%;
  --mask-y: 50%;
  --mask-r: 2000px;
  -webkit-mask-image: radial-gradient(
    circle at var(--mask-x) var(--mask-y),
    transparent var(--mask-r),
    black calc(var(--mask-r) + 1px)
  );
  mask-image: radial-gradient(
    circle at var(--mask-x) var(--mask-y),
    transparent var(--mask-r),
    black calc(var(--mask-r) + 1px)
  );
  transition: opacity 0.15s ease, --mask-r 0.6s cubic-bezier(.25,.1,.25,1);
}
.tut-block.is-show {
  opacity: 1;
  visibility: visible;
}

/* ============ 코치마크 (말풍선) ============ */
.tut-coach {
  position: fixed;
  z-index: 700;
  background: var(--main);
  color: #fff;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(129, 43, 39, .35);
  max-width: 280px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.tut-coach.is-show { opacity: 1; }
.tut-coach::before {
  content: '';
  position: absolute;
  width: 0; height: 0;
  border: 8px solid transparent;
}
.tut-coach[data-arrow="left"]::before {
  left: -16px; top: 50%; transform: translateY(-50%);
  border-right-color: var(--main);
}
.tut-coach[data-arrow="top"]::before {
  top: -16px; left: 24px;
  border-bottom-color: var(--main);
}
.tut-coach[data-arrow="right"]::before {
  right: -16px; top: 50%; transform: translateY(-50%);
  border-left-color: var(--main);
}
.tut-coach[data-arrow="bottom"]::before {
  bottom: -16px; left: 24px;
  border-top-color: var(--main);
}

/* ============ 토스트 ============ */
.tut-toast {
  position: fixed;
  bottom: 28px; left: 50%; transform: translate(-50%, 16px);
  background: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.tut-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.tut-toast--success { background: #228335; }
.tut-toast--error { background: #D61919; }

/* ============ 완료 모달 ============ */
.tut-complete {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: none; align-items: center; justify-content: center;
  z-index: 1100; opacity: 0; transition: opacity .3s ease;
}
.tut-complete.is-open { display: flex; opacity: 1; }
.tut-complete__card {
  background: #fff;
  border-radius: 4px;
  padding: 40px 36px;
  text-align: center;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  position: relative;
  z-index: 2;
}
.tut-complete__card .emoji { font-size: 56px; margin-bottom: 8px; display: block; }
.tut-complete__card h2 {
  margin: 0 0 12px; font-size: 22px; color: var(--main); font-weight: 800;
}
.tut-complete__card p { color: var(--pv-text3); line-height: 1.6; font-size: 14px; margin: 0 0 20px; }
.tut-complete__steps {
  display: flex; gap: 8px; justify-content: center;
  margin: 20px 0; font-size: 12px; color: var(--pv-muted);
}
.tut-complete__steps .s {
  background: #fffaf5; color: var(--main); padding: 6px 10px; border-radius: 4px; font-weight: 700;
}
.tut-complete__btns {
  display: flex; gap: 10px; justify-content: center;
}
.tut-complete__btns .btn {
  height: 40px; padding: 0 20px; border-radius: 4px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 14px; font-family: inherit;
  display: inline-flex; align-items: center;
}
.tut-complete__btns .btn--main { background: var(--main); color: #fff; text-decoration: none; }
.tut-complete__btns .btn--main:hover { background: #570400; }
.tut-complete__btns .btn--out { background: #fff; color: var(--pv-text3); border: 1px solid var(--pv-border); }
.tut-complete__btns .btn--out:hover { color: var(--main); border-color: var(--main); }

/* 컨페티 */
.confetti {
  position: absolute; width: 8px; height: 14px;
  top: -20px; opacity: .9; border-radius: 2px;
  animation: confettiFall 2.4s linear infinite;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotateZ(0); opacity: 1; }
  100% { transform: translateY(110vh) rotateZ(720deg); opacity: 0; }
}

/* ============ 진행 바 ============ */
.tut-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; background: rgba(129, 43, 39, .15);
  z-index: 1200;
}
.tut-progress__bar {
  height: 100%; background: var(--main);
  width: 0; transition: width .3s ease;
}

/* ============ 반응형 ============ */
@media (max-width: 768px) {
  .tut-shell { grid-template-columns: 68px 1fr; }
  .side-menu { padding: 12px; }
  .logo-box, .section-title, .menu-txt, .side-menu-info { display: none; }
  .menu-box { padding: 14px 0; justify-content: center; }
  .pv-form .row { grid-template-columns: 1fr; }
  .pv-form .row.col2 { grid-template-columns: 1fr; }
  .pv-form .two-col { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .pv-view { padding: 24px; }
  .page-title { font-size: 24px; }
}

/* ============ 튜토리얼 셸 보정 ============ */
/* 실제 앱은 페이지마다 전체 화면을 쓰지만, 튜토리얼은 한 문서 안에서 화면만 갈아 끼운다.
   그래서 스크롤 컨테이너를 하나 두고(.pv-view) 화면을 그 안에서 전환한다. */
html, body { height: 100%; }
.pv-view { min-height: 100vh; overflow-y: auto; }

/* 튜토리얼 표시용 상단 바 — 실제 앱에는 없는 요소 */
.tut-topbar {
  /* 앱 헤더(회사명·사용자명)를 가리지 않도록 우측 하단에 둔다 */
  position: fixed; bottom: 18px; right: 18px; z-index: 400;
  background: rgba(255,255,255,.94); border: 1px solid #e8dedd; border-radius: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px 8px 14px; font-size: 13px; color: #6b5f5d;
}
.tut-topbar__chip {
  background: #f4ebea; color: #812B27; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; font-size: 12px;
}
.tut-topbar__exit {
  border: 1px solid #e0d3d1; background: #fff; color: #6b5f5d;
  border-radius: 8px; padding: 5px 12px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; text-decoration: none;
}
.tut-topbar__exit:hover { border-color: #812B27; color: #812B27; }

/* 강조 대상 행 */
tr.is-target > td { background: #fff8f5; }

/* ============ 팝업(매칭·발행) ============
   실제 앱은 <dialog>.showModal() 로 띄우고 match-popup.css 가 dialog 상태를 전제로 스타일한다.
   튜토리얼은 스포트라이트 제어 때문에 <div> + .is-open 으로 여닫으므로,
   오버레이·박스 껍데기만 여기서 잡아 준다(안쪽 요소는 앱 CSS 가 그대로 칠한다). */
#matchModal, #issueModal {
  display: none;
  position: fixed; inset: 0; z-index: 550;
  background: rgba(34, 30, 28, .5);
  align-items: center; justify-content: center;
  padding: 24px;
}
#matchModal.is-open, #issueModal.is-open { display: flex; }
#matchModal .match-popup-content,
#issueModal .match-popup-content {
  position: relative;
  background: #fff; border-radius: 16px;
  padding: 30px 32px;
  width: min(760px, 96vw); max-height: 86vh; overflow-y: auto;
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
}
#matchModal .popup-close-button,
#issueModal .popup-close-button {
  position: absolute; top: 14px; right: 16px;
  border: 0; background: transparent; font-size: 26px; line-height: 1;
  color: #9c908e; cursor: pointer; padding: 4px 8px;
}
#matchModal .popupTitle, #issueModal .popupTitle {
  font-size: 20px; font-weight: 800; color: #221e1c; margin: 0 0 20px;
}
/* 팝업 안의 입력 줄 — 앱의 .frow 를 튜토리얼에서도 쓰되 최소 정렬만 보정 */
#matchModal .frow, #issueModal .frow,
.rn-create .frow {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
#matchModal .frow > label, #issueModal .frow > label,
.rn-create .frow > label {
  flex: 0 0 150px; font-size: 13px; font-weight: 700; color: #4a4341;
}
#matchModal .frow input, #issueModal .frow input,
.rn-create .frow input {
  flex: 1; padding: 9px 12px; border: 1px solid #e0d3d1; border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff; color: #221e1c;
}
#matchModal .frow input[readonly], #issueModal .frow input[readonly],
.rn-create .frow input[readonly] { background: #f7f4f3; color: #221e1c; }
#tax-type-btns label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
#tax-type-btns input { accent-color: #812B27; }
