/* OmLife Progress Tracker - Frontend CSS v2.0 */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --ol-bg:        #FFFFFF;
    --ol-frost:     #F8FAFC;
    --ol-slate:     #0F172A;
    --ol-slate-2:   #1E293B;
    --ol-violet:    #7C3AED;
    --ol-violet-lt: #EDE9FE;
    --ol-violet-dk: #5B21B6;
    --ol-violet-md: #8B5CF6;
    --ol-border:    #E2E8F0;
    --ol-muted:     #64748B;
    --ol-green:     #16A34A;
    --ol-green-lt:  #DCFCE7;
    --ol-amber:     #0EA5E9; /* replaced by blue */
    --ol-amber-lt:  #E0F2FE; /* replaced by blue */
    --ol-red:       #DC2626;
    --ol-red-lt:    #FEE2E2;
    --ol-font:      'DM Sans', -apple-system, sans-serif;
    --ol-display:   'Outfit', -apple-system, sans-serif;
    --ol-radius:    18px;
    --ol-radius-sm: 12px;
    --ol-shadow:    0 2px 16px rgba(124,58,237,.08);
    --ol-shadow-lg: 0 8px 40px rgba(124,58,237,.16);
}

.omlife-wrap * { box-sizing: border-box; margin: 0; padding: 0; }

.omlife-wrap {
    font-family: var(--ol-font);
    color: var(--ol-slate);
    background: var(--ol-bg);
    max-width: 880px;
    margin: 0 auto;
    padding: 28px 20px 56px;
}

/* Login Prompt */
.omlife-login-prompt { text-align:center; padding:64px 24px; background:var(--ol-frost); border-radius:var(--ol-radius); border:1.5px solid var(--ol-border); }
.omlife-lock-icon { font-size:52px; margin-bottom:18px; }
.omlife-login-prompt h3 { font-family:var(--ol-display); font-size:22px; font-weight:700; margin-bottom:22px; }

/* Header */
.omlife-header {
    display:flex; align-items:center; justify-content:space-between; gap:20px;
    background:linear-gradient(135deg,#7C3AED 0%,#4C1D95 100%);
    border-radius:var(--ol-radius); padding:28px 30px; margin-bottom:20px;
    color:#fff; box-shadow:var(--ol-shadow-lg); position:relative; overflow:hidden;
}
.omlife-header::before { content:''; position:absolute; top:-50px; right:-50px; width:220px; height:220px; border-radius:50%; background:rgba(255,255,255,.06); pointer-events:none; }
.omlife-header::after  { content:''; position:absolute; bottom:-70px; left:40px; width:180px; height:180px; border-radius:50%; background:rgba(255,255,255,.04); pointer-events:none; }
.omlife-header__info { flex:1; min-width:0; position:relative; z-index:1; }
.omlife-header__greeting { font-size:13px; opacity:.75; margin-bottom:6px; font-weight:500; }
.omlife-header__name { font-family:var(--ol-display); font-size:34px; font-weight:800; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; letter-spacing:-.02em; line-height:1.1; }
.omlife-header__groups { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.omlife-tag { font-size:11px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; background:rgba(255,255,255,.16); color:rgba(255,255,255,.9); padding:4px 11px; border-radius:100px; border:1px solid rgba(255,255,255,.2); }
.omlife-header__stat { flex-shrink:0; text-align:center; position:relative; z-index:1; }

/* Stat Ring */
.omlife-stat-ring { position:relative; width:76px; height:76px; margin:0 auto 8px; }
.omlife-circular-chart { width:76px; height:76px; transform:rotate(-90deg); }
.omlife-circle-bg { fill:none; stroke:rgba(255,255,255,.18); stroke-width:2.5; }
.omlife-circle { fill:none; stroke-width:2.5; stroke-linecap:round; transition:stroke-dasharray 1.4s cubic-bezier(.4,0,.2,1); }
.omlife-circle--high { stroke:#86EFAC; }
.omlife-circle--mid  { stroke:#38BDF8; }
.omlife-circle--low  { stroke:#FCA5A5; }
.omlife-stat-ring__value { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-family:var(--ol-display); font-size:15px; font-weight:800; color:#fff; }
.omlife-stat-ring__label { font-size:11px; color:rgba(255,255,255,.65); font-weight:600; letter-spacing:.03em; }

/* Tabs */
.omlife-tabs { display:flex; gap:4px; background:var(--ol-frost); border-radius:12px; padding:5px; margin-bottom:22px; border:1.5px solid var(--ol-border); overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.omlife-tabs::-webkit-scrollbar { display:none; }
.omlife-tab { flex:1; text-align:center; padding:10px 16px; border-radius:9px; font-size:13.5px; font-weight:600; color:var(--ol-muted); text-decoration:none; transition:all .2s; white-space:nowrap; }
.omlife-tab:hover { color:var(--ol-violet); background:var(--ol-violet-lt); }
.omlife-tab--active { background:var(--ol-violet); color:#fff; box-shadow:0 2px 12px rgba(124,58,237,.35); }

/* Section title */
.omlife-section-title { font-family:var(--ol-display); font-size:18px; font-weight:700; color:var(--ol-slate); margin-bottom:14px; display:flex; align-items:center; gap:10px; }

/* ═══════════════════════════════════════════
   BAR CHART — Solid 3D Pillar Design v5
   Y-axis labels · Grid lines · No bubble gloss
═══════════════════════════════════════════ */

:root {
    --ol-blue:    #0EA5E9;
    --ol-blue-lt: #E0F2FE;
    --ol-blue-dk: #0369A1;
    --ol-chart-h: 220px;
    --ol-yaxis-w: 42px;
}

.omlife-chart-card {
    background: #fff;
    border: 1.5px solid var(--ol-border);
    border-radius: var(--ol-radius);
    padding: 18px 16px 0;
    box-shadow: var(--ol-shadow);
    overflow: hidden;
}

/* ── Top row: spacer + percentage labels ── */
.omlife-chart-top {
    display: flex;
    align-items: flex-end;
    gap: 0;
    padding-bottom: 8px;
}
.omlife-pct-spacer {
    flex: 0 0 var(--ol-yaxis-w);
    min-width: var(--ol-yaxis-w);
}
.omlife-pct-row {
    flex: 1;
    display: flex;
    justify-content: space-evenly;
    gap: 8px;
    padding: 0 4px;
}
.omlife-pct-label {
    flex: 1;
    max-width: 100px;
    text-align: center;
    font-family: var(--ol-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1;
}

/* ── Chart body: y-axis + bars side by side ── */
.omlife-chart-body {
    display: flex;
    align-items: stretch;
    gap: 0;
    height: var(--ol-chart-h);
}

/* ── Y-axis ── */
.omlife-y-axis {
    flex: 0 0 var(--ol-yaxis-w);
    min-width: var(--ol-yaxis-w);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 8px 0 0;
    height: 100%;
}
.omlife-y-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--ol-muted);
    line-height: 1;
    letter-spacing: -.01em;
    white-space: nowrap;
}

/* ── Bars wrap — flex row for bars, relative for grid overlay ── */
.omlife-bars-wrap {
    flex: 1;
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
    gap: 8px;
    padding: 0 4px;
    height: 100%;
    position: relative;
}

/* ── Grid lines — absolute overlay ── */
.omlife-grid-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.omlife-grid-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(226, 232, 240, 0.7);
    transform: translateY(50%);
}
.omlife-grid-line--mid {
    background: rgba(196, 181, 253, 0.45);
    height: 1px;
}
.omlife-grid-line--base {
    background: #CBD5E1;
    height: 2px;
}

/* ── Bar column ── */
.omlife-bar-col {
    flex: 1;
    max-width: 100px;
    height: 100%;
    display: flex;
    align-items: flex-end;
    position: relative;
    z-index: 1;
}

/* Track — full height, light bg container */
.omlife-bar-track {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: rgba(241, 245, 249, 0.7);
    border: 1px solid rgba(203, 213, 225, 0.5);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    position: relative;
}

/* ── The solid 3D bar fill ── */
.omlife-bar-fill {
    width: 100%;
    position: relative;
    transition: height 1.1s cubic-bezier(.34, 1.3, .64, 1);
    min-height: 4px;
    flex-shrink: 0;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

/* 3D effect: left highlight strip via ::before, right shadow via ::after */
.omlife-bar-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 22%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,.28) 0%, transparent 100%);
    border-radius: inherit;
    pointer-events: none;
    z-index: 2;
}
.omlife-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 22%;
    height: 100%;
    background: linear-gradient(270deg, rgba(0,0,0,.15) 0%, transparent 100%);
    border-radius: inherit;
    pointer-events: none;
    z-index: 2;
}

/* Solid 3D fills — face gradient top-to-bottom for depth */
.omlife-bar-fill--high {
    background: linear-gradient(180deg,
        #6EF2A0 0%,
        #22C55E 30%,
        #16A34A 70%,
        #166534 100%
    );
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.3),
        0 -4px 16px rgba(34,197,94,.4);
}
.omlife-bar-fill--mid {
    background: linear-gradient(180deg,
        #7DD3FC 0%,
        #0EA5E9 30%,
        #0284C7 70%,
        #075985 100%
    );
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.3),
        0 -4px 16px rgba(14,165,233,.4);
}
.omlife-bar-fill--low {
    background: linear-gradient(180deg,
        #FCA5A5 0%,
        #EF4444 30%,
        #DC2626 70%,
        #991B1B 100%
    );
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,.3),
        0 -4px 16px rgba(239,68,68,.4);
}

/* Hover — brighten glow */
.omlife-bar-col:hover .omlife-bar-fill--high {
    box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 -6px 24px rgba(34,197,94,.6);
    filter: brightness(1.05);
}
.omlife-bar-col:hover .omlife-bar-fill--mid {
    box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 -6px 24px rgba(14,165,233,.6);
    filter: brightness(1.05);
}
.omlife-bar-col:hover .omlife-bar-fill--low {
    box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 -6px 24px rgba(239,68,68,.6);
    filter: brightness(1.05);
}

/* ── Subject labels row (bottom) ── */
.omlife-subject-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-top: 2px solid #E2E8F0;
    margin-top: 0;
}
.omlife-subject-spacer {
    flex: 0 0 var(--ol-yaxis-w);
    min-width: var(--ol-yaxis-w);
}
.omlife-subject-cols {
    flex: 1;
    display: flex;
    justify-content: space-evenly;
    gap: 8px;
    padding: 10px 4px 16px;
}
.omlife-subject-label {
    flex: 1;
    max-width: 100px;
    text-align: center;
    overflow: hidden;
}
.omlife-subject-label__name {
    font-size: 11px;
    font-weight: 700;
    color: var(--ol-slate-2);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 2px;
}
.omlife-subject-label__code {
    font-size: 10px;
    color: var(--ol-violet);
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.omlife-subject-label__date {
    font-size: 10px;
    color: var(--ol-muted);
    display: block;
}

/* Legend */
.omlife-legend { display:flex; flex-wrap:wrap; gap:14px; margin-top:14px; padding:11px 14px; background:var(--ol-frost); border:1px solid var(--ol-border); border-radius:12px; }
.omlife-legend__item { font-size:12px; font-weight:600; }
.omlife-legend__item--high { color:var(--ol-green); }
.omlife-legend__item--mid  { color:var(--ol-blue); }
.omlife-legend__item--low  { color:var(--ol-red); }

/* Trend arrows */
.omlife-trend { font-size:10px; margin-left:2px; }
.omlife-trend--up   { color:var(--ol-green); }
.omlife-trend--down { color:var(--ol-red); }

/* PCT colours */
.omlife-pct--high { color:var(--ol-green); }
.omlife-pct--mid  { color:var(--ol-blue); }
.omlife-pct--low  { color:var(--ol-red); }
.omlife-pct--none { color:var(--ol-muted); }

/* All Scores */
.omlife-all-scores { display:flex; flex-direction:column; gap:10px; }
.omlife-score-card { display:flex; align-items:center; gap:14px; background:var(--ol-frost); border:1.5px solid var(--ol-border); border-radius:var(--ol-radius-sm); padding:16px 18px; transition:transform .18s, box-shadow .18s; }
.omlife-score-card:hover { transform:translateY(-2px); box-shadow:var(--ol-shadow); }
.omlife-score-card--high { border-left:4px solid #22C55E; }
.omlife-score-card--mid  { border-left:4px solid #0EA5E9; }
.omlife-score-card--low  { border-left:4px solid #EF4444; }
.omlife-score-card__left { display:flex; flex-direction:column; align-items:center; gap:6px; min-width:30px; }
.omlife-score-card__num { font-size:12px; font-weight:700; color:var(--ol-muted); }
.omlife-bar-mini-fill { width:4px; height:44px; border-radius:4px; background:var(--ol-border); position:relative; overflow:hidden; }
.omlife-bar-mini-fill::after { content:''; position:absolute; bottom:0; left:0; right:0; height:var(--pct,50%); border-radius:inherit; }
.omlife-bar-mini-fill--high::after { background:linear-gradient(180deg,#4ADE80,#16A34A); }
.omlife-bar-mini-fill--mid::after  { background:linear-gradient(180deg,#38BDF8,#0284C7); }
.omlife-bar-mini-fill--low::after  { background:linear-gradient(180deg,#F87171,#DC2626); }
.omlife-score-card__body { flex:1; min-width:0; }
.omlife-score-card__subject { font-size:14.5px; font-weight:700; color:var(--ol-slate); margin-bottom:6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.omlife-score-card__meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.omlife-score-card__date { font-size:12px; color:var(--ol-muted); }
.omlife-score-card__right { flex-shrink:0; text-align:right; }
.omlife-score-card__pct { font-family:var(--ol-display); font-size:24px; font-weight:800; letter-spacing:-.03em; }

/* Badge */
.omlife-badge { display:inline-block; font-size:11px; font-weight:700; letter-spacing:.04em; padding:2px 9px; border-radius:100px; background:var(--ol-violet-lt); color:var(--ol-violet-dk); }
.omlife-badge--count { background:var(--ol-violet); color:#fff; }

/* Pagination */
.omlife-pagination { display:flex; flex-wrap:wrap; gap:6px; justify-content:center; margin-top:24px; }
.omlife-page-btn { display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:8px; font-size:13px; font-weight:700; border:1.5px solid var(--ol-border); color:var(--ol-slate); text-decoration:none; transition:all .18s; }
.omlife-page-btn:hover { border-color:var(--ol-violet); color:var(--ol-violet); }
.omlife-page-btn--active { background:var(--ol-violet); border-color:var(--ol-violet); color:#fff; box-shadow:0 2px 10px rgba(124,58,237,.4); }

/* Ranking */
.omlife-group-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.omlife-group-tab { padding:8px 18px; border-radius:100px; font-size:13px; font-weight:600; color:var(--ol-muted); border:1.5px solid var(--ol-border); text-decoration:none; transition:all .18s; }
.omlife-group-tab:hover { color:var(--ol-violet); border-color:var(--ol-violet); }
.omlife-group-tab--active { background:var(--ol-violet); border-color:var(--ol-violet); color:#fff; }

.omlife-info-banner { display:flex; align-items:center; gap:8px; background:var(--ol-violet-lt); border:1px solid #C4B5FD; border-radius:8px; padding:10px 14px; font-size:13px; color:var(--ol-violet-dk); font-weight:500; margin-bottom:14px; }
.omlife-info-banner__icon { font-size:16px; }
.omlife-info-banner strong { font-weight:700; }

.omlife-ranking { display:flex; flex-direction:column; gap:9px; }
.omlife-rank-row { display:flex; align-items:center; gap:14px; padding:15px 18px; border-radius:var(--ol-radius-sm); background:var(--ol-frost); border:1.5px solid var(--ol-border); transition:transform .18s, box-shadow .18s; }
.omlife-rank-row:hover { transform:translateY(-2px); box-shadow:var(--ol-shadow); }
.omlife-rank-row--me { background:var(--ol-violet-lt); border-color:var(--ol-violet-md); box-shadow:0 0 0 2px rgba(124,58,237,.18); }
.omlife-rank-row__rank { min-width:44px; text-align:center; flex-shrink:0; }
.omlife-medal { font-size:30px; }
.omlife-rank-num { font-family:var(--ol-display); font-size:15px; font-weight:800; color:var(--ol-muted); }
.omlife-rank-row__name { flex:1; min-width:0; font-size:14.5px; font-weight:700; color:var(--ol-slate); }
.omlife-rank-row__subject { font-size:12px; color:var(--ol-muted); font-weight:400; margin-top:3px; }
.omlife-you-tag { display:inline-block; font-size:10px; font-weight:800; letter-spacing:.06em; background:var(--ol-violet); color:#fff; padding:2px 8px; border-radius:100px; margin-left:8px; vertical-align:middle; }
.omlife-rank-row__right { flex-shrink:0; text-align:right; min-width:100px; }
.omlife-rank-pct { font-family:var(--ol-display); font-size:22px; font-weight:800; letter-spacing:-.02em; }
.omlife-rank-bar { height:5px; background:var(--ol-border); border-radius:100px; overflow:hidden; margin:5px 0; }
.omlife-rank-bar__fill { height:100%; border-radius:100px; transition:width 1.2s ease; }
.omlife-rank-row__date { font-size:11px; color:var(--ol-muted); }

/* Empty State */
.omlife-empty-state { text-align:center; padding:64px 24px; background:var(--ol-frost); border:1.5px dashed var(--ol-border); border-radius:var(--ol-radius); }
.omlife-empty-state__icon { font-size:52px; margin-bottom:16px; }
.omlife-empty-state h3 { font-family:var(--ol-display); font-size:20px; font-weight:700; margin-bottom:8px; }
.omlife-empty-state p { color:var(--ol-muted); font-size:14px; }

/* Footer */
.omlife-footer { text-align:center; margin-top:44px; font-size:12px; color:var(--ol-muted); padding-top:16px; border-top:1px solid var(--ol-border); }

/* Button */
.omlife-btn { display:inline-block; padding:12px 28px; background:var(--ol-violet); color:#fff; border-radius:10px; font-size:14px; font-weight:700; text-decoration:none; transition:background .2s,transform .2s,box-shadow .2s; box-shadow:0 2px 12px rgba(124,58,237,.35); }
.omlife-btn:hover { background:var(--ol-violet-dk); transform:translateY(-1px); box-shadow:0 4px 20px rgba(124,58,237,.5); color:#fff; text-decoration:none; }

/* Responsive */
@media (max-width:640px) {
    .omlife-wrap { padding:16px 14px 40px; }
    .omlife-header { padding:20px; gap:14px; }
    .omlife-header__name { font-size:26px; }
    .omlife-stat-ring { width:64px; height:64px; }
    .omlife-circular-chart { width:64px; height:64px; }
    .omlife-bars-wrap { height:180px; }
    :root { --ol-chart-h:180px; --ol-yaxis-w:36px; }
    .omlife-bars-row { gap:5px; }
    .omlife-pct-label { font-size:11px; }
    .omlife-y-label { font-size:9px; }
    .omlife-subject-label__name { font-size:9px; }
    .omlife-score-card { padding:12px 14px; gap:10px; }
    .omlife-score-card__pct { font-size:20px; }
    .omlife-rank-row { padding:12px 14px; }
    .omlife-rank-pct { font-size:18px; }
    .omlife-rank-row__right { min-width:80px; }
    .omlife-tabs { gap:3px; padding:4px; }
    .omlife-tab { padding:9px 10px; font-size:12px; }
}
@media (max-width:400px) {
    .omlife-header__name { font-size:22px; }
    :root { --ol-chart-h:160px; --ol-yaxis-w:30px; }
    .omlife-y-label { font-size:8px; }
    .omlife-bars-wrap { height:160px; }
}

/* Rank footnote */
.omlife-rank-footnote {
    margin-top: 14px;
    padding: 10px 16px;
    background: var(--ol-violet-lt);
    border: 1px solid #C4B5FD;
    border-radius: 8px;
    font-size: 12px;
    color: var(--ol-violet-dk);
    font-weight: 500;
    text-align: center;
    font-style: italic;
}

