/**
 * qa_helper.css
 * 작성일: 2026-05-13
 * 작성 목적: pfs 검증 도구 — 토글 버튼 + 사이드바 + element 하이라이트
 * 변경 이유: 사용자 직접 검증 효율화 (element 위치/코멘트 누적 → 채티 전달)
 *
 * 모든 셀렉터에 .qa-h-* prefix 또는 #qa-helper-* 사용 (페이지 CSS와 충돌 회피)
 * z-index는 매우 높게 (모달 위에도 떠야 함)
 */

/* ===== 토글 버튼 (우측 상단 floating) ===== */
#qa-helper-toggle {
  position: fixed !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 99998 !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 22px !important;
  background: #7460ee !important;   /* pfs accent 보라 */
  color: #fff !important;
  border: 2px solid #fff !important;
  box-shadow: 0 4px 12px rgba(116,96,238,.4) !important;
  cursor: pointer !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform .15s, background .15s !important;
  user-select: none !important;
}
#qa-helper-toggle:hover {
  transform: scale(1.08);
  background: #5e4dd6 !important;
}
#qa-helper-toggle.active {
  background: #fc4b6c !important;   /* 활성 시 빨강 (멈춤 버튼처럼) */
  animation: qa-pulse 1.4s infinite;
}
@keyframes qa-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(252,75,108,.4); }
  50%      { box-shadow: 0 4px 18px rgba(252,75,108,.7); }
}
#qa-helper-toggle .qa-count {
  position: absolute;
  top: -4px; right: -4px;
  background: #fff;
  color: #7460ee;
  border-radius: 10px;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  font-size: 11px; font-weight: 700;
  line-height: 20px; text-align: center;
  display: none;
}
#qa-helper-toggle .qa-count.show { display: block; }

/* ===== 사이드바 패널 ===== */
#qa-helper-panel {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  width: 380px !important;
  height: 100vh !important;
  background: #fff !important;
  border-left: 1px solid #d6dde3 !important;
  box-shadow: -4px 0 16px rgba(0,0,0,.08) !important;
  z-index: 99997 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%);
  transition: transform .25s ease-out;
  font-family: 'Noto Sans KR', -apple-system, system-ui, sans-serif !important;
  font-size: 13px !important;
  color: #2c3e50 !important;
}
#qa-helper-panel.open {
  transform: translateX(0);
}

#qa-helper-panel .qa-h-head {
  padding: 12px 16px;
  background: #7460ee;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#qa-helper-panel .qa-h-head h3 {
  margin: 0; font-size: 14px; font-weight: 700;
}
#qa-helper-panel .qa-h-head .qa-h-close {
  background: rgba(255,255,255,.18);
  color: #fff; border: 0;
  width: 28px; height: 28px; border-radius: 4px;
  cursor: pointer; font-size: 16px;
}

#qa-helper-panel .qa-h-status {
  padding: 8px 16px;
  background: #fff8e1;
  border-bottom: 1px solid #e6c870;
  font-size: 12px;
  color: #8a6d11;
  display: flex; align-items: center; gap: 8px;
}
#qa-helper-panel .qa-h-status.active {
  background: #e8f5e9;
  border-bottom-color: #66bb6a;
  color: #2e7d32;
}
#qa-helper-panel .qa-h-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #8a6d11;
}
#qa-helper-panel .qa-h-status.active .dot {
  background: #2e7d32;
  animation: qa-blink 1.2s infinite;
}
@keyframes qa-blink {
  0%,100% { opacity: 1; } 50% { opacity: .4; }
}

#qa-helper-panel .qa-h-tools {
  padding: 10px 12px;
  border-bottom: 1px solid #e6ebef;
  display: flex; gap: 6px; flex-wrap: wrap;
  flex-shrink: 0;
}
#qa-helper-panel .qa-h-tools button {
  font-size: 12px; padding: 6px 10px; border-radius: 4px;
  border: 1px solid #d6dde3; background: #fff; color: #2c3e50;
  cursor: pointer; font-weight: 600;
}
#qa-helper-panel .qa-h-tools button.primary {
  background: #1e88e5 !important; color: #fff !important; border-color: #1e88e5 !important;
}
#qa-helper-panel .qa-h-tools button.warn {
  background: #fc4b6c !important; color: #fff !important; border-color: #fc4b6c !important;
}
#qa-helper-panel .qa-h-tools button.accent {
  background: #7460ee !important; color: #fff !important; border-color: #7460ee !important;
}

#qa-helper-panel .qa-h-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}
#qa-helper-panel .qa-h-empty {
  text-align: center;
  padding: 40px 16px;
  color: #8a96a3;
  font-size: 12px;
  line-height: 1.6;
}

#qa-helper-panel .qa-h-item {
  background: #f6f8fa;
  border: 1px solid #d6dde3;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
#qa-helper-panel .qa-h-item-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
#qa-helper-panel .qa-h-item-no {
  background: #7460ee; color: #fff;
  width: 24px; height: 24px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
#qa-helper-panel .qa-h-item-del {
  background: transparent; border: 0; cursor: pointer; color: #fc4b6c;
  font-size: 14px; padding: 0 4px;
}
#qa-helper-panel .qa-h-item-meta {
  font-size: 11px; color: #4a5765; line-height: 1.4;
  background: #fff;
  border: 1px solid #e6ebef;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 6px;
  font-family: 'Consolas', 'Monaco', monospace;
  word-break: break-all;
}
#qa-helper-panel .qa-h-item-meta b { color: #2c3e50; }
#qa-helper-panel .qa-h-item-meta .qa-page-url {
  color: #7460ee; font-size: 10.5px;
}
#qa-helper-panel .qa-h-item input,
#qa-helper-panel .qa-h-item textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid #d6dde3; border-radius: 4px;
  padding: 6px 8px; font-size: 12px;
  font-family: inherit; color: #2c3e50;
  margin-bottom: 6px;
}
#qa-helper-panel .qa-h-item textarea {
  min-height: 60px; resize: vertical;
}
#qa-helper-panel .qa-h-item input:focus,
#qa-helper-panel .qa-h-item textarea:focus {
  outline: 2px solid #7460ee; border-color: #7460ee;
}
#qa-helper-panel .qa-h-item-label {
  display: block; font-size: 10.5px; color: #8a96a3;
  margin-bottom: 2px; font-weight: 600;
}

/* ===== Element 호버 하이라이트 (검증 모드 ON 시) ===== */
.qa-h-highlight {
  outline: 2px dashed #7460ee !important;
  outline-offset: 1px !important;
  background-color: rgba(116, 96, 238, .08) !important;
  cursor: crosshair !important;
}

/* element 호버 시 라벨 (셀렉터 미리보기) */
#qa-helper-hover-label {
  position: fixed !important;
  z-index: 99999 !important;
  background: #2c3e50 !important;
  color: #fff !important;
  font-size: 11px !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  pointer-events: none !important;
  font-family: 'Consolas', 'Monaco', monospace !important;
  max-width: 320px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: none;
}

/* 본문 컨텐츠 우측 여백 (사이드바 열려있을 때 콘텐츠 안 가리도록) */
body.qa-h-panel-open { padding-right: 380px !important; transition: padding-right .25s; }

/* 토스트 (복사 완료 등) */
#qa-helper-toast {
  position: fixed !important;
  bottom: 30px !important; right: 30px !important;
  z-index: 99999 !important;
  background: #2c3e50; color: #fff;
  padding: 12px 18px;
  border-radius: 4px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
#qa-helper-toast.show {
  opacity: 1; transform: translateY(0);
}

/* 검증 모드일 때 입력 폼 클릭 방해 회피 표시 */
body.qa-h-picking * {
  caret-color: transparent !important;  /* 클릭 시 input 텍스트 커서 깜박임 방지 */
}
/* 그러나 사이드바 내부는 정상 동작 */
body.qa-h-picking #qa-helper-panel * {
  caret-color: auto !important;
}
