/* Feedback Mode System — 밀리의서재 파트너스 */

.feedback-toggle-btn {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 99990;
  padding: 10px 18px;
  background: #FFCB00;
  color: #1A0F00;
  border: none;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,203,0,.4);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .2s, transform .15s;
  font-family: 'Pretendard', sans-serif;
  letter-spacing: -0.3px;
}
.feedback-toggle-btn:hover { background: #f0bf00; transform: translateY(-1px); }
.feedback-toggle-btn.active { background: #ef4444; color: #fff; box-shadow: 0 4px 16px rgba(239,68,68,.4); }
.feedback-toggle-btn .fb-icon { font-size: 15px; }
.feedback-toggle-btn .fb-count {
  background: rgba(0,0,0,.12);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
}

body.feedback-mode-active * { cursor: crosshair !important; }
body.feedback-mode-active .feedback-toggle-btn,
body.feedback-mode-active .feedback-panel,
body.feedback-mode-active .fb-section-label,
body.feedback-mode-active .fb-element-tooltip,
body.feedback-mode-active .feedback-toast { cursor: default !important; }

body.feedback-mode-active [data-fb-section] {
  position: relative;
  outline: 2px dashed transparent;
  transition: outline .15s;
}
body.feedback-mode-active [data-fb-section]:hover {
  outline: 2px dashed #FFCB00;
  outline-offset: -2px;
}

.fb-section-label {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 9999;
  background: #FFCB00;
  color: #1A0F00;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  pointer-events: none;
  letter-spacing: .3px;
  white-space: nowrap;
  font-family: 'Pretendard', sans-serif;
  box-shadow: 0 2px 8px rgba(255,203,0,.3);
}
body.feedback-mode-active [data-fb-section] { position: relative; }
body.feedback-mode-active [data-fb-section]:hover .fb-section-label { display: block; }

.fb-element-tooltip {
  position: fixed;
  z-index: 99995;
  background: rgba(30,30,30,.92);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  display: none;
  font-family: 'Pretendard', sans-serif;
}
body.feedback-mode-active .fb-element-tooltip { display: block; }

.fb-element-hover {
  outline: 2px solid #FFCB00 !important;
  outline-offset: 2px;
  background: rgba(255,203,0,.07) !important;
}

.feedback-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 32px rgba(0,0,0,.15);
  z-index: 99999;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  font-family: 'Pretendard', sans-serif;
  overflow: hidden;
}
.feedback-panel.open { right: 0; }

.feedback-panel__header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: #1A0F00;
  color: #fff;
  flex-shrink: 0;
}
.feedback-panel__header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.feedback-panel__title { font-size: 15px; font-weight: 700; letter-spacing: -.3px; }
.feedback-panel__close {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.feedback-panel__close:hover { background: rgba(255,255,255,.3); }

.feedback-panel__section-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,203,0,.2);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}
.feedback-panel__element-info {
  margin-top: 6px;
  font-size: 11px;
  opacity: .8;
  background: rgba(0,0,0,.2);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fb-form-group { display: flex; flex-direction: column; gap: 6px; }
.fb-label { font-size: 12px; font-weight: 700; color: #374151; letter-spacing: -.2px; }
.fb-label span { color: #ef4444; }

.fb-input, .fb-textarea, .fb-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  color: #111827;
  outline: none;
  font-family: 'Pretendard', sans-serif;
  transition: border-color .15s;
  background: #fafafa;
  box-sizing: border-box;
}
.fb-input:focus, .fb-textarea:focus, .fb-select:focus { border-color: #FFCB00; background: #fff; }
.fb-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.fb-priority-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.fb-image-upload {
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fafafa;
}
.fb-image-upload:hover { border-color: #FFCB00; background: #fffdf0; }
.fb-image-upload input { display: none; }
.fb-image-upload-icon { font-size: 24px; margin-bottom: 6px; }
.fb-image-upload-text { font-size: 12px; color: #6b7280; }
.fb-image-upload-text strong { color: #1A0F00; }
.fb-image-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fb-image-preview-item { position: relative; width: 72px; height: 72px; }
.fb-image-preview-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; border: 1.5px solid #e5e7eb; }
.fb-image-preview-item button {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; background: #ef4444; color: #fff;
  border: none; border-radius: 50%; font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

.feedback-panel__footer {
  padding: 16px 20px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  background: #fff;
}
.fb-btn-cancel {
  flex: 1; padding: 10px; background: #f3f4f6; border: none;
  border-radius: 8px; font-size: 13px; font-weight: 600; color: #6b7280;
  cursor: pointer; transition: background .15s; font-family: 'Pretendard', sans-serif;
}
.fb-btn-cancel:hover { background: #e5e7eb; }
.fb-btn-submit {
  flex: 2; padding: 10px; background: #1A0F00; border: none;
  border-radius: 8px; font-size: 13px; font-weight: 700; color: #FFCB00;
  cursor: pointer; transition: background .15s; font-family: 'Pretendard', sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.fb-btn-submit:hover { background: #2d1a00; }
.fb-btn-submit:disabled { background: #9ca3af; color: #fff; cursor: not-allowed; }
.fb-btn-submit .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #FFCB00;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.feedback-panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.3);
  z-index: 99998; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.feedback-panel-overlay.show { opacity: 1; pointer-events: auto; }

.feedback-toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b; color: #fff; padding: 12px 24px;
  border-radius: 24px; font-size: 13px; font-weight: 600;
  z-index: 999999; pointer-events: none; opacity: 0;
  transition: opacity .25s, transform .25s; white-space: nowrap;
  font-family: 'Pretendard', sans-serif;
}
.feedback-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.feedback-toast.success { background: #059669; }
.feedback-toast.error { background: #dc2626; }

.feedback-mode-banner {
  position: fixed; top: 0; left: 0; right: 0; height: 40px;
  background: linear-gradient(90deg, #1A0F00, #3d2200);
  color: #FFCB00; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  z-index: 99989; letter-spacing: -.2px; font-family: 'Pretendard', sans-serif;
  opacity: 0; transform: translateY(-100%); transition: opacity .3s, transform .3s;
}
.feedback-mode-banner.show { opacity: 1; transform: translateY(0); }
.feedback-mode-banner .fb-banner-pulse {
  width: 8px; height: 8px; background: #FFCB00; border-radius: 50%;
  animation: fbpulse 1.2s ease-in-out infinite;
}
@keyframes fbpulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.4); }
}

.fb-mode-switch {
  display: flex; background: #f3f4f6; border-radius: 8px; padding: 3px; gap: 2px; margin-bottom: 4px;
}
.fb-mode-btn {
  flex: 1; padding: 6px 8px; border: none; background: transparent;
  border-radius: 6px; font-size: 11px; font-weight: 600; color: #9ca3af;
  cursor: pointer; transition: all .15s; font-family: 'Pretendard', sans-serif;
}
.fb-mode-btn.active { background: #fff; color: #1A0F00; box-shadow: 0 1px 4px rgba(0,0,0,.1); }

@media (max-width: 768px) {
  .feedback-panel { width: 100%; right: -100%; }
  .feedback-panel.open { right: 0; }
  .feedback-toggle-btn { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); right: 12px; }
}
