/**
 * Frontend Bug Reporter - Public CSS
 * Slide-in panel from the right, no overlay.
 */

/* Panel */
#fbr-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100%;
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.14);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
  font-size: 14px;
  color: #1e1e1e;
  box-sizing: border-box;
}

#fbr-panel.fbr-panel-open {
  transform: translateX(0);
}

/* Header */
.fbr-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.fbr-panel-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.fbr-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #6b7280;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.fbr-close-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Body */
.fbr-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fbr-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #111827;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 120px;
}

.fbr-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.fbr-error-msg {
  color: #dc2626;
  font-size: 13px;
}

/* Selector row */
.fbr-selector-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Selector badge */
.fbr-selector-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
  color: #1d4ed8;
  max-width: 100%;
  word-break: break-all;
}

.fbr-badge-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.fbr-badge-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}

.fbr-badge-clear:hover {
  color: #dc2626;
}

/* Footer */
.fbr-panel-footer {
  padding: 14px 18px 18px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* Buttons */
.fbr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
  line-height: 1.2;
}

.fbr-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fbr-btn-primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  width: 100%;
}

.fbr-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.fbr-btn-ghost {
  background: transparent;
  color: #6b7280;
  border-color: transparent;
  width: 100%;
}

.fbr-btn-ghost:hover:not(:disabled) {
  background: #f3f4f6;
  color: #111827;
}

.fbr-btn-outline {
  background: transparent;
  color: #374151;
  border-color: #d1d5db;
}

.fbr-btn-outline:hover:not(:disabled) {
  border-color: #3b82f6;
  color: #2563eb;
}

.fbr-btn-active {
  border-color: #3b82f6 !important;
  color: #2563eb !important;
  background: #eff6ff !important;
}

/* Status message */
.fbr-status-msg {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
}

.fbr-status-success {
  background: #dcfce7;
  color: #15803d;
}

.fbr-status-error {
  background: #fee2e2;
  color: #dc2626;
}

/* Element hover highlight (selector mode) */
.fbr-element-hover {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px !important;
  cursor: crosshair !important;
}

body.fbr-selector-mode * {
  cursor: crosshair !important;
}

/* Admin bar button tweak */
#wpadminbar #wp-admin-bar-fbr-report-issue > .ab-item {
  cursor: pointer;
}

/* Mobile adjustment */
@media (max-width: 400px) {
  #fbr-panel {
    width: 100%;
  }
}

/* Screenshot preview */
.fbr-screenshot-preview {
  margin-top: 0.75rem;
}
.fbr-screenshot-label {
  font-size: 0.75rem;
  color: #666;
  margin: 0 0 0.375rem;
}
.fbr-screenshot-img {
  max-width: 100%;
  max-height: 150px;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: block;
}
.fbr-screenshot-capturing {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: #888;
  font-style: italic;
}
