/* form-builder.css - Styles for the Form Builder UI */

/* --------------------
   CSS Variables
-------------------- */
:root {
  --fb-primary: #3b82f6;
  --fb-primary-hover: #2563eb;
  --fb-primary-light: #eff6ff;
  --fb-secondary: #64748b;
  --fb-success: #10b981;
  --fb-success-light: #d1fae5;
  --fb-warning: #f59e0b;
  --fb-warning-light: #fef3c7;
  --fb-danger: #ef4444;
  --fb-danger-light: #fee2e2;
  
  --fb-bg: #f8fafc;
  --fb-bg-white: #ffffff;
  --fb-border: #e2e8f0;
  --fb-border-dark: #cbd5e1;
  --fb-text: #1e293b;
  --fb-text-muted: #64748b;
  --fb-text-light: #94a3b8;
  
  --fb-sidebar-width: 280px;
  --fb-palette-width: 260px;
  --fb-inspector-width: 340px;
  --fb-topbar-height: 56px;
  --fb-radius: 8px;
  --fb-radius-lg: 12px;
  --fb-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --fb-shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

/* --------------------
   Shell Layout
-------------------- */
.fb-shell {
  display: flex;
  height: 100%;
  background: var(--fb-bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.fb-sidebar {
  width: var(--fb-sidebar-width);
  background: var(--fb-bg-white);
  border-right: 1px solid var(--fb-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s ease, min-width 0.25s ease;
  overflow: hidden;
}

.fb-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--fb-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.fb-sidebar-toggle {
  width: 32px;
  height: 32px;
  border: 1px solid var(--fb-border);
  border-radius: 6px;
  background: var(--fb-bg);
  color: var(--fb-text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.fb-sidebar-toggle:hover {
  background: var(--fb-border);
  color: var(--fb-text);
}

.fb-sidebar-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--fb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fb-sidebar-header .fb-btn {
  margin-left: auto;
  white-space: nowrap;
}

/* Collapsed sidebar state */
.fb-shell.sidebar-collapsed .fb-sidebar {
  width: 56px;
  min-width: 56px;
}

.fb-shell.sidebar-collapsed .fb-sidebar-header {
  padding: 12px;
  flex-direction: column;
  gap: 8px;
}

.fb-shell.sidebar-collapsed .fb-sidebar-title,
.fb-shell.sidebar-collapsed .fb-sidebar-header .fb-btn,
.fb-shell.sidebar-collapsed .fb-form-list {
  display: none;
}

.fb-shell.sidebar-collapsed .fb-sidebar-toggle {
  width: 36px;
  height: 36px;
}

.fb-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* --------------------
   Form List
-------------------- */
.fb-form-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.fb-form-list-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--fb-text-muted);
}

.fb-form-item {
  padding: 12px;
  border-radius: var(--fb-radius);
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 4px;
}

.fb-form-item:hover {
  background: var(--fb-bg);
}

.fb-form-item.active {
  background: var(--fb-primary-light);
  border: 1px solid var(--fb-primary);
}

.fb-form-item-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--fb-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fb-form-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--fb-text-muted);
}

/* --------------------
   Top Bar
-------------------- */
.fb-topbar {
  height: var(--fb-topbar-height);
  background: var(--fb-bg-white);
  border-bottom: 1px solid var(--fb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.fb-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fb-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-form-name-input {
  font-size: 16px;
  font-weight: 700;
  border: none;
  background: transparent;
  padding: 4px 8px;
  border-radius: var(--fb-radius);
  color: var(--fb-text);
  width: 280px;
}

.fb-form-name-input:focus {
  outline: none;
  background: var(--fb-bg);
}

.fb-unsaved-badge {
  background: var(--fb-warning-light);
  color: #92400e;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* --------------------
   Workspace (3-panel)
-------------------- */
.fb-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* --------------------
   Field Palette
-------------------- */
.fb-palette {
  width: var(--fb-palette-width);
  background: var(--fb-bg-white);
  border-right: 1px solid var(--fb-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.fb-palette-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--fb-border);
}

.fb-palette-header h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--fb-text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fb-palette-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.fb-palette-category {
  margin-bottom: 12px;
}

.fb-palette-category-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--fb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 8px 4px;
}

.fb-palette-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.fb-palette-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  cursor: grab;
  transition: all 0.15s ease;
  gap: 4px;
}

.fb-palette-item:hover {
  border-color: var(--fb-primary);
  background: var(--fb-primary-light);
  transform: translateY(-1px);
}

.fb-palette-item:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.fb-palette-item-icon {
  font-size: 18px;
}

.fb-palette-item-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--fb-text);
  text-align: center;
  line-height: 1.2;
}

/* --------------------
   Canvas
-------------------- */
.fb-canvas-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.fb-page-tabs {
  background: var(--fb-bg-white);
  border-bottom: 1px solid var(--fb-border);
  padding: 0 16px;
  flex-shrink: 0;
}

.fb-page-tabs-list {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 0;
}

.fb-page-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--fb-text);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.fb-page-tab:hover {
  border-color: var(--fb-primary);
}

.fb-page-tab.active {
  background: var(--fb-primary);
  border-color: var(--fb-primary);
  color: white;
}

.fb-page-tab-delete {
  width: 16px;
  height: 16px;
  border: none;
  background: rgba(0,0,0,0.1);
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.fb-page-tab-delete:hover {
  background: rgba(255,255,255,0.3);
}

.fb-page-tab-add {
  padding: 8px 12px;
  background: transparent;
  border: 1px dashed var(--fb-border-dark);
  border-radius: var(--fb-radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--fb-text-muted);
  transition: all 0.15s ease;
}

.fb-page-tab-add:hover {
  border-color: var(--fb-primary);
  color: var(--fb-primary);
  background: var(--fb-primary-light);
}

.fb-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--fb-bg);
}

.fb-canvas-page {
  max-width: 800px;
  margin: 0 auto;
}

.fb-page-header {
  margin-bottom: 24px;
}

.fb-page-title-input {
  width: 100%;
  font-size: 24px;
  font-weight: 700;
  border: none;
  background: transparent;
  padding: 8px 0;
  color: var(--fb-text);
  margin-bottom: 8px;
}

.fb-page-title-input:focus {
  outline: none;
}

.fb-page-title-input::placeholder {
  color: var(--fb-text-light);
}

.fb-page-desc-input {
  width: 100%;
  font-size: 14px;
  border: none;
  background: transparent;
  padding: 4px 0;
  color: var(--fb-text-muted);
  resize: none;
  min-height: 40px;
}

.fb-page-desc-input:focus {
  outline: none;
}

/* --------------------
   Sections
-------------------- */
.fb-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fb-section {
  background: var(--fb-bg-white);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius-lg);
  padding: 16px;
  transition: all 0.15s ease;
}

.fb-section:hover {
  border-color: var(--fb-border-dark);
}

.fb-section.selected {
  border-color: var(--fb-primary);
  box-shadow: 0 0 0 3px var(--fb-primary-light);
}

.fb-section.fb-drop-target {
  border-color: var(--fb-primary);
  border-style: dashed;
  background: var(--fb-primary-light);
}

.fb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--fb-border);
}

.fb-section-title-input {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: transparent;
  padding: 4px 0;
  color: var(--fb-text);
}

.fb-section-title-input:focus {
  outline: none;
}

.fb-section-title-input::placeholder {
  color: var(--fb-text-light);
  font-weight: 400;
}

.fb-section-actions {
  display: flex;
  gap: 4px;
}

.fb-section-delete {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--fb-radius);
  cursor: pointer;
  font-size: 14px;
  color: var(--fb-text-muted);
  transition: all 0.15s ease;
}

.fb-section-delete:hover {
  background: var(--fb-danger-light);
  color: var(--fb-danger);
}

.fb-section-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-start;
}

/* Drop zones between fields for reordering */
.fb-drop-zone {
  width: 100%;
  height: 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
  margin: 6px 0;
  background: transparent;
}

/* Larger invisible hit area for easier dropping */
.fb-drop-zone::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  bottom: -12px;
  z-index: 1;
}

.fb-drop-zone:hover,
.fb-drop-zone-active {
  height: 60px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
  border: 3px dashed var(--fb-primary);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.fb-drop-zone-active {
  height: 70px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.25) 100%);
  border: 3px dashed var(--fb-primary);
  animation: dropZonePulse 0.8s ease-in-out infinite;
}

@keyframes dropZonePulse {
  0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.2); }
  50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.4); }
}

.fb-drop-zone-active::after {
  content: '⬇ Drop here';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 700;
  color: var(--fb-primary);
  white-space: nowrap;
  background: white;
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.fb-drop-zone-empty {
  width: 100%;
  min-height: 120px;
  padding: 32px;
  text-align: center;
  color: var(--fb-text-muted);
  font-size: 14px;
  border: 2px dashed var(--fb-border);
  border-radius: var(--fb-radius);
  background: var(--fb-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fb-drop-zone-empty.fb-drop-zone-active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border-color: var(--fb-primary);
  color: var(--fb-primary);
}

/* Body class when dragging - make ALL drop zones visible and larger */
body.fb-dragging .fb-drop-zone {
  height: 50px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 2px dashed rgba(59, 130, 246, 0.5);
  border-radius: 8px;
  margin: 8px 0;
}

body.fb-dragging .fb-drop-zone::before {
  content: '';
  position: absolute;
  inset: -15px;
  z-index: 1;
}

body.fb-dragging .fb-drop-zone::after {
  content: '⬇';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  color: rgba(59, 130, 246, 0.6);
}

body.fb-dragging .fb-drop-zone:hover,
body.fb-dragging .fb-drop-zone-active {
  height: 70px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
  border-color: var(--fb-primary);
  border-width: 3px;
}

body.fb-dragging .fb-drop-zone:hover::after,
body.fb-dragging .fb-drop-zone-active::after {
  content: '⬇ Drop here';
  font-size: 14px;
  font-weight: 700;
  color: var(--fb-primary);
  background: white;
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Make fields look draggable */
.fb-field[draggable="true"] {
  cursor: grab;
  position: relative;
}

/* Add grab handle indicator */
.fb-field[draggable="true"]::before {
  content: '⋮⋮';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #cbd5e1;
  letter-spacing: -2px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.fb-field[draggable="true"]:hover::before {
  opacity: 1;
}

.fb-field[draggable="true"]:hover {
  padding-left: 28px;
}

.fb-field[draggable="true"]:active {
  cursor: grabbing;
}

/* Visual feedback when dragging a field */
body.fb-dragging .fb-field {
  opacity: 0.85;
}

body.fb-dragging .fb-field.dragging {
  opacity: 0.3;
  transform: scale(0.95);
  border: 2px dashed var(--fb-primary);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: none;
}

body.fb-dragging .fb-field.dragging::before {
  display: none;
}

/* Drop indicator when hovering over an existing field (before/after).
   This makes dropping much easier than aiming for a thin in-between zone. */
body.fb-dragging .fb-field.fb-drop-before,
body.fb-dragging .fb-field.fb-drop-after {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.06);
}

body.fb-dragging .fb-field.fb-drop-before::after,
body.fb-dragging .fb-field.fb-drop-after::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  height: 4px;
  border-radius: 999px;
  background: var(--fb-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  pointer-events: none;
}

body.fb-dragging .fb-field.fb-drop-before::after {
  top: -6px;
}

body.fb-dragging .fb-field.fb-drop-after::after {
  bottom: -6px;
}

body.fb-dragging .fb-drop-zone {
  pointer-events: auto;
}

/* Ensure drop zones receive events during drag */
.fb-drop-zone {
  pointer-events: auto;
}

/* Overlay hint when dragging */
body.fb-dragging::after {
  content: 'Drop on a blue zone or on a field to place';
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 10000;
  animation: hintSlideUp 0.3s ease;
}

@keyframes hintSlideUp {
  from { 
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.fb-add-section-btn {
  width: 100%;
  padding: 12px;
  margin-top: 16px;
}

/* --------------------
   Fields (on canvas)
-------------------- */
.fb-field {
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fb-field-width-full { width: 100%; }
.fb-field-width-half { width: calc(50% - 4px); }
.fb-field-width-third { width: calc(33.333% - 6px); }
.fb-field-width-quarter { width: calc(25% - 6px); }

.fb-field:hover {
  border-color: var(--fb-primary);
  background: var(--fb-primary-light);
}

.fb-field.selected {
  border-color: var(--fb-primary);
  background: var(--fb-primary-light);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.fb-field[draggable="true"] {
  cursor: grab;
}

.fb-field[draggable="true"]:active {
  cursor: grabbing;
}

.fb-field-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.fb-field-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.fb-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fb-field-required {
  color: var(--fb-danger);
  font-weight: 700;
}

.fb-field-type {
  font-size: 11px;
  color: var(--fb-text-muted);
  background: var(--fb-bg-white);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.fb-field-actions {
  display: none;
  gap: 2px;
}

.fb-field:hover .fb-field-actions {
  display: flex;
}

.fb-field-actions button {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}

.fb-field-duplicate:hover {
  background: var(--fb-primary-light);
}

.fb-field-delete:hover {
  background: var(--fb-danger-light);
}

/* --------------------
   Inspector Panel
-------------------- */
.fb-inspector {
  width: var(--fb-inspector-width);
  background: var(--fb-bg-white);
  border-left: 1px solid var(--fb-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.fb-inspector-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--fb-text-muted);
  font-size: 13px;
  padding: 24px;
  text-align: center;
}

.fb-inspector-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fb-inspector-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--fb-border);
}

.fb-inspector-icon {
  font-size: 20px;
}

.fb-inspector-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fb-text);
}

.fb-inspector-tabs {
  display: flex;
  border-bottom: 1px solid var(--fb-border);
  background: var(--fb-bg);
  overflow-x: auto;
  flex-shrink: 0;
}

.fb-inspector-tab {
  padding: 10px 12px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--fb-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.fb-inspector-tab:hover {
  color: var(--fb-text);
}

.fb-inspector-tab.active {
  color: var(--fb-primary);
  border-bottom-color: var(--fb-primary);
}

.fb-inspector-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.fb-inspector-group {
  margin-bottom: 16px;
}

.fb-inspector-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fb-inspector-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fb-text);
  margin-bottom: 6px;
}

.fb-inspector-input,
.fb-inspector-select,
.fb-inspector-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  font-size: 13px;
  color: var(--fb-text);
  background: var(--fb-bg-white);
  transition: border-color 0.15s ease;
}

.fb-inspector-input:focus,
.fb-inspector-select:focus,
.fb-inspector-textarea:focus {
  outline: none;
  border-color: var(--fb-primary);
}

.fb-inspector-textarea {
  resize: vertical;
  min-height: 80px;
}

.fb-inspector-color {
  width: 48px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  cursor: pointer;
}

.fb-inspector-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fb-text);
  cursor: pointer;
}

.fb-inspector-checkbox input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.fb-inspector-hint {
  display: block;
  font-size: 11px;
  color: var(--fb-text-muted);
  margin-top: 4px;
}

/* --------------------
   Choice Editor
-------------------- */
.fb-choice-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fb-choice-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fb-choice-label,
.fb-choice-value {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--fb-border);
  border-radius: 4px;
  font-size: 12px;
}

.fb-choice-label {
  flex: 2;
}

.fb-choice-remove {
  width: 24px;
  height: 24px;
  border: none;
  background: var(--fb-bg);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: var(--fb-text-muted);
}

.fb-choice-remove:hover {
  background: var(--fb-danger-light);
  color: var(--fb-danger);
}

/* --------------------
   Rules Editor
-------------------- */
.fb-rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.fb-rule-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--fb-bg);
  border-radius: var(--fb-radius);
  font-size: 12px;
}

.fb-rule-item select,
.fb-rule-item input {
  padding: 4px 8px;
  border: 1px solid var(--fb-border);
  border-radius: 4px;
  font-size: 12px;
}

.fb-rule-action {
  width: 80px;
}

.fb-rule-field {
  flex: 1;
  min-width: 100px;
}

.fb-rule-operator {
  width: 100px;
}

.fb-rule-value {
  width: 80px;
}

.fb-rule-remove {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--fb-text-muted);
  border-radius: 4px;
}

.fb-rule-remove:hover {
  background: var(--fb-danger-light);
  color: var(--fb-danger);
}

/* --------------------
   Buttons
-------------------- */
.fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--fb-radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.fb-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fb-btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.fb-btn-primary {
  background: var(--fb-primary);
  border-color: var(--fb-primary);
  color: white;
}

.fb-btn-primary:hover:not(:disabled) {
  background: var(--fb-primary-hover);
  border-color: var(--fb-primary-hover);
}

.fb-btn-secondary {
  background: var(--fb-bg);
  border-color: var(--fb-border);
  color: var(--fb-text);
}

.fb-btn-secondary:hover:not(:disabled) {
  background: var(--fb-border);
}

.fb-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--fb-text-muted);
}

.fb-btn-ghost:hover:not(:disabled) {
  background: var(--fb-bg);
  color: var(--fb-text);
}

.fb-btn-danger {
  color: var(--fb-danger);
}

.fb-btn-danger:hover:not(:disabled) {
  background: var(--fb-danger-light);
}

/* --------------------
   Badges
-------------------- */
.fb-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.fb-badge-draft {
  background: var(--fb-bg);
  color: var(--fb-text-muted);
}

.fb-badge-published {
  background: var(--fb-success-light);
  color: #065f46;
}

.fb-badge-archived {
  background: var(--fb-warning-light);
  color: #92400e;
}

/* --------------------
   Modals
-------------------- */
.fb-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.fb-modal {
  background: var(--fb-bg-white);
  border-radius: var(--fb-radius-lg);
  box-shadow: var(--fb-shadow-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
}

.fb-modal-preview {
  max-width: 95%;
  width: 95%;
  height: 90vh;
}

.fb-modal-lg {
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
}

/* Responses Modal */
.fb-responses-loading,
.fb-responses-error {
  padding: 40px;
  text-align: center;
  color: var(--fb-text-muted);
}

.fb-responses-error {
  color: var(--fb-danger);
}

.fb-responses-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.fb-responses-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.fb-responses-empty h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--fb-text);
}

.fb-responses-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--fb-text-muted);
}

.fb-responses-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.fb-responses-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--fb-text);
}

.fb-responses-table-wrap {
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  overflow: hidden;
  max-height: 50vh;
  overflow-y: auto;
}

.fb-responses-table {
  width: 100%;
  border-collapse: collapse;
}

.fb-responses-table th {
  background: var(--fb-bg-dark);
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--fb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--fb-border);
  position: sticky;
  top: 0;
}

.fb-responses-table td {
  padding: 12px;
  border-bottom: 1px solid var(--fb-border);
  vertical-align: top;
}

.fb-responses-table tr:last-child td {
  border-bottom: none;
}

.fb-responses-table tr:hover td {
  background: var(--fb-bg);
}

.fb-response-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--fb-text);
}

.fb-response-time-sub {
  font-size: 11px;
  color: var(--fb-text-muted);
  margin-top: 2px;
}

.fb-response-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fb-response-field {
  font-size: 12px;
  display: flex;
  gap: 6px;
}

.fb-response-label {
  color: var(--fb-text-muted);
  font-weight: 600;
}

.fb-response-value {
  color: var(--fb-text);
}

.fb-response-more {
  font-size: 11px;
  color: var(--fb-primary);
  margin-top: 4px;
}

.fb-btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

/* Response Detail Modal */
.fb-response-detail-time {
  font-size: 12px;
  color: var(--fb-text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--fb-border);
}

.fb-response-detail-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fb-response-detail-field {
  padding: 12px;
  background: var(--fb-bg);
  border-radius: var(--fb-radius);
}

.fb-response-detail-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--fb-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.fb-response-detail-value {
  font-size: 14px;
  color: var(--fb-text);
  word-break: break-word;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.fb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--fb-border);
}

.fb-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--fb-text);
}

.fb-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--fb-radius);
  cursor: pointer;
  font-size: 20px;
  color: var(--fb-text-muted);
  transition: all 0.15s ease;
}

.fb-modal-close:hover {
  background: var(--fb-bg);
  color: var(--fb-text);
}

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

.fb-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--fb-border);
  background: var(--fb-bg);
}

/* --------------------
   Preview
-------------------- */
.fb-preview-body {
  background: var(--fb-bg);
  display: flex;
  justify-content: center;
  padding: 24px;
}

.fb-preview-frame {
  background: var(--fb-bg-white);
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius-lg);
  box-shadow: var(--fb-shadow);
  padding: 32px;
  transition: all 0.3s ease;
  overflow-y: auto;
  max-height: 100%;
}

.fb-preview-desktop {
  width: 100%;
  max-width: 800px;
}

.fb-preview-tablet {
  width: 768px;
  max-width: 768px;
}

.fb-preview-mobile {
  width: 375px;
  max-width: 375px;
}

.fb-preview-device-switcher {
  display: flex;
  gap: 4px;
}

.fb-device-btn {
  padding: 6px 12px;
  border: 1px solid var(--fb-border);
  background: transparent;
  border-radius: var(--fb-radius);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fb-device-btn:hover {
  background: var(--fb-bg);
}

.fb-device-btn.active {
  background: var(--fb-primary);
  border-color: var(--fb-primary);
  color: white;
}

/* --------------------
   Settings Modal
-------------------- */
.fb-settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--fb-border);
  padding-bottom: 12px;
  overflow-x: auto;
}

.fb-settings-tab {
  padding: 8px 16px;
  border: none;
  background: var(--fb-bg);
  border-radius: var(--fb-radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--fb-text-muted);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.fb-settings-tab:hover {
  background: var(--fb-border);
  color: var(--fb-text);
}

.fb-settings-tab.active {
  background: var(--fb-primary);
  color: white;
}

/* --------------------
   Publish Modal
-------------------- */
.fb-publish-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.fb-publish-live {
  font-size: 12px;
  font-weight: 600;
  color: var(--fb-success);
}

.fb-url-copy {
  display: flex;
  gap: 8px;
}

.fb-url-copy input {
  flex: 1;
}

/* --------------------
   Toast Notifications
-------------------- */
.fb-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--fb-text);
  color: white;
  padding: 12px 24px;
  border-radius: var(--fb-radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--fb-shadow-lg);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
}

.fb-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.fb-toast-success {
  background: var(--fb-success);
}

.fb-toast-error {
  background: var(--fb-danger);
}

/* --------------------
   Empty State
-------------------- */
.fb-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 48px;
  text-align: center;
}

.fb-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.fb-empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--fb-text);
  margin: 0 0 8px;
}

.fb-empty-state p {
  font-size: 14px;
  color: var(--fb-text-muted);
  margin: 0 0 24px;
}

/* --------------------
   Dragging State
-------------------- */
body.fb-dragging {
  cursor: grabbing !important;
}

body.fb-dragging * {
  cursor: grabbing !important;
}

.fb-drop-target {
  border-color: var(--fb-primary) !important;
  border-style: dashed !important;
  background: var(--fb-primary-light) !important;
}

/* --------------------
   Form Field Styles (for preview/public)
-------------------- */
.form-field {
  margin-bottom: 20px;
}

.form-field.w-full { width: 100%; }
.form-field.w-half { width: calc(50% - 8px); display: inline-block; vertical-align: top; }
.form-field.w-third { width: calc(33.333% - 10px); display: inline-block; vertical-align: top; }
.form-field.w-quarter { width: calc(25% - 12px); display: inline-block; vertical-align: top; }

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--fb-text);
  margin-bottom: 6px;
}

.field-label.label-left {
  display: inline-block;
  width: 120px;
  vertical-align: top;
  padding-top: 8px;
}

.required-mark {
  color: var(--fb-danger);
  margin-left: 2px;
}

.field-input-wrapper {
  position: relative;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  font-size: 14px;
  color: var(--fb-text);
  background: var(--fb-bg-white);
  transition: all 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--fb-primary);
  box-shadow: 0 0 0 3px var(--fb-primary-light);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--fb-bg);
  cursor: not-allowed;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.field-helper {
  font-size: 12px;
  color: var(--fb-text-muted);
  margin-top: 4px;
}

.field-errors {
  margin-top: 4px;
}

.field-error {
  font-size: 12px;
  color: var(--fb-danger);
}

.form-field.has-error .form-input,
.form-field.has-error .form-select,
.form-field.has-error .form-textarea {
  border-color: var(--fb-danger);
}

/* Radio & Checkbox groups */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-item,
.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--fb-radius);
  transition: background 0.15s ease;
}

.radio-item:hover,
.checkbox-item:hover {
  background: var(--fb-bg);
}

.radio-item input,
.checkbox-item input {
  margin-top: 2px;
}

.radio-label,
.checkbox-label {
  font-size: 14px;
  color: var(--fb-text);
}

.radio-description,
.checkbox-description {
  display: block;
  font-size: 12px;
  color: var(--fb-text-muted);
  margin-left: 24px;
}

/* Chips */
.chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 16px;
  border: 2px solid var(--fb-border);
  border-radius: 24px;
  background: var(--fb-bg-white);
  font-size: 14px;
  font-weight: 500;
  color: var(--fb-text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--fb-primary);
  background: var(--fb-primary-light);
}

.chip.selected {
  border-color: var(--fb-primary);
  background: var(--fb-primary);
  color: white;
}

.chip.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Rating */
.rating-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-items {
  display: flex;
  gap: 4px;
}

.rating-item {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.15s ease;
  color: var(--fb-border-dark);
}

.rating-item:hover {
  transform: scale(1.1);
}

.rating-item.selected {
  color: var(--fb-warning);
}

.rating-label {
  font-size: 12px;
  color: var(--fb-text-muted);
}

/* Yes/No toggle */
.yes-no-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.yes-no-toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.yes-no-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--fb-border-dark);
  border-radius: 28px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: var(--fb-shadow);
}

.yes-no-toggle input:checked + .toggle-slider {
  background: var(--fb-success);
}

.yes-no-toggle input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-label-no,
.toggle-label-yes {
  font-size: 13px;
  font-weight: 500;
  color: var(--fb-text-muted);
}

/* File upload */
.file-upload-wrapper {
  position: relative;
}

.file-dropzone {
  padding: 32px;
  border: 2px dashed var(--fb-border);
  border-radius: var(--fb-radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--fb-bg);
}

.file-dropzone:hover,
.file-dropzone.dragover {
  border-color: var(--fb-primary);
  background: var(--fb-primary-light);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dropzone-icon {
  font-size: 32px;
}

.dropzone-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--fb-text);
}

.dropzone-hint {
  font-size: 12px;
  color: var(--fb-text-muted);
}

.file-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Currency input */
.currency-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 12px;
  color: var(--fb-text-muted);
  font-weight: 600;
}

.currency-input {
  padding-left: 28px !important;
}

/* Section header */
.section-header {
  margin-bottom: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--fb-text);
  margin: 0 0 4px;
}

.section-description {
  font-size: 14px;
  color: var(--fb-text-muted);
  margin: 0;
}

/* Divider */
.form-divider {
  border: none;
  border-top: 1px solid var(--fb-border);
  margin: 24px 0;
}

/* HTML block */
.html-block {
  font-size: 14px;
  color: var(--fb-text);
  line-height: 1.6;
}

.html-block h1, .html-block h2, .html-block h3 {
  margin-top: 0;
}

.html-block p {
  margin: 0 0 12px;
}

.html-block p:last-child {
  margin-bottom: 0;
}

/* Multi-select wrapper */
.multi-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.multi-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--fb-border);
  border-radius: var(--fb-radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.multi-select-item:hover {
  border-color: var(--fb-primary);
  background: var(--fb-primary-light);
}

.multi-select-item.selected {
  border-color: var(--fb-primary);
  background: var(--fb-primary-light);
}

.multi-select-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Preview form styles */
.fb-preview-form {
  max-width: 600px;
  margin: 0 auto;
}

.fb-preview-form h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 8px;
}

.fb-preview-form > p {
  color: var(--fb-text-muted);
  margin: 0 0 24px;
}

.fb-preview-section {
  margin-bottom: 24px;
}

.fb-preview-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--fb-border);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .fb-inspector {
    width: 300px;
  }
  
  .fb-palette {
    width: 220px;
  }
}

@media (max-width: 900px) {
  .fb-sidebar {
    width: 220px;
  }
  
  .fb-inspector {
    display: none;
  }
}

@media (max-width: 600px) {
  .fb-shell {
    flex-direction: column;
  }
  
  .fb-sidebar {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--fb-border);
  }
  
  .fb-workspace {
    flex-direction: column;
  }
  
  .fb-palette {
    width: 100%;
    height: auto;
    max-height: 150px;
    border-right: none;
    border-bottom: 1px solid var(--fb-border);
  }
  
  .fb-palette-items {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 8px;
  }
  
  .fb-palette-item {
    flex-direction: row;
    min-width: auto;
    padding: 8px 12px;
  }
}

/* ===========================================
   🚀 PUBLISH WIZARD
=========================================== */
.fb-publish-wizard {
  max-width: 480px;
  border-radius: 20px;
  overflow: hidden;
  animation: wizardIn 0.3s ease;
}

@keyframes wizardIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.fb-publish-wizard .fb-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 10;
}

.fb-publish-wizard .fb-modal-close:hover {
  background: rgba(0,0,0,0.1);
}

.fb-publish-wizard-content {
  padding: 48px 40px 40px;
  text-align: center;
}

.fb-publish-wizard-icon {
  font-size: 64px;
  margin-bottom: 20px;
  display: block;
  animation: rocketBounce 1s ease infinite;
}

@keyframes rocketBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.fb-publish-success-icon {
  animation: successPop 0.5s ease;
}

@keyframes successPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.fb-publish-wizard-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--fb-text);
  margin: 0 0 12px 0;
}

.fb-publish-wizard-subtitle {
  font-size: 15px;
  color: var(--fb-text-muted);
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.fb-publish-wizard-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fef3c7;
  border-radius: 10px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 24px;
}

.fb-publish-wizard-form-preview {
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 12px;
  margin-bottom: 28px;
}

.fb-publish-wizard-form-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--fb-text);
  margin-bottom: 4px;
}

.fb-publish-wizard-form-fields {
  font-size: 13px;
  color: var(--fb-text-muted);
}

.fb-publish-wizard-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.fb-btn-lg {
  padding: 14px 28px;
  font-size: 15px;
  border-radius: 10px;
}

.fb-btn-publish {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fb-btn-publish:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.fb-btn-icon {
  font-size: 18px;
}

.fb-btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Success/Share Step */
.fb-publish-share-section {
  text-align: left;
  margin-bottom: 24px;
}

.fb-publish-share-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--fb-text-muted);
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fb-publish-url-box {
  display: flex;
  gap: 8px;
}

.fb-publish-url-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--fb-border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--fb-bg);
  color: var(--fb-text);
}

.fb-publish-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.fb-publish-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--fb-bg);
  border: 1px solid var(--fb-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
  font-weight: 600;
  color: var(--fb-text);
}

.fb-publish-action-btn:hover {
  background: var(--fb-primary-light);
  border-color: var(--fb-primary);
  color: var(--fb-primary);
  transform: translateY(-2px);
}

.fb-publish-action-icon {
  font-size: 24px;
}


/* Version badge in publish success */
.fb-publish-version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: #16a34a;
  margin-top: 8px;
}
