.ff-getting-started {
  background: linear-gradient(135deg, #f8fdfe 0%, #e6f7fa 100%);
  border-radius: 12px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 24px;
  text-align: center;
  margin: 20px 0;
}

.ff-getting-started h3 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.wp-block-fetchflow-content-pattern-block {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ff-block-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    transition: all 0.2s ease;
}

/* Empty State */
.ff-empty-state {
    padding: 48px 32px;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 2px dashed #cbd5e1;
}

.ff-empty-state .ff-block-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: #4f46e5;
    background: #e0e7ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.ff-empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.ff-empty-state p {
    margin: 0 0 24px;
    font-size: 14px;
    color: #64748b;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.ff-select-wrapper {
    max-width: 300px;
    margin: 0 auto;
    text-align: left;
}

/* Selected State */
.ff-selected-state {
    display: flex;
    flex-direction: column;
}

.ff-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.ff-brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ff-brand-icon {
    width: 32px;
    height: 32px;
    color: #ffffff;
    background: #0f172a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.1);
}

.ff-brand-title {
    display: flex;
    flex-direction: column;
}

.ff-brand-title span.ff-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: #64748b;
    line-height: 1;
    margin-bottom: 4px;
}

.ff-brand-title strong {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1;
}

.ff-brand-actions {
    display: flex;
    gap: 8px;
}

.ff-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ff-badge-blue {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.ff-badge-purple {
    background: #fdf4ff;
    color: #c026d3;
    border: 1px solid #f5d0fe;
}

.ff-badge-slate {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* Block Body / Previews */
.ff-block-body {
    padding: 24px;
    background: #ffffff;
    min-height: 100px;
}

.ff-preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #64748b;
    font-size: 14px;
    padding: 32px 0;
}

.ff-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: ff-spin 1s linear infinite;
}

@keyframes ff-spin {
    to { transform: rotate(360deg); }
}

.ff-preview-error {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
}

.ff-preview-error svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.ff-error-content strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.ff-error-content p {
    margin: 0 0 12px;
    font-size: 13px;
    color: #991b1b;
}

.ff-preview-content {
    opacity: 0.8; /* Make it look like a preview */
    pointer-events: none; /* Prevent interacting with preview links in editor */
}

.ff-preview-empty {
    text-align: center;
    padding: 32px;
    color: #94a3b8;
    font-size: 14px;
    font-style: italic;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

/* Block Footer */
.ff-block-footer {
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.ff-block-footer .components-base-control__field {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ff-block-footer .components-base-control__label {
    margin-bottom: 0;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.fetchflow-template-editor {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.fetchflow-template-editor h3 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #1e1e1e;
}

.fetchflow-template-editor .preview {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

.fetchflow-template-editor .error {
    color: #cc1818;
    padding: 10px;
    background: #f8d7da;
    border-radius: 4px;
}

/* Frontend styles */
.fetchflow-template {
    position: relative;
}

.fetchflow-filters {
    margin-bottom: 20px;
}

.fetchflow-content {
    position: relative;
}

.fetchflow-debug {
    margin-top: 20px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
}

/* The pattern owns its container rendering: without this, theme/browser
   list defaults (bullets, indentation, margins) bury the pattern's styling
   on the frontend and in the editor preview. */
.ff-content-pattern ul,
.ff-content-pattern ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ff-content-pattern table {
    width: 100%;
    border-collapse: collapse;
}

/* A public page should communicate a problem without exposing request,
   template, or server details. The renderer uses these for empty and failed
   content patterns. */
.ff-content-pattern-status {
    margin: 0;
    padding: 0.875rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
    color: #475569;
    font-size: 0.875rem;
    line-height: 1.5;
}

.ff-content-pattern-status p {
    margin: 0;
}

.ff-content-pattern-status--unavailable {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

/* Semantic item classes emitted by the layout-preset scaffolds. These ship
   with the plugin on every surface (frontend, editor, admin preview). */
.ff-item-title {
    margin: 0 0 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.ff-item-text {
    margin: 0 0 0.25rem;
    font-size: 0.875rem;
    opacity: 0.75;
    line-height: 1.5;
}

.ff-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.25rem 0;
}

.ff-item-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.55;
}

.ff-item-value {
    font-size: 0.875rem;
}

/* ---------------------------------------------------------------------------
   Style presets — one polished default per output shape. Colors stay neutral
   so they sit well in any theme; accents inherit the site's link color where
   possible.
--------------------------------------------------------------------------- */

/* Clean List — quiet divided rows */
.ff-pattern-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: var(--ff-pattern-border-width, 1px) solid var(--ff-pattern-border-color, #e5e9f0);
    border-radius: var(--ff-pattern-radius, 12px);
    background: var(--ff-pattern-background, #ffffff);
    color: var(--ff-pattern-text-color, inherit);
    overflow: hidden;
}

.ff-pattern-list li {
    margin: 0;
    padding: var(--ff-pattern-item-padding, 0.875rem 1.125rem);
    border-bottom: var(--ff-pattern-border-width, 1px) solid var(--ff-pattern-border-color, #eef1f6);
    transition: background-color 0.15s ease;
}

.ff-pattern-list li:last-child {
    border-bottom: 0;
}

.ff-pattern-list li:hover {
    background-color: #f8fafc;
}

/* Card Stack — elevated cards that lift on hover */
.ff-pattern-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--ff-pattern-item-gap, 0.875rem);
    color: var(--ff-pattern-text-color, inherit);
}

.ff-pattern-cards li {
    list-style: none;
    margin: 0;
    padding: var(--ff-pattern-item-padding, 1.125rem 1.25rem);
    border: var(--ff-pattern-border-width, 1px) solid var(--ff-pattern-border-color, #e2e8f0);
    border-radius: var(--ff-pattern-radius, 12px);
    background: var(--ff-pattern-background, #ffffff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ff-pattern-cards li:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

/* Feature Grid — responsive multi-column cards */
.ff-pattern-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--ff-pattern-item-gap, 1rem);
    color: var(--ff-pattern-text-color, inherit);
}

.ff-pattern-grid li {
    list-style: none;
    margin: 0;
    padding: var(--ff-pattern-item-padding, 1.125rem 1.25rem);
    border: var(--ff-pattern-border-width, 1px) solid var(--ff-pattern-border-color, #e2e8f0);
    border-radius: var(--ff-pattern-radius, 12px);
    background: var(--ff-pattern-background, #ffffff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ff-pattern-grid li:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

/* Inline Chips — compact pills for tags/short values */
.ff-pattern-inline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ff-pattern-item-gap, 0.5rem);
    color: var(--ff-pattern-text-color, inherit);
}

.ff-pattern-inline li {
    list-style: none;
    margin: 0;
    padding: var(--ff-pattern-item-padding, 0.375rem 0.875rem);
    border-radius: var(--ff-pattern-radius, 999px);
    background: var(--ff-pattern-background, #f1f5f9);
    color: var(--ff-pattern-text-color, #334155);
    border: var(--ff-pattern-border-width, 1px) solid var(--ff-pattern-border-color, #e2e8f0);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ff-pattern-inline li:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

/* Tables — contained, with quiet header and row hover */
.ff-pattern-table,
.ff-pattern-table-striped {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: var(--ff-pattern-border-width, 1px) solid var(--ff-pattern-border-color, #e5e9f0);
    border-radius: var(--ff-pattern-radius, 12px);
    overflow: hidden;
    background: var(--ff-pattern-background, #ffffff);
    color: var(--ff-pattern-text-color, inherit);
}

.ff-pattern-table td,
.ff-pattern-table-striped td {
    padding: var(--ff-pattern-item-padding, 0.8125rem 1.125rem);
    border-bottom: var(--ff-pattern-border-width, 1px) solid var(--ff-pattern-border-color, #eef1f6);
    text-align: left;
    vertical-align: top;
    font-size: 0.9375rem;
}

.ff-pattern-table th,
.ff-pattern-table-striped th {
    padding: var(--ff-pattern-item-padding, 0.6875rem 1.125rem);
    border-bottom: var(--ff-pattern-border-width, 1px) solid var(--ff-pattern-border-color, #e5e9f0);
    text-align: left;
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.ff-pattern-table tbody tr:last-child td,
.ff-pattern-table-striped tbody tr:last-child td {
    border-bottom: 0;
}

.ff-pattern-table tbody tr {
    transition: background-color 0.15s ease;
}

.ff-pattern-table tbody tr:hover {
    background-color: #f8fafc;
}

.ff-pattern-table-striped tbody tr:nth-child(odd) {
    background: #f8fafc;
}

/* Search and Pagination UI */
.ff-pattern-filters-wrapper {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .ff-pattern-filters-wrapper {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.ff-pattern-search {
  width: 100%;
  max-width: 400px;
  padding: 0.625rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.ff-pattern-search:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 1px #0f172a;
}

.ff-pattern-selects-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ff-pattern-filter-select {
  padding: 0.625rem 2rem 0.625rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #334155;
  background-color: white;
  cursor: pointer;
  outline: none;
  -moz-appearance: none;
       appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 24 24%27 stroke=%27%2364748b%27%3E%3Cpath stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27M19 9l-7 7-7-7%27%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1rem;
}
.ff-pattern-filter-select:focus {
  border-color: #0f172a;
  box-shadow: 0 0 0 1px #0f172a;
}
.ff-pattern-pagination {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}
.ff-pattern-page-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #e2e8f0;
  background: white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: #0f172a;
  transition: all 0.2s;
}
.ff-pattern-page-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.ff-pattern-page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9;
}
.ff-pattern-page-info {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

