/*
 * report-selfcare.css — MyBest24 Self-Care Panel Styles
 *
 * Mirrors report-fitness.css exactly. All class names use .selfcare-* prefix.
 * Shares .report-tab-bar / .report-tab from report-food.css (no redefinition needed).
 * Shares .stage-* structural classes from stage.css.
 *
 * Panel min-height rule: stage.css sets max-height:70vh. The matching min-height
 * keeps the panel top anchored when daily content is sparse (rest day, empty state).
 * Same fix as #fitness-panel and #food-panel. See fitness.md Key Invariants.
 *
 * Load after stage.css and report-fitness.css in index.html:
 *   <link rel="stylesheet" href="report-selfcare.css">
 */


/* ── Panel body ───────────────────────────────────────────────────────────────── */

/* stage.css sets max-height:70vh — match as min-height so panel top stays
   anchored when content is sparse (rest day, empty state). dvh = iOS Safari fix. */
#selfcare-panel .stage-panel-body {
    padding-bottom: 56px;
    min-height: 70vh;
    min-height: 70dvh;
}


/* ── Daily: ring row ──────────────────────────────────────────────────────────── */

.selfcare-ring-row {
    display: flex;
    justify-content: center;
    padding: 16px 0 8px;
}

/* Ring size override: 80px — matches .fitness-main-ring-cell and stage expanded mode. */
.selfcare-main-ring-cell .stage-ring-wrap  { width: 80px; height: 80px; }
.selfcare-main-ring-cell .stage-ring-svg   { width: 80px; height: 80px; }
.selfcare-main-ring-cell .stage-ring-icon  { width: 32px; height: 32px; }
.selfcare-main-ring-cell .stage-ring-hours { font-size: 1rem; font-weight: 700; }
.selfcare-main-ring-cell .stage-ring-label { font-size: 0.75rem; }

.selfcare-ring-done-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-color);
    text-align: center;
    margin-top: 2px;
}


/* ── Empty state ──────────────────────────────────────────────────────────────── */

.selfcare-empty-state { padding: 14px 0 6px; }
.selfcare-empty-text  { font-size: 0.88rem; color: var(--text-muted, rgba(255,255,255,0.5)); margin: 0; }


/* ── ─────────────────────────────────────────────────────────────────────────── ──
   2-COLUMN ACTIVITY LAYOUT
   Copied from report-fitness.css (.fitness-exercise-row pattern).
   ── ─────────────────────────────────────────────────────────────────────────── */

.selfcare-activities-list { display: flex; flex-direction: column; }

.selfcare-activity-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.selfcare-activity-row:first-child { border-top: none; }

.selfcare-activity-icon-col {
    display: flex;
    flex-shrink: 0;
    width: 64px;
    align-items: flex-start;
    justify-content: center;
}

.selfcare-activity-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.selfcare-activity-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.selfcare-section-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main, #fff);
    line-height: 1.2;
    overflow-wrap: break-word;
    word-break: break-word;
}

.selfcare-section-time {
    font-size: 0.72rem;
    color: var(--text-muted, rgba(255,255,255,0.5));
}

.selfcare-section-duration {
    font-size: 0.75rem;
    color: var(--text-muted, rgba(255,255,255,0.5));
    white-space: nowrap;
    flex-shrink: 0;
}


/* ── Progress bar ─────────────────────────────────────────────────────────────── */

.selfcare-progress-wrap  { display: flex; align-items: center; gap: 8px; }
.selfcare-progress-track { flex: 1; height: 5px; background: rgba(255,255,255,0.10); border-radius: 3px; overflow: hidden; }
.selfcare-progress-fill  {
    height: 100%; background: var(--accent-color); border-radius: 3px;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.selfcare-progress-fill--pulse { animation: selfcarePulse 2s ease-in-out infinite; }
@keyframes selfcarePulse { 0%,100% { opacity:1; } 50% { opacity:0.45; } }
@media (prefers-reduced-motion: reduce) {
    .selfcare-progress-fill { transition: none; }
    .selfcare-progress-fill--pulse { animation: none; }
}
.selfcare-progress-label { font-size: 0.71rem; color: var(--text-muted, rgba(255,255,255,0.5)); white-space: nowrap; flex-shrink: 0; }


/* ── Goal / Log sub-blocks ────────────────────────────────────────────────────── */

.selfcare-section-block     { display: flex; flex-direction: column; gap: 5px; }
.selfcare-section-sub-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted, rgba(255,255,255,0.45)); }
.selfcare-goal-pills        { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.selfcare-goal-pill         { display: inline-flex; align-items: center; background: color-mix(in srgb, var(--accent-color, #46a5ce) 16%, transparent); border: 1px solid var(--accent-color, #46a5ce); color: var(--accent-color, #46a5ce); border-radius: 16px; padding: 3px 9px; font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.selfcare-goal-pill--default { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.18); color: var(--text-muted, rgba(255,255,255,0.45)); font-style: italic; }
.selfcare-goal-last-session  { font-size: 0.63rem; color: var(--text-muted, rgba(255,255,255,0.35)); font-style: italic; }
.selfcare-log-list  { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.selfcare-log-entry { font-size: 0.78rem; color: var(--text-muted, rgba(255,255,255,0.6)); line-height: 1.4; }
.selfcare-log-more  { font-size: 0.72rem; color: var(--accent-color); list-style: none; }


/* ── Weekly horizontal bar chart ──────────────────────────────────────────────── */
/* Each row: [day label 44px] | [bar + icons below, flex:1] | [duration 54px]      */

.selfcare-hbar-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0 6px;
}

.selfcare-hbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selfcare-hbar-label {
    flex-shrink: 0;
    width: 44px;
    font-size: 0.72rem;
    color: var(--text-muted, rgba(255,255,255,0.6));
    text-align: right;
    line-height: 1.2;
}

.selfcare-hbar-row--today .selfcare-hbar-label {
    color: var(--accent-color);
    font-weight: 700;
}

.selfcare-hbar-center {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.selfcare-hbar-track {
    height: 18px;
    background: color-mix(in srgb, var(--accent-color) 14%, transparent);
    border-radius: 5px;
    overflow: hidden;
}

.selfcare-hbar-track--empty {
    border: 1px solid color-mix(in srgb, var(--accent-color) 30%, transparent);
    background: transparent;
    overflow: visible;
}

.selfcare-hbar-row--today .selfcare-hbar-track:not(.selfcare-hbar-track--empty) {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-color) 60%, transparent);
}

.selfcare-hbar-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 5px;
    transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.selfcare-hbar-fill--over {
    background: color-mix(in srgb, var(--accent-color) 55%, white);
}

@media (prefers-reduced-motion: reduce) { .selfcare-hbar-fill { transition: none; } }

.selfcare-hbar-icons {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center; /* centers REST DAY + multi-icon rows at same midpoint */
    flex-wrap: nowrap;
}

.selfcare-hbar-icon      { image-rendering: pixelated; flex-shrink: 0; display: block; }
.selfcare-hbar-icon-more { font-size: 0.7rem; color: var(--text-muted, rgba(255,255,255,0.5)); line-height: 1; }

.selfcare-hbar-duration {
    flex-shrink: 0;
    width: 54px;
    font-size: 0.72rem;
    color: var(--text-muted, rgba(255,255,255,0.6));
    text-align: right;
    white-space: nowrap;
    line-height: 1.3;
}

.selfcare-hbar-over {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-color);
}


/* ── Weekly day list ──────────────────────────────────────────────────────────── */

.selfcare-week-list       { display: flex; flex-direction: column; margin-top: 16px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.selfcare-week-day        { border-top: 1px solid rgba(255,255,255,0.07); }
.selfcare-week-day-header { display: flex; align-items: center; width: 100%; padding: 11px 0; background: none; border: none; cursor: pointer; gap: 8px; color: var(--text-main, #fff); text-align: left; -webkit-tap-highlight-color: transparent; }
.selfcare-week-day-label  { flex: 1; font-size: 0.85rem; font-weight: 600; }
.selfcare-week-day-total  { font-size: 0.78rem; color: var(--text-muted, rgba(255,255,255,0.5)); flex-shrink: 0; }
.selfcare-week-day-chevron { font-size: 1.8rem; line-height: 1; color: var(--text-muted, rgba(255,255,255,0.4)); transition: transform 0.18s; flex-shrink: 0; padding: 0 4px; }
.selfcare-week-day-header[aria-expanded="true"]  .selfcare-week-day-chevron { transform: rotate(180deg); }
.selfcare-week-day-header[aria-expanded="false"] + .selfcare-week-day-body  { display: none; }
.selfcare-week-day-body   { padding-bottom: 12px; }
.selfcare-rest-day        { font-size: 0.82rem; color: var(--text-muted, rgba(255,255,255,0.4)); font-style: italic; padding: 6px 0; }


/* ── Multicolor: self-care icons in panel ─────────────────────────────────────── */
/* SELF_CARE icons are NOT inside .hour-block[data-type], so --icon-type-filter
   is not inherited. Explicit override required — same fix as fitness panel.      */
body.mode-multicolor #selfcare-panel .selfcare-activity-icon,
body.mode-multicolor #selfcare-panel .selfcare-hbar-icon {
    filter: var(--filter-type-self-care, var(--icon-accent-filter)) !important;
}


/* ── Mobile ───────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .selfcare-activity-icon-col { width: 52px; }
    .selfcare-section-label     { font-size: 0.84rem; }
    .selfcare-goal-pill         { font-size: 0.72rem; }
}
