/* ===== Progress / Skill Bars plugin =====
   All selectors scoped under [data-cb-type="progress-bars"] so nothing leaks.
   Colors run through CSS variables so dark mode is a variable override. */
[data-cb-type="progress-bars"] {
    position: relative;
    width: 100%;
    --pb-accent: #3b82f6;
    --pb-track: #e5e7eb;
    --pb-text: #1a1a1a;
    --pb-muted: #6b7280;
    --pb-height: 10px;       /* medium (see size overrides) */
}

[data-cb-type="progress-bars"][data-cb-size="small"] { --pb-height: 6px; }
[data-cb-type="progress-bars"][data-cb-size="large"] { --pb-height: 16px; }

/* ── Dark mode (opt-in — commented out) ───────────────────────────────────
   Dark mode for a rendered block is the SITE's responsibility, not the plugin's.
   Every color above is a CSS variable, so to enable dark mode you only need to
   redefine the palette below under whatever trigger your site uses — a class,
   [data-theme="dark"], @media (prefers-color-scheme: dark), etc. Uncomment and
   change the selector to match your site's theme system.
   NOTE: `.dark` is also the ContentBuilder editor's own UI theme, so on a page
   that runs the editor, prefer a different class here to avoid the editor
   repainting your content while you edit.

.dark [data-cb-type="progress-bars"] {
    --pb-track: #3a3a3a;
    --pb-text: #f3f4f6;
    --pb-muted: #9ca3af;
}
*/

[data-cb-type="progress-bars"] .pb-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

[data-cb-type="progress-bars"] .pb-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 7px;
}

[data-cb-type="progress-bars"] .pb-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--pb-text);
}

[data-cb-type="progress-bars"] .pb-percent {
    font-size: 13px;
    font-weight: 600;
    color: var(--pb-muted);
    font-variant-numeric: tabular-nums;
}

[data-cb-type="progress-bars"][data-cb-show-percent="false"] .pb-percent { display: none; }

[data-cb-type="progress-bars"] .pb-track {
    width: 100%;
    height: var(--pb-height);
    background: var(--pb-track);
    border-radius: 999px;
    overflow: hidden;
}

[data-cb-type="progress-bars"] .pb-fill {
    height: 100%;
    width: 0;
    background: var(--pb-accent);
    border-radius: inherit;
    transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Square ends option */
[data-cb-type="progress-bars"][data-cb-rounded="false"] .pb-track,
[data-cb-type="progress-bars"][data-cb-rounded="false"] .pb-fill {
    border-radius: 0;
}

/* Reduced motion: no fill animation (mount still sets the final width) */
@media (prefers-reduced-motion: reduce) {
    [data-cb-type="progress-bars"] .pb-fill {
        transition: none !important;
    }
}

/* High contrast */
@media (prefers-contrast: high) {
    [data-cb-type="progress-bars"] .pb-track {
        border: 1px solid currentColor;
    }
}
