/* ============================================================================
   bar-chart.css -- widget #02 (horizontal labeled value bars)

   reuses the library theme tokens (variables.css / course-widgets.css). the
   fill uses --cw-accent so a course can recolor the whole chart by setting
   --cw-accent on the mount. no hard-coded hex.
   ============================================================================ */

.cw-bar-chart { display: block; }

.cw-bar-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--cw-gap, 12px);
}

.cw-bar-row {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
}

.cw-bar-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.cw-bar-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--cw-text);
}

.cw-bar-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cw-accent);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.cw-bar-track {
    position: relative;
    height: 8px;
    background: var(--cw-accent-soft);
    border-radius: 100px;
    overflow: hidden;
}

.cw-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    background: var(--cw-accent);
    border-radius: 100px;
    transform-origin: left center;
}

.cw-anim-on .cw-bar-fill {
    animation: cw-bar-grow 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cw-bar-grow {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

.cw-bar-desc {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--cw-muted);
    margin: 8px 0 0;
}
