/* ── Two-Tone Fiber Bar ──────────────────────────────────────────────────── */

.fiber-bar-container {
    display: flex;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f4;
    gap: 2px;
}

.fiber-bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0;
    transition: width 0.6s ease-out;
    border-radius: 6px;
    min-width: 0;
    overflow: hidden;
}

.fiber-bar-segment.fiber-bar-animate {
    width: var(--target-width);
}

.fiber-soluble {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}

.fiber-insoluble {
    background: linear-gradient(135deg, #34d399, #10b981);
    color: #064e3b;
}

.fiber-total-only {
    background: linear-gradient(135deg, #a8a29e, #78716c);
    color: white;
}

.fiber-bar-label {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 0 8px;
}

/* ── Mini Inline Fiber Bar (tables) ─────────────────────────────────────── */

.fiber-bar-mini {
    width: 60px;
    height: 8px;
    background: #f5f5f4;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.fiber-bar-mini::after {
    content: '';
    display: block;
    height: 100%;
    width: var(--fiber-pct, 0%);
    background: linear-gradient(90deg, #34d399, #10b981);
    border-radius: 4px;
    transition: width 0.4s ease-out;
}

/* ── % Daily Value Badge ───────────────────────────────────────────────── */

.daily-pct-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 3px solid;
    flex-shrink: 0;
}

.daily-pct-high {
    border-color: #10b981;
    color: #065f46;
    background: #ecfdf5;
}

.daily-pct-med {
    border-color: #f59e0b;
    color: #78350f;
    background: #fffbeb;
}

.daily-pct-low {
    border-color: #d6d3d1;
    color: #78716c;
    background: #fafaf9;
}

/* ── Daily Value Progress Bar ─────────────────────────────────────────── */

.daily-bar {
    height: 10px;
    background: #f5f5f4;
    border-radius: 5px;
    overflow: hidden;
}

.daily-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 5px;
    transition: width 0.8s ease-out;
}

.daily-bar-fill.daily-bar-animate {
    width: var(--daily-pct, 0%);
}

.daily-fill-high {
    background: linear-gradient(90deg, #34d399, #10b981);
}

.daily-fill-med {
    background: linear-gradient(90deg, #fcd34d, #f59e0b);
}

.daily-fill-low {
    background: linear-gradient(90deg, #d6d3d1, #a8a29e);
}

/* ── Category Rank Strip ────────────────────────────────────────────────── */

.rank-strip {
    position: relative;
    height: 8px;
    background: linear-gradient(90deg, #fecaca, #fde68a, #bbf7d0);
    border-radius: 4px;
    overflow: visible;
}

.rank-strip-fill {
    height: 100%;
    width: var(--rank-pct, 0%);
    border-radius: 4px;
    transition: width 0.8s ease-out;
}

.rank-strip-marker {
    position: absolute;
    top: -4px;
    left: var(--rank-pct, 0%);
    width: 16px;
    height: 16px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: left 0.8s ease-out;
}

/* ── Gut Jar ────────────────────────────────────────────────────────────── */

.jar-glow {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
}

.jar-glow.active {
    animation: glow-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3), 0 0 60px rgba(16, 185, 129, 0.1);
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ── Calculator Food Item ───────────────────────────────────────────────── */

.calc-food-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid #e7e5e4;
    border-radius: 8px;
    padding: 10px 14px;
    transition: all 0.2s;
}

.calc-food-item:hover {
    border-color: #d6d3d1;
}

.calc-remove {
    color: #a8a29e;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
    border: none;
    background: none;
    font-size: 16px;
}

.calc-remove:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* ── Category color dots (for jar layers) ──────────────────────────────── */

:root {
    --cat-fruits: #a855f7;
    --cat-vegetables: #22c55e;
    --cat-legumes: #92400e;
    --cat-grains: #eab308;
    --cat-nuts-seeds: #f97316;
    --cat-cereals: #d4a574;
    --cat-default: #64748b;
}
