/* ========================================================================
   Feedback Widget — cf-design 토큰 기반
   원본: vipdllib-docker/static/css/feedback-widget.css 를 cf-design으로 매핑
   ======================================================================== */

/* 플로팅 피드백 버튼 */
.fb-fab {
  position: fixed;
  right: 20px;
  bottom: 96px;
  z-index: 1040;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--amber-500);
  color: var(--white);
  border: 0;
  box-shadow: 0 8px 20px rgba(74, 55, 30, 0.18);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out);
}
.fb-fab:hover {
  background: var(--amber-600);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(74, 55, 30, 0.22);
}
.fb-fab:active { transform: translateY(0); }
@media (max-width: 960px) { .fb-fab { bottom: 80px; } }

/* 모달 (자체 구현, Bootstrap 의존성 없음) */
.fb-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(31, 27, 22, 0.55);
  display: none;
  align-items: center; justify-content: center;
  padding: var(--space-4);
  z-index: 1060;
}
.fb-modal-overlay.is-open { display: flex; }

.fb-modal {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(74, 55, 30, 0.20);
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.fb-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}
.fb-modal-header h3 {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--ink-900);
  margin: 0;
  letter-spacing: var(--ls-tight);
}
.fb-modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-700);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.fb-modal-close:hover { background: var(--ink-50); }

.fb-modal-body { padding: 20px; overflow: auto; }

/* 피드백 유형 토글 */
.fb-type-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.fb-type-btn {
  padding: 10px 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink-700);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.fb-type-btn:hover { background: var(--ink-50); }
.fb-type-btn.is-active {
  background: var(--amber-500);
  border-color: var(--amber-500);
  color: var(--white);
}
.fb-type-btn svg { width: 18px; height: 18px; }

/* 스크린샷 캡처 버튼 그룹 */
.fb-shot-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.fb-shot-btn {
  padding: 10px;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-500);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.fb-shot-btn:hover {
  background: var(--amber-50);
  border-color: var(--amber-500);
  color: var(--amber-700);
}

/* 스크린샷 미리보기 */
.fb-shot-preview {
  position: relative;
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.fb-shot-preview img { display: block; width: 100%; }
.fb-shot-remove {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: var(--radius-full);
  border: 0;
  background: var(--danger-500);
  color: var(--white);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(74, 55, 30, 0.18);
}

/* 영역 캡처 오버레이 */
.fb-shot-overlay {
  position: fixed; inset: 0;
  background: rgba(31, 27, 22, 0.40);
  display: none;
  z-index: 9999;
  cursor: crosshair;
}
.fb-shot-overlay.is-open { display: block; }
.fb-shot-tip {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(31, 27, 22, 0.85);
  color: var(--white);
  padding: 16px 22px;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: var(--fs-sm);
  pointer-events: none;
  line-height: 1.6;
  letter-spacing: 0;
}
.fb-shot-tip small { opacity: 0.7; font-size: var(--fs-xs); }
.fb-shot-rect {
  position: absolute;
  border: 2px dashed var(--white);
  background: rgba(232, 163, 61, 0.20);
  box-shadow: 0 0 0 9999px rgba(31, 27, 22, 0.55);
  display: none;
}

/* 성공 상태 */
.fb-success {
  text-align: center;
  padding: 36px 16px;
}
.fb-success-icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-full);
  background: var(--success-50);
  color: var(--success-700);
  margin: 0 auto 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.fb-success h4 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  margin: 0 0 6px;
  color: var(--ink-900);
}
.fb-success p {
  margin: 0;
  color: var(--ink-500);
  font-size: var(--fs-sm);
  line-height: var(--lh-loose);
}

/* 헤더 알림 드롭다운 */
.fb-bell {
  position: relative;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-700);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.fb-bell:hover { background: var(--ink-50); }
.fb-bell-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  background: var(--danger-500);
  color: var(--white);
  font-size: 10px;
  font-weight: var(--fw-semibold);
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--white);
}
.fb-bell-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 32px rgba(74, 55, 30, 0.12);
  display: none;
  z-index: 1050;
}
.fb-bell-wrap[data-open="true"] .fb-bell-menu { display: block; }
.fb-bell-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}
.fb-bell-head b {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--ink-900);
}
.fb-bell-head a {
  font-size: var(--fs-xs); color: var(--amber-700);
  text-decoration: none;
}
.fb-bell-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  color: inherit;
}
.fb-bell-item:last-child { border-bottom: 0; }
.fb-bell-item:hover { background: var(--ink-50); text-decoration: none; }
.fb-bell-item-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 4px;
}
.fb-bell-item-time {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}
.fb-bell-item-msg {
  font-size: var(--fs-sm);
  color: var(--ink-900);
  line-height: var(--lh-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fb-bell-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--ink-500);
}

/* 피드백 목록 — 카드/테이블 */
.fb-list-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.fb-list-head h1 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-tight);
  color: var(--ink-900);
  margin: 0 0 4px;
}
.fb-list-head p { color: var(--ink-500); font-size: var(--fs-sm); margin: 0; }
.fb-list-count { color: var(--ink-500); font-size: var(--fs-sm); }
.fb-list-count b { color: var(--amber-700); font-variant-numeric: tabular-nums; }

.fb-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}
.fb-table thead th {
  background: var(--ink-50);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--ink-600);
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}
.fb-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  font-size: var(--fs-sm);
  color: var(--ink-900);
}
.fb-table tbody tr.fb-row { cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out); }
.fb-table tbody tr.fb-row:hover { background: var(--ink-50); }
.fb-table tbody tr.is-expanded { background: var(--ink-50); }
.fb-detail-row { display: none; }
.fb-detail-row.is-open { display: table-row; }
.fb-detail-cell { padding: 0 14px 16px; background: var(--ink-50); }
.fb-detail-card {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

/* 유형 아이콘 박스 */
.fb-type-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink-50);
  color: var(--ink-700);
}
.fb-type-icon.is-bug         { background: var(--danger-50);  color: var(--danger-700); }
.fb-type-icon.is-feature     { background: var(--amber-50);   color: var(--amber-700); }
.fb-type-icon.is-improvement { background: var(--info-50);    color: var(--info-700); }
.fb-type-icon.is-other       { background: var(--ink-100);    color: var(--ink-700); }

.fb-msg-cell { max-width: 360px; }
.fb-msg-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  line-height: 1.5;
}
.fb-meta-line {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  margin-top: 4px;
}

/* 모바일 카드 뷰 */
.fb-cards { display: none; flex-direction: column; gap: 12px; }
@media (max-width: 900px) {
  .fb-table-wrap { display: none; }
  .fb-cards { display: flex; }
}
.fb-card {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.fb-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}

/* 댓글 영역 */
.fb-comments {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.fb-comment {
  background: var(--ink-50);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 6px;
}
.fb-comment-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 4px;
}
.fb-comment-author {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--ink-900);
}
.fb-comment-time {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}
.fb-comment-body {
  font-size: var(--fs-sm);
  color: var(--ink-800);
  white-space: pre-wrap;
  line-height: 1.5;
}
.fb-comment-form {
  display: flex; gap: 8px;
  margin-top: 8px;
}
.fb-comment-form textarea {
  flex: 1; min-height: 56px;
}

/* 관리자 답변 (admin_note) */
.fb-admin-note {
  background: var(--amber-50);
  border-left: 3px solid var(--amber-500);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
}
.fb-admin-note-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--amber-700);
  margin-bottom: 4px;
}
.fb-admin-note p { margin: 0; white-space: pre-wrap; font-size: var(--fs-sm); }

/* 액션 버튼 그룹 */
.fb-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 16px;
}
