/* =============================================================================
   [PairCalibration] 페어 반응 캘리브레이션 모달 스타일
   ============================================================================= */

/* ── 모달 오버레이 ── */
.pc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pc-fade-in 0.2s ease;
}

@keyframes pc-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pc-modal {
  background: #fff;
  border-radius: 18px;
  max-width: 1400px;
  width: 100%;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

/* ── 헤더 ── */
.pc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  color: #fff;
}

.pc-modal-title {
  font-size: 20px;
  font-weight: 900;
}

.pc-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: background 0.15s;
}

.pc-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── 바디 ── */
.pc-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

/* ── 카메라 영역 ── */
.pc-camera-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pc-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pc-canvas {
  display: none; /* 색상 픽 용도, 화면에 표시 X */
}

.pc-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;  /* 자식만 이벤트 받음 */
}

.pc-overlay > * {
  pointer-events: auto;
}

.pc-cam-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #888;
  background: #1a1a1a;
}

.pc-cam-icon { font-size: 56px; opacity: 0.6; }
.pc-cam-msg { font-size: 15px; font-weight: 700; color: #aaa; }

/* ── 청/홍 구분 라인 ── */
.pc-divider {
  position: absolute;
  background: rgba(255, 214, 0, 0.7);
  cursor: move;
  z-index: 5;
  transition: background 0.15s;
}

.pc-divider:hover {
  background: rgba(255, 214, 0, 1);
}

.pc-divider-h {
  left: 0;
  right: 0;
  height: 3px;
  cursor: ns-resize;
  transform: translateY(-1.5px);
}

.pc-divider-v {
  top: 0;
  bottom: 0;
  width: 3px;
  cursor: ew-resize;
  transform: translateX(-1.5px);
}

/* ── 영역 박스 (8개) ── */
.pc-box {
  position: absolute;
  background: rgba(0, 0, 0, 0.1);
  border: 3px solid;
  border-radius: 6px;
  cursor: move;
  user-select: none;
  transition: background 0.15s;
}

.pc-box:hover {
  background: rgba(255, 255, 255, 0.15);
}

.pc-box-label {
  position: absolute;
  top: -2px;
  left: -2px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  border-radius: 4px 0 4px 0;
}

.pc-box-color {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pc-resize-handle {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid #333;
  border-radius: 50%;
  cursor: se-resize;
  z-index: 2;
}

/* ── 컨트롤 버튼 ── */
.pc-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pc-btn-primary,
.pc-btn-secondary,
.pc-btn-outline {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.15s;
}

.pc-btn-primary {
  background: #1a1a1a;
  color: #00FF88;
}

.pc-btn-primary:hover {
  background: #333;
}

.pc-btn-secondary {
  background: #2196F3;
  color: #fff;
}

.pc-btn-secondary:hover {
  background: #1976D2;
}

.pc-btn-outline {
  background: transparent;
  color: #666;
  border: 1px solid #ccc;
}

.pc-btn-outline:hover {
  background: #f5f5f5;
}

/* ── 안내 텍스트 ── */
.pc-hint {
  padding: 12px 14px;
  background: #FFFDE7;
  border: 1px solid #FBC02D;
  border-radius: 10px;
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}

.pc-hint b {
  color: #F57F17;
  font-weight: 900;
}

/* ── 푸터 ── */
.pc-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
}

/* ── 모바일 ── */
@media (max-width: 768px) {
  .pc-modal-overlay { padding: 0; }
  .pc-modal {
    border-radius: 0;
    max-height: 100vh;
    height: 100vh;
  }
  .pc-modal-title { font-size: 16px; }
  .pc-box-label { font-size: 11px; padding: 1px 5px; }
  .pc-box-color { width: 14px; height: 14px; top: 2px; right: 2px; }
  .pc-btn-primary, .pc-btn-secondary, .pc-btn-outline {
    padding: 10px 14px; font-size: 13px;
  }
}

/* ═══════════════ 실시간 색상 추적 ═══════════════ */

/* 영역 안의 추적 상태 라벨 (✓ 85% / ✗ 미감지) */
.pc-track-status {
  position: absolute;
  bottom: 4px;
  left: 4px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 8px;
  font-family: 'Share Tech Mono', monospace;
  pointer-events: none;
  z-index: 5;
  letter-spacing: 0.5px;
}

/* 추적 중심점 (영역 위에 표시되는 점) */
.pc-track-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6),
              0 0 0 2px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  transition: left 0.1s linear, top 0.1s linear;
  animation: pc-dot-pulse 1.2s ease-in-out infinite;
}

@keyframes pc-dot-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50%      { transform: translate(-50%, -50%) scale(1.3); opacity: 0.85; }
}