/**
 * Print & Banner Studio — admin design system ("2026 style")
 * ---------------------------------------------------------------
 * Shared tokens + components for every bd-* admin screen (Getting
 * Started, Products & Sizes, Categories, Templates, Fonts, Settings).
 * Deliberately a neutral slate/graphite palette with ONE accent colour
 * — this is the PLUGIN's own admin chrome, installed on many different
 * client sites, so it stays independent of any one site's own brand
 * colours (unlike the front-end "Design Online" modal, which
 * intentionally matches thebannerlady.com.au's navy/orange).
 */

#wpcontent {
    --bd-bg: #f6f7f9;
    --bd-surface: #ffffff;
    --bd-border: #e3e5ea;
    --bd-border-strong: #d1d5db;
    --bd-text: #1e2330;
    --bd-text-muted: #667085;
    --bd-text-faint: #98a2b3;
    --bd-accent: #4f46e5;
    --bd-accent-hover: #4338ca;
    --bd-accent-soft: #eef2ff;
    --bd-success: #16a34a;
    --bd-success-soft: #ecfdf3;
    --bd-warning: #b45309;
    --bd-warning-soft: #fffbeb;
    --bd-danger: #dc2626;
    --bd-danger-soft: #fef2f2;
    --bd-info: #0e7490;
    --bd-info-soft: #ecfeff;
    --bd-radius: 12px;
    --bd-radius-sm: 8px;
    --bd-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

.bd-surface-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.bd-merchant-surface .bd-card {
    min-height: 180px;
}

.bd-placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    margin-top: 20px;
    border: 1px dashed var(--bd-border-strong);
    border-radius: var(--bd-radius);
    color: var(--bd-text-faint);
    background: var(--bd-bg);
    font-size: 12px;
    letter-spacing: .04em;
}

.bd-account-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 16px;
}

.bd-account-facts dt {
    color: var(--bd-text-muted);
}

.bd-account-facts dd {
    margin: 0;
}

.bd-products-pagination {
    margin: 20px 0;
}

.bd-product-card-details {
    margin-top: 12px;
}

.bd-product-card-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 12px;
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius-sm);
    color: var(--bd-text-muted);
}

.bd-admin-wrap {
    max-width: 1160px;
    margin: 24px 24px 40px 0;
    color: var(--bd-text);
    font-size: 14px;
}

.bd-admin-wrap h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 23px;
    font-weight: 700;
    color: var(--bd-text);
    margin: 0 0 6px;
}

.bd-admin-lede {
    color: var(--bd-text-muted);
    font-size: 14px;
    max-width: 720px;
    margin: 0 0 24px;
    line-height: 1.6;
}

/* ---------- Card ---------- */

.bd-card {
    background: var(--bd-surface);
    border: 1px solid var(--bd-border);
    border-radius: var(--bd-radius);
    box-shadow: var(--bd-shadow);
    padding: 22px 24px;
}

.bd-card + .bd-card {
    margin-top: 16px;
}

.bd-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.bd-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--bd-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bd-card-grid {
    display: grid;
    gap: 16px;
}

/* ---------- Buttons (on top of, not replacing, wp-admin's .button) ---------- */

.bd-btn-accent,
.bd-btn-accent.button {
    background: var(--bd-accent) !important;
    border-color: var(--bd-accent) !important;
    color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.bd-btn-accent:hover,
.bd-btn-accent.button:hover {
    background: var(--bd-accent-hover) !important;
    border-color: var(--bd-accent-hover) !important;
    color: #fff !important;
}

/* ---------- Pills / badges ---------- */

.bd-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bd-accent-soft);
    color: var(--bd-accent);
    white-space: nowrap;
}

.bd-pill-muted {
    background: #f2f4f7;
    color: var(--bd-text-muted);
}

.bd-pill-success {
    background: var(--bd-success-soft);
    color: var(--bd-success);
}

.bd-pill-warning {
    background: var(--bd-warning-soft);
    color: var(--bd-warning);
}

.bd-pill-info {
    background: var(--bd-info-soft);
    color: var(--bd-info);
}

/* ---------- Line icons (stroke-based, replace dashicons where noted) ---------- */

.bd-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: none;
    vertical-align: -4px;
}

.bd-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Info tooltip ---------- */

.bd-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #eef0f3;
    color: var(--bd-text-muted);
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    cursor: help;
    position: relative;
    flex: none;
}

.bd-info-icon:hover,
.bd-info-icon:focus-visible {
    background: var(--bd-accent-soft);
    color: var(--bd-accent);
    outline: none;
}

.bd-tooltip-popover {
    display: none;
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    max-width: 260px;
    background: #1e2330;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.25);
}

.bd-tooltip-popover.open {
    display: block;
}

/* ---------- Searchable list (shared: admin Fonts screen + client font-picker) ---------- */

.bd-searchlist {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bd-searchlist-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bd-searchlist-input {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid var(--bd-border-strong, #d1d5db);
    border-radius: var(--bd-radius-sm, 8px);
    font-size: 13px;
}

.bd-searchlist-cats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bd-searchlist-cat {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--bd-border-strong, #d1d5db);
    background: #fff;
    color: var(--bd-text-muted, #667085);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.bd-searchlist-cat.active {
    background: var(--bd-accent, #4f46e5);
    border-color: var(--bd-accent, #4f46e5);
    color: #fff;
}

.bd-searchlist-body {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--bd-border, #e3e5ea);
    border-radius: var(--bd-radius-sm, 8px);
}

.bd-searchlist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--bd-border, #e3e5ea);
    cursor: pointer;
}

.bd-searchlist-row:last-child {
    border-bottom: none;
}

.bd-searchlist-row:hover {
    background: #fafafa;
}

.bd-searchlist-empty,
.bd-searchlist-sentinel {
    padding: 14px;
    text-align: center;
    color: var(--bd-text-faint, #98a2b3);
    font-size: 12.5px;
}

/* ---------- Timezone combobox (bd-timezone-select.js) ---------- */
/* A popover attached to a compact field, not an always-visible panel —
   the only reason this isn't just .bd-searchlist-* on its own. Reuses
   that same class (see bd-timezone-select.js's own comment) for the
   input/list/empty-state look; these rules only add the positioning
   and the keyboard-highlighted row state neither the input nor a
   plain .bd-searchlist-row has any use for. */

.bd-tzselect-wrap {
    position: relative;
    max-width: 320px;
}

.bd-tzselect-input {
    width: 100%;
    box-sizing: border-box;
}

.bd-tzselect-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 10;
    background: var(--bd-surface, #fff);
    box-shadow: var(--bd-shadow, 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06));
}

.bd-tzselect-dropdown .bd-searchlist-row.active {
    background: var(--bd-accent-soft, #eef2ff);
}

/* ---------- Checklist rows (Getting Started) ---------- */

.bd-checklist {
    display: flex;
    flex-direction: column;
}

.bd-checklist-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 4px;
    border-bottom: 1px solid var(--bd-border);
}

.bd-checklist-row:last-child {
    border-bottom: none;
}

.bd-checklist-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 50%;
    border: 2px solid var(--bd-border-strong);
    color: transparent;
    font-size: 14px;
    font-weight: 700;
}

.bd-checklist-row.is-done .bd-checklist-status {
    background: var(--bd-success-soft);
    border-color: var(--bd-success);
    color: var(--bd-success);
}

.bd-checklist-body {
    flex: 1;
    min-width: 0;
}

.bd-checklist-title {
    font-weight: 600;
    color: var(--bd-text);
    font-size: 14px;
}

.bd-checklist-row.is-done .bd-checklist-title {
    color: var(--bd-text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--bd-border-strong);
}

.bd-checklist-text {
    color: var(--bd-text-muted);
    font-size: 12.5px;
    margin-top: 2px;
}

/* ---------------------------------------------------------------
   Shared HSV colour picker (SV square + hue/alpha sliders) — the
   exact same widget the canvas editor uses for text/shape colours
   (banner-designer.js/css), moved here so any other bd-* admin
   screen needing a colour field (e.g. the "Design Online" button
   colour on the Settings screen) can reuse it unmodified instead of
   a second, redundant custom picker. See BDColorPicker in
   bd-admin-design-system.js for the JS half.
   Every rule below is scoped under #bd-color-picker-popup and uses
   hardcoded values rather than this file's own --bd-* tokens — this
   file loads inside BOTH ordinary wp-admin pages (where #wpcontent
   defines those tokens) and the theme-free editor iframe (which has
   no #wpcontent and defines its own, differently-valued --bd-*
   tokens under #banner-designer-app.bd-modern instead) — so the
   popup needs to look right regardless of which of those two contexts
   it's rendered in, rather than depending on either one's variables.
   The ID-selector scoping also means these never collide with
   banner-designer.css's OWN general .bd-btn/.bd-icon-btn/.bd-swatch-*
   rules used throughout the rest of the editor's toolbar — both
   simply apply, higher specificity here always wins for anything
   inside this one popup. --------------------------------------- */
#bd-color-picker-popup {
    display: none;
    position: fixed;
    z-index: 150;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    padding: 14px;
    width: 260px;
}

#bd-color-picker-popup .bd-popup-section {
    margin-bottom: 12px;
}

#bd-color-picker-popup .bd-popup-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 6px;
}

#bd-color-picker-popup .bd-swatch-row,
#bd-color-picker-popup .bd-swatch-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#bd-color-picker-popup .bd-swatch-grid {
    max-height: 130px;
    overflow-y: auto;
}

#bd-color-picker-popup .bd-swatch-cell {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

#bd-color-picker-popup .bd-popup-custom-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bd-picker-area-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.bd-picker-canvas-wrap {
    position: relative;
}

#bd-sv-canvas {
    border-radius: 6px;
    cursor: crosshair;
}

#bd-hue-canvas,
#bd-alpha-canvas {
    border-radius: 4px;
    cursor: pointer;
}

.bd-picker-area-row > canvas,
.bd-picker-area-row > div {
    display: block;
}

.bd-picker-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#bd-hue-handle,
#bd-alpha-handle {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    left: 50% !important;
    transform: translate(-50%, -50%);
}

#bd-color-picker-popup .bd-no-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    color: #d32f2f;
}

#bd-color-picker-popup .bd-no-color-row:hover {
    background: #fdeeee;
}

#bd-color-picker-popup .bd-no-color-icon {
    font-size: 15px;
}

#bd-color-picker-popup .bd-current-preview {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%),
        linear-gradient(-45deg, #ccc 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ccc 75%),
        linear-gradient(-45deg, transparent 75%, #ccc 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}

#bd-color-picker-popup .bd-hex-input {
    flex: 1;
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
}

#bd-color-picker-popup .bd-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

#bd-color-picker-popup .bd-btn {
    padding: 8px 14px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

#bd-color-picker-popup .bd-btn:hover {
    background: #f5f5f5;
}

#bd-color-picker-popup .bd-btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #2271b1;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

#bd-color-picker-popup .bd-btn-primary:hover {
    background: #1a5a8f;
}

#bd-color-picker-popup .bd-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: #333;
    transition: background 0.15s;
}

#bd-color-picker-popup .bd-icon-btn:hover {
    background: #f0f0f0;
}

#bd-color-picker-popup .bd-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Live Design Queue live-update — short highlight pulse on a row that
   just changed via a real-time queue_changed event (see
   bd-live-design-queue.js), so the change is actually noticed rather
   than silently swapped in. Same deliberately gentle, non-jarring
   style already used for this feature's other animations (the "…"
   connecting dots, the Live Help tab's one-time attention pulse). */
@keyframes bd-queue-row-pulse {
    0% { background-color: #fff3cd; }
    100% { background-color: transparent; }
}

.bd-queue-row-pulse {
    animation: bd-queue-row-pulse 2s ease-out;
}
