/* 팀 콘텐츠 제작 — 외부 레퍼런스와 시각 차별화 (보라/녹색 톤) */
:root {
  --prod-accent: #6e58d6;
  --prod-accent-soft: #ece9fb;
  --prod-success: #1f9d7a;
  --prod-success-soft: #e0f8f1;
  --prod-warn: #d49a1e;
  --prod-warn-soft: #fff4d9;
}

.top-tabs .tab.active { color: var(--prod-accent); }
.top-tabs .tab:hover { color: var(--prod-accent); }

header { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; }
.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
}
.who-chip {
  font-size: 12px;
  padding: 4px 10px;
  background: #f4f4f4;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}
.who-chip:hover { background: var(--prod-accent-soft); border-color: var(--prod-accent); color: var(--prod-accent); }
.primary-btn {
  font: inherit;
  padding: 8px 16px;
  background: var(--prod-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.primary-btn:hover { background: #5847b8; }

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  padding: 6px 8px;
}

/* ── Cards ───────────────────────────────────────── */
.section { margin-bottom: 32px; }
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.section-title .muted { color: var(--muted); font-weight: 500; font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.thumb {
  aspect-ratio: 4 / 5;
  background: #f0f0f0 center/cover no-repeat;
  position: relative;
}
.thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #bbb;
  height: 100%;
}
.thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
  pointer-events: none; /* 카드 클릭 이벤트가 카드로 전파되도록 */
}
.uploader-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--prod-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.metrics-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--prod-success);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.metrics-badge.no-metrics {
  background: rgba(0, 0, 0, 0.45);
}

.body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.campaign { font-weight: 700; font-size: 14px; line-height: 1.3; word-break: break-word; }
.brand { font-size: 12px; color: var(--muted); }
.meta { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; }

.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  margin-top: 4px;
  padding: 8px;
  background: var(--prod-success-soft);
  border-radius: 6px;
}
.metric { text-align: center; }
.metric-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.metric-value { font-size: 13px; font-weight: 700; color: var(--prod-success); }
.metrics-row.no-data { background: #fafaf7; border: 1px dashed #ddd; }
.metrics-row.no-data .metric-value { color: var(--muted); font-weight: 500; }

.feedback-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  padding: 2px 8px;
  background: #f4f4f4;
  border-radius: 999px;
}

/* ── AI tag chips (재사용) ──────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.chip {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
}
.chip-cat  { background: var(--prod-accent-soft); color: var(--prod-accent); }
.chip-type { background: #eef4ff; color: #2553ab; }
.chip-mood { background: var(--prod-success-soft); color: var(--prod-success); }

/* ── Modal ───────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  position: relative;
}
.modal-card.modal-detail { max-width: 720px; }
.modal-card h3 { margin: 0 0 12px; font-size: 18px; }
.modal-card .hint { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.modal-close {
  position: absolute;
  top: 8px; right: 12px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 10px;
}
.modal-close:hover { color: var(--text); }

.modal-card .row {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.modal-card .row > span { font-size: 13px; color: var(--muted); }
.modal-card input[type="text"],
.modal-card input[type="number"],
.modal-card input[type="date"],
.modal-card select,
.modal-card textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  width: 100%;
}
.modal-card input:focus, .modal-card textarea:focus, .modal-card select:focus {
  border-color: var(--prod-accent);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.modal-actions button {
  font: inherit;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.modal-actions button.primary {
  background: var(--prod-accent);
  color: #fff;
  border-color: var(--prod-accent);
}
.modal-actions button.primary:hover { background: #5847b8; }
.modal-actions button:hover { background: #f0f0f0; }

/* ── Dropzone ────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.1s, border-color 0.1s;
}
.dropzone.dragover { border-color: var(--prod-accent); background: var(--prod-accent-soft); }
.dropzone:hover { background: #fafafa; }
.dropzone p { margin: 0; color: var(--muted); }
.dropzone p#file-info { margin-top: 8px; color: var(--prod-accent); font-weight: 600; }

.progress {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--prod-accent-soft);
  border-radius: 6px;
  font-size: 13px;
  color: var(--prod-accent);
  text-align: center;
}

/* ── Detail modal layout ────────────────────────── */
.detail-video {
  width: 100%;
  border-radius: 8px;
  background: #000;
  margin-bottom: 16px;
}
.detail-header {
  margin-bottom: 12px;
}
.detail-header h2 { margin: 0 0 4px; font-size: 18px; }
.detail-header .muted-line { color: var(--muted); font-size: 13px; }
.detail-section {
  margin: 20px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.detail-section h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.metrics-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.metrics-form .row {
  grid-template-columns: 1fr;
}
.metrics-form .row > span {
  margin-bottom: 4px;
}

.feedback-item {
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.feedback-item.role-lead {
  background: #fff8e8;
  border-color: #f0d488;
}
.feedback-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
}
.feedback-author { font-weight: 700; color: var(--text); }
.feedback-role-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: var(--prod-warn);
  color: #fff;
  font-size: 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.feedback-content { white-space: pre-wrap; word-break: break-word; }
.feedback-rating { color: var(--prod-warn); }

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.feedback-form textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  resize: vertical;
  min-height: 60px;
}
.feedback-form .row-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

/* 레퍼런스(원본 참고) 버튼 — 카드 + 상세 모달 공용 */
.ref-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--prod-warn-soft);
  color: #8a6a16;
  border: 1px solid #f0d488;
  border-radius: 6px;
  text-decoration: none;
  width: fit-content;
}
.ref-link-btn:hover {
  background: #ffe8a8;
  border-color: var(--prod-warn);
  color: #6a5210;
}

/* 삭제 영역 (상세 모달 하단) */
.detail-danger {
  border-top: 1px solid #f5d0d0;
  padding-top: 16px;
  margin-top: 20px;
  text-align: center;
}
.delete-btn {
  font: inherit;
  padding: 8px 18px;
  background: #fff;
  color: #c8342b;
  border: 1px solid #f0b8b3;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.delete-btn:hover {
  background: #c8342b;
  color: #fff;
  border-color: #c8342b;
}
.danger-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 0;
}
