/* =====================================================================
 * dash-help.css — 대시보드 항목별 도움말 (? 아이콘 팝업 + 가이드 투어)
 *   2026-05-25 신규
 *   · .help-q       — 카드 헤더에 자동 주입되는 작은 ? 버튼
 *   · .help-pop     — ? 클릭 시 뜨는 도움말 팝업 (앵커 근처 / 모바일=하단시트)
 *   · .help-tour-*  — 상단 '도움말' → 가이드 투어 (스포트라이트 오버레이)
 * ===================================================================== */

/* ── ? 버튼 ───────────────────────────────────────────────────────── */
.help-q{
  display:inline-flex;align-items:center;justify-content:center;
  width:17px;height:17px;flex:none;padding:0;margin:0;
  border:0;border-radius:50%;cursor:pointer;
  font-size:10px;font-weight:800;font-family:inherit;line-height:1;
  color:#fff;background:linear-gradient(135deg,#0ea5e9,#7c3aed);
  box-shadow:0 1px 4px rgba(124,58,237,.4);
  -webkit-appearance:none;appearance:none;
  transition:transform .15s,box-shadow .15s;
}
.help-q:hover{transform:scale(1.15);box-shadow:0 2px 8px rgba(124,58,237,.6)}
.help-q.help-q-chd{                 /* .card-tools 안에 들어갈 때 약간 크게 */
  width:19px;height:19px;font-size:11px;
}

/* ── 제목 트리거 — 카드 헤더 왼쪽 제목에 호버/클릭으로 도움말 ───────── */
.help-title{
  cursor:help;border-radius:4px;
  transition:background .12s,box-shadow .12s;
}
.help-title:hover{
  background:rgba(124,58,237,.12);
  box-shadow:0 0 0 3px rgba(124,58,237,.12);
}
[data-theme="dark"] .help-title:hover{
  background:rgba(168,139,250,.22);
  box-shadow:0 0 0 3px rgba(168,139,250,.18);
}

/* ── 도움말 팝업 ──────────────────────────────────────────────────── */
.help-pop{
  position:fixed;z-index:100050;display:none;
  width:330px;max-width:calc(100vw - 24px);
  background:#fff;border-radius:13px;overflow:hidden;
  box-shadow:0 18px 50px rgba(15,23,42,.4),0 0 0 1px rgba(15,23,42,.06);
  font-family:'Pretendard','Malgun Gothic',sans-serif;
  color:#0f172a;
  animation:helpPopIn .18s cubic-bezier(.3,.7,.4,1.3);
}
@keyframes helpPopIn{from{opacity:0;transform:translateY(8px) scale(.97)}to{opacity:1;transform:none}}
.help-pop-hd{
  display:flex;align-items:center;gap:9px;
  padding:12px 14px;color:#fff;
  background:linear-gradient(135deg,var(--hpc1,#0891b2),var(--hpc2,#7c3aed));
}
.help-pop-hd .hp-ic{
  width:32px;height:32px;flex:none;border-radius:9px;
  background:rgba(255,255,255,.22);
  display:flex;align-items:center;justify-content:center;font-size:15px;
}
.help-pop-hd .hp-tt{flex:1;min-width:0;font-size:14px;font-weight:800;letter-spacing:-.3px}
.help-pop-hd .hp-tt small{display:block;font-size:10.5px;font-weight:600;opacity:.85;margin-top:1px}
.help-pop-hd .hp-x{
  width:24px;height:24px;flex:none;border:0;cursor:pointer;border-radius:7px;
  background:rgba(255,255,255,.18);color:#fff;font-size:13px;
  display:flex;align-items:center;justify-content:center;
  -webkit-appearance:none;appearance:none;
}
.help-pop-hd .hp-x:hover{background:rgba(255,255,255,.36)}
.help-pop-bd{
  padding:13px 15px 15px;font-size:12.5px;line-height:1.62;color:#334155;
  max-height:min(58vh,460px);overflow-y:auto;overscroll-behavior:contain;
}
.help-pop-bd::-webkit-scrollbar{width:7px}
.help-pop-bd::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:4px}
.help-pop-bd h5{
  font-size:11.5px;font-weight:800;color:#0f172a;margin:13px 0 5px;
  display:flex;align-items:center;gap:6px;
}
.help-pop-bd h5:first-child{margin-top:0}
.help-pop-bd h5 i{color:#7c3aed;font-size:11px;width:13px;text-align:center}
.help-pop-bd p{margin:0 0 6px}
.help-pop-bd ul{list-style:none;padding:0;margin:2px 0 8px}
.help-pop-bd li{
  position:relative;padding:3px 0 3px 15px;
  border-bottom:1px dashed #eef2f7;
}
.help-pop-bd li:last-child{border-bottom:0}
.help-pop-bd li::before{
  content:'▸';position:absolute;left:1px;top:3px;color:#0ea5e9;font-weight:800;
}
.help-pop-bd b{color:#0f172a}
.help-pop-bd .hp-tag{
  display:inline-block;padding:1px 7px;border-radius:9px;margin:1px 2px 1px 0;
  font-size:10.5px;font-weight:700;background:#eef2ff;color:#4f46e5;
}
.help-pop-bd .hp-note{
  margin-top:9px;padding:8px 10px;border-radius:8px;
  background:#fffbeb;border-left:3px solid #f59e0b;
  font-size:11.5px;color:#78350f;line-height:1.6;
}
.help-pop-bd .hp-note i{color:#d97706;margin-right:4px}
.help-pop-bd .hp-link{
  display:inline-flex;align-items:center;gap:5px;margin-top:10px;
  font-size:11.5px;font-weight:700;color:#0891b2;text-decoration:none;
}
.help-pop-bd .hp-link:hover{text-decoration:underline}

/* ── 융복합 시너지 배너 (모든 카드 도움말 팝업 하단) ─────────────── */
.hp-synergy{
  margin:12px 0 4px;padding:10px 12px;border-radius:9px;
  background:linear-gradient(135deg,#eef2ff 0%,#fef3c7 100%);
  border-left:3px solid #7c3aed;
  display:flex;align-items:flex-start;gap:9px;
  box-shadow:0 2px 6px rgba(124,58,237,0.10);
}
.hp-sg-ic{font-size:17px;line-height:1.1;flex:none}
.hp-sg-tx{flex:1;min-width:0;line-height:1.45}
.hp-sg-tx b{display:block;font-size:11px;font-weight:800;color:#5b21b6;letter-spacing:-.2px}
.hp-sg-tx span{display:block;font-size:10.5px;color:#78350f;margin-top:3px;font-weight:600}
[data-theme="dark"] .hp-synergy{
  background:linear-gradient(135deg,#1e1b4b 0%,#3b1d0f 100%);
  border-left-color:#a78bfa;
}
[data-theme="dark"] .hp-sg-tx b{color:#c4b5fd}
[data-theme="dark"] .hp-sg-tx span{color:#fde68a}

/* ── 가이드 투어 — 스포트라이트 오버레이 ─────────────────────────── */
.help-tour-mask{
  position:fixed;z-index:100040;border-radius:12px;
  box-shadow:0 0 0 9999px rgba(8,15,30,.66);
  pointer-events:none;
  transition:all .32s cubic-bezier(.4,0,.2,1);
}
.help-tour-ring{
  position:fixed;z-index:100041;border-radius:14px;
  border:2.5px solid #38bdf8;
  box-shadow:0 0 22px rgba(56,189,248,.7);
  pointer-events:none;
  transition:all .32s cubic-bezier(.4,0,.2,1);
}

/* 투어 말풍선 — help-pop 재사용하되 투어 전용 nav 추가 */
.help-pop.help-tour-pop{z-index:100042}
.help-tour-nav{
  display:flex;align-items:center;gap:7px;flex-wrap:wrap;
  padding:10px 14px;background:#f8fafc;border-top:1px solid #eef2f7;
}
.help-tour-step{
  font-size:11px;font-weight:800;color:#64748b;margin-right:auto;
}
.help-tour-step b{color:#7c3aed}
.help-tour-btn{
  border:0;cursor:pointer;border-radius:8px;
  padding:6px 13px;font-size:11.5px;font-weight:800;font-family:inherit;
  -webkit-appearance:none;appearance:none;transition:filter .15s;
}
.help-tour-btn:hover{filter:brightness(1.08)}
.help-tour-btn.prev{background:#e2e8f0;color:#475569}
.help-tour-btn.next{background:linear-gradient(135deg,#0ea5e9,#7c3aed);color:#fff}
.help-tour-btn:disabled{opacity:.4;cursor:default;filter:none}

/* 자동/수동 토글 + 일시정지 */
.help-tour-mode{
  border:0;cursor:pointer;border-radius:7px;padding:5px 9px;
  font-size:10.5px;font-weight:800;font-family:inherit;
  background:#e2e8f0;color:#475569;-webkit-appearance:none;appearance:none;
  transition:filter .15s;
}
.help-tour-mode:hover{filter:brightness(1.06)}
.help-tour-mode.on{background:linear-gradient(135deg,#0ea5e9,#7c3aed);color:#fff}
.help-tour-pause{
  width:26px;height:26px;flex:none;border:0;cursor:pointer;border-radius:7px;
  background:#e2e8f0;color:#475569;font-size:11px;
  display:flex;align-items:center;justify-content:center;
  -webkit-appearance:none;appearance:none;
}
.help-tour-pause:hover{background:#cbd5e1}
.help-tour-spd{
  height:26px;flex:none;cursor:pointer;border-radius:7px;
  border:1px solid #cbd5e1;background:#fff;color:#475569;
  font-size:10.5px;font-weight:700;font-family:inherit;
  padding:0 4px;-webkit-appearance:menulist;
}
/* 자동 진행 바 */
.help-tour-prog{height:3px;background:#eef2f7;overflow:hidden}
.help-tour-prog .bar{display:block;height:100%;width:0;
  background:linear-gradient(90deg,#0ea5e9,#7c3aed)}
[data-theme="dark"] .help-tour-mode{background:#1e293b;color:#cbd5e1}
[data-theme="dark"] .help-tour-pause{background:#1e293b;color:#cbd5e1}
[data-theme="dark"] .help-tour-spd{background:#1e293b;color:#cbd5e1;border-color:#334155}
[data-theme="dark"] .help-tour-prog{background:#1e293b}

/* ── 상단 도움말 메뉴 (가이드투어 / 전체설명서 선택) ─────────────── */
.help-menu{
  position:fixed;z-index:100050;display:none;
  width:230px;background:#fff;border-radius:12px;overflow:hidden;
  box-shadow:0 16px 44px rgba(15,23,42,.34),0 0 0 1px rgba(15,23,42,.06);
  font-family:'Pretendard','Malgun Gothic',sans-serif;
  animation:helpPopIn .16s cubic-bezier(.3,.7,.4,1.3);
}
.help-menu-it{
  display:flex;align-items:center;gap:11px;padding:13px 15px;cursor:pointer;
  color:#0f172a;text-decoration:none;font-size:13px;font-weight:700;
  border-bottom:1px solid #f1f5f9;transition:background .14s;
}
.help-menu-it:last-child{border-bottom:0}
.help-menu-it:hover{background:#f0f9ff}
.help-menu-it .hm-ic{
  width:34px;height:34px;flex:none;border-radius:9px;color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:15px;
}
.help-menu-it.it1 .hm-ic{background:linear-gradient(135deg,#0ea5e9,#0891b2)}
.help-menu-it.it2 .hm-ic{background:linear-gradient(135deg,#a855f7,#7c3aed)}
.help-menu-it.it3 .hm-ic{background:linear-gradient(135deg,#10b981,#059669)}
.help-menu-it .hm-tx b{display:block;font-size:13px}
.help-menu-it .hm-tx span{display:block;font-size:10.5px;color:#64748b;font-weight:500;margin-top:1px}

/* ── 다크 테마 보정 ──────────────────────────────────────────────── */
[data-theme="dark"] .help-pop,[data-theme="dark"] .help-menu{background:#0f172a;color:#e2e8f0}
[data-theme="dark"] .help-pop-bd{color:#cbd5e1}
[data-theme="dark"] .help-pop-bd h5{color:#f1f5f9}
[data-theme="dark"] .help-pop-bd b{color:#f8fafc}
[data-theme="dark"] .help-pop-bd li{border-bottom-color:#1e293b}
[data-theme="dark"] .help-pop-bd li::before{color:#38bdf8}
[data-theme="dark"] .help-pop-bd .hp-tag{background:#1e1b4b;color:#c4b5fd}
[data-theme="dark"] .help-tour-nav{background:#0b1120;border-top-color:#1e293b}
[data-theme="dark"] .help-tour-btn.prev{background:#1e293b;color:#cbd5e1}
[data-theme="dark"] .help-menu-it{color:#e2e8f0;border-bottom-color:#1e293b}
[data-theme="dark"] .help-menu-it:hover{background:#1e293b}
[data-theme="dark"] .help-menu-it .hm-tx span{color:#94a3b8}

/* ── 모바일 — 팝업/말풍선을 하단 시트로 ──────────────────────────── */
@media(max-width:768px){
  .help-pop{
    left:8px!important;right:8px!important;bottom:8px!important;
    top:auto!important;width:auto!important;max-width:none!important;
    border-radius:15px 15px 12px 12px;
  }
  .help-pop-bd{max-height:52vh}
  .help-menu{
    left:8px!important;right:8px!important;width:auto!important;
    top:auto!important;bottom:8px!important;
  }
  .help-q{width:19px;height:19px;font-size:11px}
  .help-q.help-q-chd{width:21px;height:21px}
  .help-tour-mask{box-shadow:0 0 0 9999px rgba(8,15,30,.72)}
}
