/* evecareswellness/styles.css
   Minimal custom layout on top of Bootstrap 5.

   Theme: colors live as CSS variables under :root (default = sultry_eve,
   warm/pink) with an override block for body[data-theme="nurse_friend"]
   (cool dark mode, no pink/hearts). Pages set data-theme server-side from
   WellnessSettings.PersonaType so the right theme renders on first paint,
   no flash. settings.php also toggles it live via JS for preview before
   Save. */

:root {
    --bg: #fff8fb;
    --header-bg: #ffd6e6;
    --header-border: #f4a6c1;
    --accent: #8a2948;
    --accent-rgb: 233, 30, 99;
    --accent-strong: #e91e63;
    --divider: #e6c8d6;
    --divider-light: #f4d7e3;
    --panel-bg: #fff;
    --panel-bg-alt: #fff8fb;
    --text-primary: #333;
    --text-secondary: #555;
    --msg-user-bg: #cfe4ff;
    --msg-user-text: #0d2d4d;
    --msg-eve-bg: #ffd1e4;
    --msg-eve-text: #3b1020;
    --msg-eve-border: #f3b8d1;
    --pre-bg: #faf5f8;
    --pre-border: #f0dce6;
}

body[data-theme="nurse_friend"] {
    --bg: #0f1720;
    --header-bg: #16222e;
    --header-border: #27394a;
    --accent: #6fc3d6;
    --accent-rgb: 95, 179, 199;
    --accent-strong: #2f8ba3;
    --divider: #27394a;
    --divider-light: #1e2c3a;
    --panel-bg: #121b24;
    --panel-bg-alt: #0f1720;
    --text-primary: #dde6ec;
    --text-secondary: #9fb3c0;
    --msg-user-bg: #2a4a5e;
    --msg-user-text: #e4f2f7;
    --msg-eve-bg: #1c2b36;
    --msg-eve-text: #d7e6ec;
    --msg-eve-border: #324a5a;
    --pre-bg: #0d151c;
    --pre-border: #243541;
}

html, body { height: 100%; }
body {
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- header ------------------------------------------------------------ */
.wellness-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    flex: 0 0 auto;
}
.wellness-header h1 { color: var(--accent); font-weight: 600; }

/* ---- main layout: transcript | sidebar --------------------------------- */
.wellness-main {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr 280px;
    min-height: 0;
}

.wellness-transcript {
    border-right: 1px solid var(--divider);
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.transcript-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 16px;
}
.wellness-sidebar {
    background: var(--panel-bg);
    padding: 12px 16px;
    overflow-y: auto;
}

.sidebar-section + .sidebar-section { margin-top: 18px; }
.sidebar-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--divider-light);
    padding-bottom: 4px;
}
.summary-list, .active-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
}
.summary-list li, .active-list li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
}
.active-list .active-entry { flex-wrap: wrap; }
.active-list .active-desc { flex: 1 1 auto; color: var(--text-primary); }
.active-list .mark-cleared {
    font-size: 0.75rem;
    padding: 0 4px;
    color: var(--accent);
    text-decoration: underline;
}
.s-label { flex: 1 1 auto; color: var(--text-secondary); }
.s-value { font-weight: 500; color: var(--text-primary); }

/* ---- chat bubbles ------------------------------------------------------ */
.msg { margin-bottom: 10px; max-width: 75%; }
.msg-user { margin-left: auto; text-align: right; }
.msg-eve  { margin-right: auto; }
.msg-who {
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 2px;
}
.msg-body {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 14px;
    white-space: pre-wrap;
    line-height: 1.3;
}
.msg-user .msg-body { background: var(--msg-user-bg); color: var(--msg-user-text); }
.msg-eve  .msg-body { background: var(--msg-eve-bg); color: var(--msg-eve-text); border: 1px solid var(--msg-eve-border); }

/* ---- footer (quick taps + input) -------------------------------------- */
.wellness-footer {
    flex: 0 0 auto;
    border-top: 1px solid var(--divider);
    background: var(--panel-bg);
    padding: 8px 12px;
}
.quick-taps {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.chat-input {
    display: flex;
    gap: 6px;
}
.chat-input input { flex: 1 1 auto; }

/* ---- chip strip (mobile-only toggle) ---------------------------------- */
/* Default (desktop): the toggle is hidden and the body always shows. */
.sidebar-toggle { display: none; }
.sidebar-body   { display: block; }

/* ---- small-screen layout ---------------------------------------------- */
@media (max-width: 720px) {
    /* Swap to flex on mobile so we can reorder sidebar ABOVE the transcript. */
    .wellness-main {
        display: flex;
        flex-direction: column;
    }
    .wellness-sidebar {
        order: 0;
        border-right: none;
        border-bottom: 1px solid var(--divider);
        padding: 0;
        max-height: none;
        overflow: visible;
        background: var(--panel-bg);
    }
    .wellness-transcript {
        order: 1;
        flex: 1 1 auto;
        border-right: none;
        min-height: 0;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 8px 12px;
        background: var(--panel-bg);
        border: 0;
        border-bottom: 1px solid var(--divider-light);
        font-size: 0.85rem;
        text-align: left;
        color: var(--text-primary);
        cursor: pointer;
    }
    .sidebar-toggle:focus { outline: 2px solid var(--header-border); outline-offset: -2px; }

    .strip-chips {
        display: flex;
        flex: 1 1 auto;
        flex-wrap: wrap;
        gap: 6px 10px;
        align-items: center;
    }
    .chip {
        white-space: nowrap;
        font-size: 0.85rem;
    }

    .strip-chevron {
        color: var(--accent);
        transition: transform 0.18s ease;
        font-size: 0.95rem;
    }
    .wellness-sidebar.expanded .strip-chevron {
        transform: rotate(180deg);
    }

    /* Collapsed by default on mobile. */
    .sidebar-body { display: none; padding: 10px 14px 12px; }
    .wellness-sidebar.expanded .sidebar-body { display: block; }

    /* Quick-tap buttons eat too much real estate on phones; hide them here. */
    .quick-taps { display: none; }
}
