/**
 * FacetCore Admin UI Styles
 * Scoped strictly to FacetCore edit screens and components.
 */

/* 1. Main configuration layout */
.post-type-facetcore_table #poststuff #post-body.columns-2 {
  margin-right: 300px;
}

.facetcore-editor-wrap {
  max-width: 1150px;
  box-sizing: border-box;
  color: #2c3338;
}

/* 2. Section cards */
.facetcore-editor-wrap .fc-card {
  background: #ffffff;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  margin-bottom: 20px;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.facetcore-editor-wrap .fc-card:last-child {
  margin-bottom: 0;
}

.facetcore-editor-wrap .fc-card__header {
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f1;
  background: #fafafa;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}

.facetcore-editor-wrap .fc-card__title {
  margin: 0 0 3px 0;
  font-size: 14.5px;
  font-weight: 600;
  color: #1d2327;
  line-height: 1.3;
}

.facetcore-editor-wrap .fc-card__subtitle {
  margin: 0;
  color: #646970;
  font-size: 13px;
  line-height: 1.4;
}

.facetcore-editor-wrap .fc-card__body {
  padding: 18px 20px;
}

/* 3. Compact Radio Options (Products source & Results layout) */
.facetcore-editor-wrap .fc-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  max-width: 760px;
}

.facetcore-editor-wrap .fc-radio-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 13.5px;
  color: #1d2327;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  user-select: none;
}

.facetcore-editor-wrap .fc-radio-option:hover {
  border-color: #8c8f94;
  background: #f6f7f7;
}

.facetcore-editor-wrap .fc-radio-option.is-selected {
  border-color: #2271b1;
  background: #f0f6fc;
  font-weight: 600;
  color: #1d2327;
}

.facetcore-editor-wrap .fc-radio-option input[type="radio"] {
  margin: 0;
}

/* Legacy card radios kept for fallback */
.facetcore-editor-wrap .fc-radio-card {
  border: 1px solid #dcdcde;
  border-radius: 4px;
  padding: 12px 14px;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.facetcore-editor-wrap .fc-radio-card:hover {
  border-color: #8c8f94;
}

.facetcore-editor-wrap .fc-radio-card.is-selected {
  border-color: #2271b1;
  background: #f0f6fc;
}

/* Category picker */
.facetcore-editor-wrap .fc-category-picker {
  margin-top: 14px;
  max-width: 760px;
  transition: opacity 0.2s ease;
}

.facetcore-editor-wrap .fc-category-picker.is-inactive {
  display: none;
}

.facetcore-editor-wrap .fc-category-picker__header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #1d2327;
}

.facetcore-editor-wrap .fc-category-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  background: #fff;
}

.facetcore-editor-wrap .fc-category-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  margin: 2px 0;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
}

.facetcore-editor-wrap .fc-category-item:hover {
  background: #f6f7f7;
}

.facetcore-editor-wrap .fc-category-item.is-checked {
  background: #f0f6fc;
  font-weight: 500;
}

/* 4. Filters empty state */
.facetcore-editor-wrap .fc-empty-state {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  background: #fcfcfc;
  border: 1px solid #c3c4c7;
  border-left: 4px solid #2271b1;
  border-radius: 4px;
  max-width: 760px;
}

.facetcore-editor-wrap .fc-empty-state__icon {
  font-size: 32px;
  width: 32px;
  height: 32px;
  color: #2271b1;
  flex-shrink: 0;
  margin-top: 2px;
}

.facetcore-editor-wrap .fc-empty-state__content {
  flex: 1;
}

.facetcore-editor-wrap .fc-empty-state__title {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
}

.facetcore-editor-wrap .fc-empty-state__steps {
  margin: 8px 0 14px 20px;
  padding: 0;
  color: #2c3338;
  font-size: 13px;
  line-height: 1.6;
}

.facetcore-editor-wrap .fc-empty-state__action {
  margin: 0;
}

/* 5. Ordering list UI */
.facetcore-editor-wrap .fc-order-wrap {
  max-width: 760px;
}

.facetcore-editor-wrap .fc-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px 8px;
  font-size: 12.5px;
}

.facetcore-editor-wrap .fc-order-count {
  font-weight: 600;
  color: #2271b1;
  background: #f0f6fc;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #c5d9ed;
}

.facetcore-editor-wrap .fc-order-hint {
  color: #646970;
  margin: 0;
}

.facetcore-editor-wrap .fc-order-list {
  max-width: 760px;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  background: #fff;
  margin: 0;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.facetcore-editor-wrap .fc-order-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  margin: 0;
  border-bottom: 1px solid #edf0f2;
  background: #fff;
  transition: background-color 0.15s ease;
}

.facetcore-editor-wrap .fc-order-list li:last-child {
  border-bottom: 0;
}

.facetcore-editor-wrap .fc-order-list li:hover {
  background: #f9fafb;
}

.facetcore-editor-wrap .fc-order-list li.is-selected {
  background: #f0f6fc;
}

.facetcore-editor-wrap .fc-order-list li.is-selected:hover {
  background: #e8f2fc;
}

.facetcore-editor-wrap .fc-order-list li:focus-within {
  background: #eef5fc;
}

.facetcore-editor-wrap .fc-order-item-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  font-size: 13px;
  color: #2c3338;
}

.facetcore-editor-wrap .fc-order-list li.is-selected .fc-order-item-label {
  font-weight: 600;
  color: #1d2327;
}

.facetcore-editor-wrap .fc-order-actions {
  display: inline-flex;
  gap: 4px;
  white-space: nowrap;
}

.facetcore-editor-wrap .fc-btn-move {
  min-width: 26px;
  height: 26px;
  line-height: 24px;
  padding: 0 6px;
  font-size: 12px;
  color: #50575e;
  border-color: #dcdcde;
  background: #f6f7f7;
}

.facetcore-editor-wrap .fc-btn-move:hover {
  color: #1d2327;
  border-color: #8c8f94;
  background: #fff;
}

/* 6. Form control rows and toggle labels */
.facetcore-editor-wrap .fc-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  font-size: 13.5px;
}

.facetcore-editor-wrap .fc-toggle-title {
  font-weight: 600;
  color: #1d2327;
}

.facetcore-editor-wrap .fc-field-help {
  margin: 4px 0 0 24px;
  color: #646970;
  font-size: 12.5px;
}

.facetcore-editor-wrap .fc-field-help--no-indent {
  margin-left: 0;
}

.facetcore-editor-wrap .fc-control-row {
  margin-bottom: 14px;
}

.facetcore-editor-wrap .fc-control-row:last-child {
  margin-bottom: 0;
}

.facetcore-editor-wrap .fc-control-row--mb {
  margin-bottom: 16px;
}

.facetcore-editor-wrap .fc-subheading {
  display: block;
  margin-bottom: 4px;
  font-size: 13.5px;
  color: #1d2327;
}

/* 7. Advanced settings collapsible card */
details.fc-card--advanced {
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

summary.fc-advanced-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  background: #fafafa;
  border-bottom: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

summary.fc-advanced-summary::-webkit-details-marker {
  display: none;
}

summary.fc-advanced-summary:hover {
  background: #f0f0f1;
}

details.fc-card--advanced[open] > summary.fc-advanced-summary {
  border-bottom: 1px solid #f0f0f1;
}

.facetcore-editor-wrap .fc-advanced-summary__title-wrap {
  flex: 1;
}

.facetcore-editor-wrap .fc-advanced-toggle-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: #50575e;
  background: #f0f0f1;
  border: 1px solid #dcdcde;
  border-radius: 3px;
  padding: 3px 8px;
  flex-shrink: 0;
}

.facetcore-editor-wrap .fc-advanced-toggle-badge .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

details.fc-card--advanced[open] > summary.fc-advanced-summary .dashicons-arrow-down-alt2 {
  transform: rotate(180deg);
}

.facetcore-editor-wrap .fc-advanced-body {
  padding: 20px;
}

/* Advanced sections */
.facetcore-editor-wrap .fc-advanced-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #f0f0f1;
  max-width: 760px;
}

.facetcore-editor-wrap .fc-advanced-section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.facetcore-editor-wrap .fc-section-heading {
  font-size: 13.5px;
  font-weight: 600;
  color: #1d2327;
  margin: 0 0 12px 0;
}

/* Sub-details (Table columns & Grid card customization) */
.facetcore-editor-wrap .fc-sub-details {
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  margin-top: 4px;
}

.facetcore-editor-wrap summary.fc-sub-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  background: #fdfdfd;
  transition: background 0.15s ease;
  user-select: none;
}

.facetcore-editor-wrap summary.fc-sub-summary::-webkit-details-marker {
  display: none;
}

.facetcore-editor-wrap summary.fc-sub-summary:hover {
  background: #f6f7f7;
}

.facetcore-editor-wrap .fc-sub-summary__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.facetcore-editor-wrap .fc-sub-summary__title {
  font-size: 13px;
  font-weight: 600;
  color: #1d2327;
}

.facetcore-editor-wrap .fc-sub-summary__preview {
  font-size: 12px;
  color: #646970;
  line-height: 1.35;
}

.facetcore-editor-wrap .fc-sub-summary__action {
  pointer-events: none;
  font-size: 12px;
}

.facetcore-editor-wrap details.fc-sub-details[open] > summary.fc-sub-summary {
  border-bottom: 1px solid #edf0f2;
  background: #f6f7f7;
}

.facetcore-editor-wrap .fc-sub-content {
  padding: 14px 16px;
  background: #fff;
}

/* 8. Result settings rows (Pagination & Counts) */
.facetcore-editor-wrap .fc-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f1;
  max-width: 760px;
}

.facetcore-editor-wrap .fc-setting-row:first-child {
  padding-top: 0;
}

.facetcore-editor-wrap .fc-setting-row--footer,
.facetcore-editor-wrap .fc-setting-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.facetcore-editor-wrap .fc-setting-label {
  flex: 1;
}

.facetcore-editor-wrap .fc-setting-label label {
  font-size: 13px;
  color: #1d2327;
}

.facetcore-editor-wrap .fc-setting-label .description {
  margin: 2px 0 0;
}

.facetcore-editor-wrap .fc-setting-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.facetcore-editor-wrap .fc-setting-control-full {
  width: 100%;
}

.facetcore-editor-wrap .fc-input-suffix {
  font-size: 12.5px;
  color: #646970;
}

#fc-per-page {
  width: 75px;
}

/* 9. Shortcode box & copy controls */
.fc-shortcode-meta-wrap {
  padding: 4px 0;
}

.fc-shortcode-instruction {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: #50575e;
}

#facetcore-shortcode .facetcore-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#facetcore-shortcode .facetcore-copy .fc-shortcode-input {
  width: 100%;
  box-sizing: border-box;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  background: #f6f7f7;
  border: 1px solid #c3c4c7;
  padding: 6px 8px;
  border-radius: 4px;
  color: #1d2327;
}

#facetcore-shortcode .facetcore-copy .fc-copy-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* Inside the WP list table (admin all finders screen) */
.wp-list-table .facetcore-copy {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.wp-list-table .facetcore-copy .fc-shortcode-input {
  width: 180px;
  font-family: Consolas, Monaco, monospace;
  font-size: 12px;
}

.wp-list-table .facetcore-copy .fc-copy-btn {
  width: auto;
}
