/* ─── Bag3D Vision – 커스텀 스타일 ──────────────────────────────────────── */

body { background: #f4f6fb; font-family: 'Segoe UI', sans-serif; }

/* 스텝 배지 */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #0d6efd;
  color: #fff;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── 드롭 존 ─────────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed #adb5bd;
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: #0d6efd;
  background: #f0f5ff;
}
.drop-zone.uploaded {
  border-color: #198754;
  background: #f0fff4;
}

/* ─── AI 엔진 카드 ────────────────────────────────────────────────────────── */
.engine-card {
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.engine-card:hover  { border-color: #86b7fe; background: #f8f9ff; }
.engine-card.selected {
  border-color: #0d6efd;
  background: #e8f0fe;
}
.engine-card.selected .engine-check { display: inline-block !important; }

/* ─── 색상 스와치 ─────────────────────────────────────────────────────────── */
.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.color-swatch:hover    { transform: scale(1.15); }
.color-swatch.selected { border-color: #0d6efd; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0d6efd; }

/* ─── 렌더링 스테이지 ────────────────────────────────────────────────────── */
.stage-item { color: #adb5bd; transition: color .3s; }
.stage-item.active  { color: #0d6efd; font-weight: 600; }
.stage-item.done    { color: #198754; }
.stage-item.active .bi::before  { content: "\f54d"; /* bi-arrow-right-circle */ }
.stage-item.done   .bi::before  { content: "\f270"; /* bi-check-circle-fill */ }

/* ─── 결과 이미지 ─────────────────────────────────────────────────────────── */
.result-img-card {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #dee2e6;
  transition: box-shadow .2s;
}
.result-img-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.result-img-card img   { width: 100%; height: 220px; object-fit: cover; }
.result-img-card .angle-label {
  font-size: .75rem;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  position: absolute;
  bottom: 8px;
  left: 8px;
}

/* ─── 패턴 미리보기 ──────────────────────────────────────────────────────── */
.pattern-svg-area {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pattern-svg-area svg {
  width: 100%;
  height: auto;
  max-height: 400px;
}
.pattern-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}
.pattern-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: .85rem;
  cursor: pointer;
  transition: background .12s;
}
.pattern-item:hover { background: #f8f9ff; }
.pattern-item:last-child { border-bottom: none; }
.pattern-item .pattern-color {
  width: 14px; height: 14px;
  border-radius: 3px; flex-shrink: 0;
}
.pattern-item .pattern-type-badge {
  font-size: .7rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: #e9ecef;
  color: #495057;
}
.pattern-item.deselected {
  opacity: .45;
  text-decoration: line-through;
}
.pattern-item.highlighted {
  background: #e8f0fe;
  box-shadow: inset 3px 0 0 #0d6efd;
}

/* SVG 패턴 조각 인터랙션 */
.pattern-svg-area svg polygon,
.pattern-svg-area svg path {
  cursor: pointer;
  transition: fill-opacity .15s, stroke-width .15s;
}
.pattern-svg-area svg polygon:hover,
.pattern-svg-area svg path:hover {
  fill-opacity: .5;
}
.pattern-svg-area svg polygon.svg-highlight,
.pattern-svg-area svg path.svg-highlight {
  fill-opacity: .6;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 4px rgba(13,110,253,.5));
}
.pattern-svg-area svg polygon.svg-dimmed,
.pattern-svg-area svg path.svg-dimmed {
  fill-opacity: .08;
  stroke-opacity: .3;
}

/* 부위 지정 드롭다운 */
.pattern-type-select {
  font-size: .75rem;
  padding: 0 4px;
  height: 22px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  max-width: 110px;
}
.pattern-type-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 2px rgba(13,110,253,.15);
  outline: none;
}

/* 패턴 정보 툴팁 (SVG 위) */
.pattern-tooltip {
  position: absolute;
  background: rgba(0,0,0,.85);
  color: #fff;
  font-size: .75rem;
  padding: 6px 10px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  margin-top: -8px;
}

/* ─── 카드 헤더 ───────────────────────────────────────────────────────────── */
.card-header {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: .75rem 1rem;
}

/* ─── 히스토리 카드 ──────────────────────────────────────────────────────── */
.history-card {
  border: 1px solid #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  background: #fff;
  height: 100%;
}
.history-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.history-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f8f9fa;
}
.history-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.history-engine-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .03em;
}
.history-dur-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .65rem;
  padding: 2px 5px;
  border-radius: 4px;
}
.history-card-body {
  padding: 8px 10px;
}
