/* ═══════════════════════════════════════════
   BGCK Prototype Feedback System
   ═══════════════════════════════════════════ */

/* ── Floating Action Button ── */
.fb-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #6b2d8b;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(107, 45, 139, 0.4);
  transition: all 0.3s ease;
  animation: fb-pulse 3s ease-in-out infinite;
}
.fb-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(107, 45, 139, 0.5);
}
.fb-fab-active {
  background: #333;
  animation: none;
}
@keyframes fb-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(107, 45, 139, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(107, 45, 139, 0.7), 0 0 0 8px rgba(107, 45, 139, 0.1); }
}

/* ── Badge ── */
.fb-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e74c3c;
  color: white;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-family: system-ui, sans-serif;
}

/* ── Side Panel ── */
.fb-panel {
  position: fixed;
  top: 0;
  right: -420px;
  z-index: 9999;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.fb-panel-open {
  right: 0;
}

.fb-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}
.fb-panel-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}
.fb-panel-actions {
  display: flex;
  gap: 4px;
}

.fb-panel-path {
  padding: 8px 20px;
  font-size: 12px;
  color: #888;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  font-family: monospace;
}

.fb-author-row {
  padding: 12px 20px;
  border-bottom: 1px solid #eee;
}

/* ── Inputs ── */
.fb-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  font-family: inherit;
}
.fb-input:focus {
  border-color: #6b2d8b;
  box-shadow: 0 0 0 3px rgba(107, 45, 139, 0.1);
}

.fb-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  resize: vertical;
  min-height: 70px;
  transition: border-color 0.2s;
  box-sizing: border-box;
  font-family: inherit;
}
.fb-textarea:focus {
  border-color: #6b2d8b;
  box-shadow: 0 0 0 3px rgba(107, 45, 139, 0.1);
}

/* ── Buttons ── */
.fb-btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: all 0.2s;
}
.fb-btn-icon:hover {
  background: #eee;
  color: #333;
}
.fb-btn-active {
  background: #6b2d8b !important;
  color: white !important;
}

.fb-submit {
  width: 100%;
  padding: 10px;
  background: #6b2d8b;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.fb-submit:hover {
  background: #5a2578;
}
.fb-submit:disabled {
  background: #999;
  cursor: not-allowed;
}

/* ── Comments List ── */
.fb-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.fb-empty {
  text-align: center;
  color: #aaa;
  font-size: 13px;
  padding: 40px 20px;
  line-height: 1.6;
}

.fb-comment {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-left: 3px solid #6b2d8b;
  transition: opacity 0.3s;
}
.fb-comment.fb-resolved {
  opacity: 0.5;
  border-left-color: #28a745;
}
.fb-comment:hover {
  opacity: 1;
}

.fb-comment-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.fb-comment-type {
  font-size: 14px;
}
.fb-comment-author {
  font-size: 13px;
  color: #333;
}
.fb-comment-time {
  font-size: 11px;
  color: #999;
  margin-left: auto;
}

.fb-selection-preview {
  font-size: 12px;
  color: #6b2d8b;
  background: rgba(107, 45, 139, 0.06);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-style: italic;
  border-left: 2px solid #6b2d8b;
}

.fb-comment-body {
  font-size: 13px;
  color: #444;
  line-height: 1.5;
  white-space: pre-wrap;
}

.fb-comment-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.fb-action-btn {
  font-size: 11px;
  color: #6b2d8b;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  font-weight: 600;
  font-family: inherit;
}
.fb-action-btn:hover {
  text-decoration: underline;
}
.fb-action-delete {
  color: #dc3545;
}

/* ── Attachments ── */
.fb-attachments {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fb-attachment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #6b2d8b;
  background: rgba(107, 45, 139, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
  text-decoration: none;
}
.fb-attachment:hover {
  background: rgba(107, 45, 139, 0.15);
}

/* ── New Comment Area ── */
.fb-new-comment {
  padding: 16px 20px;
  border-top: 1px solid #eee;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fb-file-upload {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fb-file-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  padding: 4px 10px;
  border: 1px dashed #ccc;
  border-radius: 6px;
  transition: all 0.2s;
}
.fb-file-label:hover {
  border-color: #6b2d8b;
  color: #6b2d8b;
}
.fb-file-hidden {
  display: none;
}
.fb-file-names {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.fb-file-name {
  font-size: 11px;
  color: #6b2d8b;
  background: rgba(107, 45, 139, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
}
.fb-file-error {
  font-size: 11px;
  color: #dc3545;
}

/* ── Selection Tooltip ── */
.fb-sel-tooltip {
  position: absolute;
  z-index: 9997;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.fb-sel-tooltip.fb-sel-visible {
  opacity: 1;
  pointer-events: auto;
}

.fb-sel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a1a2e;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transition: background 0.2s;
}
.fb-sel-btn:hover {
  background: #6b2d8b;
}

/* ── Pin Overlay ── */
.fb-pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.fb-pin-overlay-active {
  pointer-events: auto;
  opacity: 1;
  cursor: crosshair;
}
.fb-pin-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 20px;
  background: #6b2d8b;
  color: white;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  z-index: 9991;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── Pin Markers ── */
.fb-pins {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
  z-index: 9000;
}
.fb-pin-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: transform 0.2s;
  animation: fb-pin-drop 0.4s ease-out;
}
.fb-pin-marker:hover {
  transform: translate(-50%, -100%) scale(1.2);
}
@keyframes fb-pin-drop {
  0% { opacity: 0; transform: translate(-50%, -150%) scale(0.5); }
  60% { transform: translate(-50%, -95%) scale(1.05); }
  100% { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}

/* ── Text Selection Highlights ── */
.fb-highlight {
  background: rgba(107, 45, 139, 0.15);
  border-bottom: 2px solid #6b2d8b;
  cursor: pointer;
  padding: 1px 0;
  border-radius: 2px;
  transition: background 0.2s;
  position: relative;
}
.fb-highlight:hover {
  background: rgba(107, 45, 139, 0.3);
}
.fb-highlight::after {
  content: "💬";
  font-size: 12px;
  position: relative;
  top: -4px;
  margin-left: 2px;
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .fb-panel {
    width: 100vw;
    right: -100vw;
  }
  .fb-fab {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
  }
}
