/* LAP-A Health Tracker - Stylesheet */
/* Save as: assets/style.css */

/* v1.30 - STYLESHEET MAP (read before editing any rule here)
   The plugin's front-end styling now lives in exactly two files, with no
   selector+property pair defined in both:

   - assets/style.css (this file): palette tokens (:root), the login
     screen, error messages, and every component rule the old inline
     block in shortcodes.php never touched. Loaded in <head> on every
     front-end page, exactly as before.

   - assets/dashboard.css: the rules that used to sit in the inline
     <style> block of shortcodes.php, moved verbatim. Printed by the
     shortcode itself, only on the logged-in dashboard, at the same
     point in the cascade as the old inline block (after all <head> CSS),
     so it still wins every tie it used to win.

   Before v1.30, 74 declarations in this file were silently overridden by
   that inline block and never rendered - editing them did nothing. They
   were removed here (zero visual change, since they never applied); the
   value that actually renders is the one in dashboard.css. If a rule you
   are looking for isn't here, it is in dashboard.css.

   Three selectors are deliberately still defined in both files:
   .lap-a-dashboard, .lap-a-container and .lap-a-error. They also render
   on the login screen and on the shortcode's early error returns, where
   dashboard.css is not loaded - so this file's values are what those
   screens show, and dashboard.css's values are what the dashboard shows.
   Colours there use the :root tokens below, so a palette change in
   :root still reaches both. */

* {
    box-sizing: border-box;
}

/* v1.21: Apple Health-style palette - a warm red/pink accent (matching
   the Health app's own branding) on a soft grey "grouped" background,
   white rounded cards, and generous corner radii throughout. Every
   existing component keeps its markup/classes; only these tokens and
   the handful of rules below it changed, so nothing that already
   worked (forms, AJAX, offline queue, etc.) is touched.

   v1.25: re-tuned to match the approved Home/Vitals/Medications/Labs/
   Share mockups exactly - --primary-color moves from the previous
   cerise (#ff375f) to the mockup's true systemRed (#ff3b30), and the
   mockup's full multi-accent palette (green/blue/purple/orange/indigo/
   cyan, plus the darker red/amber used for "high"/"borderline" lab
   flags) is added as named tokens so the new Home dashboard and Share
   cards can use the same per-section colors the mockup does, without
   hard-coding hex values throughout the markup. */
:root {
    --primary-color: #ff3b30;
    --primary-dark: #d70015;
    --navy: #1c1c1e;
    --light-bg: #f2f2f7;
    --border-color: #e5e5ea;
    --text-color: #1c1c1e;
    --text-light: #8e8e93;
    --card-bg: #ffffff;
    --card-radius: 14px;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08);
    /* Mockup's named accents (v1.25) */
    --accent-red: #ff3b30;
    --accent-red-dark: #d70015;
    --accent-green: #34c759;
    --accent-blue: #007aff;
    --accent-purple: #af52de;
    --accent-orange: #ff9500;
    --accent-amber-dark: #b25000;
    --accent-indigo: #5856d6;
    --accent-cyan: #5ac8fa;
}

.lap-a-dashboard {
    padding: 20px;
    background: var(--light-bg);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.lap-a-container {
    max-width: 1100px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: 30px;
}

/* Leaves room at the bottom of the page for the fixed mobile tab bar
   (see .lap-a-bottom-tabs below) so the last section's content isn't
   hidden behind it. */
@media (max-width: 768px) {
    .lap-a-container {
        padding-bottom: 90px;
    }
}

.lap-a-container h1 {
    color: var(--navy);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.lap-a-container h2 {
    color: var(--primary-color);
    margin-top: 35px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}

.lap-a-container h3 {
    color: var(--text-color);
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 15px;
}

/* Tabs */

.lap-a-tab-btn {
    transition: all 0.3s ease;
}

.lap-a-tab-btn:hover {
    color: var(--primary-color);
}

.lap-a-tab-content {
    animation: fadeIn 0.3s ease;
}

/* Mobile bottom tab bar (v1.21) - hidden on desktop; on narrow screens
   it replaces the top tab row (which is hidden instead, in the media
   query further down) with a fixed, icon-led bar like the Health app's
   own tab bar. Shares .lap-a-tab-btn with the top row, so the same
   click handlers (shortcodes.php inline script + assets/script.js)
   drive both without any extra JS. */
.lap-a-bottom-tabs {
    display: none;
}

@media (max-width: 768px) {
    .lap-a-bottom-tabs {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 500;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--border-color);
        padding: 6px 2px calc(6px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.05);
    }

    .lap-a-bottom-tabs .lap-a-tab-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        background: none;
        border: none;
        border-bottom: none;
        padding: 4px 2px;
        color: var(--text-light);
        font-size: 11px;
        font-weight: 500;
        line-height: 1.2;
    }

    .lap-a-bottom-tabs .lap-a-tab-btn.active {
        color: var(--primary-color);
    }

    .lap-a-bottom-tab-icon {
        font-size: 19px;
        line-height: 1;
    }

    .lap-a-bottom-tab-label {
        white-space: nowrap;
    }

    /* The top tab row becomes the mobile bottom bar instead - avoids
       showing the same six section names twice on a small screen. */
    .lap-a-dashboard > .lap-a-container > .lap-a-tabs {
        display: none;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forms */

.lap-a-form-group label {
    font-size: 14px;
}

.lap-a-form-group input,
.lap-a-form-group textarea,
.lap-a-form-group select {
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.lap-a-form-group input:focus,
.lap-a-form-group textarea:focus,
.lap-a-form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.lap-a-form-section {
    border-left: 4px solid var(--primary-color);
}

.lap-a-form-section h3 {
    margin-top: 0;
    color: var(--navy);
}

.lap-a-bp-row span {
    font-weight: 600;
    min-width: 15px;
    text-align: center;
}

/* Buttons */
.lap-a-btn {
    transition: background 0.2s ease, transform 0.1s ease;
}

.lap-a-btn:active {
    transform: scale(0.97);
}

.lap-a-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.lap-a-error {
    color: #721c24;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 20px;
}

.lap-a-success {
    border: 1px solid #c3e6cb;
}

/* Data Lists */
.lap-a-readings-list,
.lap-a-events-list,
.lap-a-med-log {
    max-height: 400px;
    overflow-y: auto;
}

.lap-a-reading-item,
.lap-a-event-item,
.lap-a-med-item {
    padding: 15px;
    background: white;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.lap-a-reading-time,
.lap-a-event-type {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 15px;
}

.lap-a-reading-data {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.lap-a-data-point {
    font-size: 13px;
}

.lap-a-data-label {
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 3px;
}

.lap-a-data-value {
    color: var(--navy);
    font-size: 18px;
    font-weight: 600;
}

/* Medication Era Display */

.lap-a-med-era-display div {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

thead th {
    background: var(--navy);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
}

tbody tr:nth-child(even) {
    background: #f9f9f9;
}

tbody tr:hover {
    background: #f0f7ff;
}

/* Responsive */
@media (max-width: 600px) {
    .lap-a-container {
        padding: 15px;
    }

    .lap-a-reading-data {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }
}

/* Print Styles */
@media print {
    .lap-a-form,
    .lap-a-btn {
        display: none;
    }

    body {
        background: white;
    }

    .lap-a-container {
        box-shadow: none;
        padding: 0;
    }
}

/* Offline / sync status banner (created dynamically by script.js) */
.lap-a-offline-banner {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.lap-a-offline-banner-offline {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.lap-a-offline-banner-syncing {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Logged-out login box (v1.23) - shown in place of the dashboard
   when is_user_logged_in() is false, instead of a plain text
   message. Wraps WordPress's own wp_login_form() output, so the
   input/label/button markup below is core's default login form
   markup (unchanged classes/ids), just restyled to match the rest
   of the plugin. */
.lap-a-login-container {
    display: flex;
    justify-content: center;
}

.lap-a-login-box {
    width: 100%;
    max-width: 380px;
    padding: 20px 0 10px;
    text-align: center;
}

.lap-a-login-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.lap-a-login-title {
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--navy, #1c1c1e);
    border-left: none;
    padding-left: 0;
}

.lap-a-login-subtitle {
    color: var(--text-light, #8e8e93);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.lap-a-login-box form {
    text-align: left;
}

.lap-a-login-box p.login-username,
.lap-a-login-box p.login-password {
    margin-bottom: 16px;
}

.lap-a-login-box p.login-username label,
.lap-a-login-box p.login-password label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-color, #1c1c1e);
    font-size: 14px;
}

.lap-a-login-box input.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #e5e5ea);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.lap-a-login-box input.input:focus {
    outline: none;
    border-color: var(--primary-color, #ff3b30);
    box-shadow: 0 0 0 3px rgba(255, 55, 95, 0.12);
}

.lap-a-login-box p.login-remember {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-color, #1c1c1e);
    font-weight: normal;
}

.lap-a-login-box p.login-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.lap-a-login-box p.login-submit {
    margin-bottom: 0;
}

.lap-a-login-box input#lap_a_login_submit {
    width: 100%;
    background: var(--primary-color, #ff3b30);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

.lap-a-login-box input#lap_a_login_submit:hover {
    background: var(--primary-dark, #d70015);
}

.lap-a-login-box input#lap_a_login_submit:active {
    transform: scale(0.98);
}

.lap-a-login-forgot {
    margin-top: 18px;
    font-size: 13px;
}

.lap-a-login-forgot a {
    color: var(--text-light, #8e8e93);
    text-decoration: none;
}

.lap-a-login-forgot a:hover {
    color: var(--primary-color, #ff3b30);
    text-decoration: underline;
}

/* =================================================================
   v1.25: HOME DASHBOARD + per-tab nav accents + restyled SHARE tab,
   built to match the approved Home/Vitals/Medications/Labs/Share
   mockups. Nothing here changes the Vitals/Medications/Lab Results
   tabs' own forms, filters or history lists - those keep their exact
   existing markup and behavior, just inherit the new --primary-color
   above; this block is additive (the new Home tab, the nav's per-tab
   colors, and the new cards inside the Share tab).
   ================================================================= */

/* Bottom + top nav: each of the 5 sections gets its own accent when
   active, matching the mockup (Home/Vitals red, Meds green, Labs
   blue, Share purple), instead of every tab sharing one color. */
.lap-a-tab-btn[data-tab="home"].active,
.lap-a-tab-btn[data-tab="vitals"].active {
    color: var(--accent-red, #ff3b30);
    border-bottom-color: var(--accent-red, #ff3b30);
}
.lap-a-tab-btn[data-tab="medications"].active {
    color: var(--accent-green, #34c759);
    border-bottom-color: var(--accent-green, #34c759);
}
.lap-a-tab-btn[data-tab="lab-results"].active {
    color: var(--accent-blue, #007aff);
    border-bottom-color: var(--accent-blue, #007aff);
}
.lap-a-tab-btn[data-tab="report"].active {
    color: var(--accent-purple, #af52de);
    border-bottom-color: var(--accent-purple, #af52de);
}
.lap-a-bottom-tabs .lap-a-tab-btn[data-tab="home"].active,
.lap-a-bottom-tabs .lap-a-tab-btn[data-tab="vitals"].active {
    color: var(--accent-red, #ff3b30);
}
.lap-a-bottom-tabs .lap-a-tab-btn[data-tab="medications"].active {
    color: var(--accent-green, #34c759);
}
.lap-a-bottom-tabs .lap-a-tab-btn[data-tab="lab-results"].active {
    color: var(--accent-blue, #007aff);
}
.lap-a-bottom-tabs .lap-a-tab-btn[data-tab="report"].active {
    color: var(--accent-purple, #af52de);
}
.lap-a-bottom-tab-icon svg {
    display: block;
}

/* Home dashboard greeting + cards */
.lap-a-home-date {
    font-size: 13px;
    color: var(--text-light, #8e8e93);
    font-weight: 500;
}
.lap-a-home-greeting-text {
    font-size: 26px;
    font-weight: 700;
    margin-top: 2px;
    letter-spacing: -0.3px;
    color: var(--navy, #1c1c1e);
}
.lap-a-home-card {
    background: var(--card-bg, #fff);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: var(--card-shadow, 0 1px 3px rgba(0,0,0,0.06));
    margin-bottom: 14px;
}
.lap-a-home-card-link-card {
    cursor: pointer;
}
.lap-a-home-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.lap-a-home-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy, #1c1c1e);
}
.lap-a-home-card-link {
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
.lap-a-home-med-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
}
.lap-a-home-med-row:not(:last-child) {
    border-bottom: 1px solid var(--light-bg, #f2f2f7);
}
.lap-a-home-med-check {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lap-a-home-med-check.done {
    background: var(--accent-green, #34c759);
}
.lap-a-home-med-check.pending {
    border: 2px solid var(--border-color, #e5e5ea);
}
.lap-a-home-med-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--navy, #1c1c1e);
}
.lap-a-home-med-sub {
    font-size: 12px;
    color: var(--text-light, #8e8e93);
}
.lap-a-home-med-log-btn {
    background: var(--light-bg, #f2f2f7);
    border: none;
    border-radius: 14px;
    padding: 6px 13px;
    font-size: 12px;
    font-weight: 600;
    color: var(--navy, #1c1c1e);
    cursor: pointer;
    flex-shrink: 0;
}
.lap-a-home-vitals-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.lap-a-home-vitals-grid-label {
    font-size: 12px;
    color: var(--text-light, #8e8e93);
}
.lap-a-home-vitals-grid-value {
    font-size: 19px;
    font-weight: 700;
    margin-top: 1px;
}
.lap-a-home-vitals-grid-unit {
    font-size: 11px;
    color: var(--text-light, #8e8e93);
}
.lap-a-home-weight-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}
.lap-a-home-weight-value {
    font-size: 25px;
    font-weight: 700;
}
.lap-a-home-weight-unit {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-light, #8e8e93);
}
.lap-a-home-weight-sub {
    font-size: 12px;
    color: var(--text-light, #8e8e93);
    margin-top: 2px;
    max-width: 190px;
}
.lap-a-home-lab-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.lap-a-home-lab-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--navy, #1c1c1e);
}
.lap-a-home-lab-sub {
    font-size: 12px;
    color: var(--text-light, #8e8e93);
}
.lap-a-home-lab-flag {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
}
.lap-a-home-lab-flag-normal { background: #e8f8ec; color: #1a7a38; }
.lap-a-home-lab-flag-borderline { background: #fff4e5; color: var(--accent-amber-dark, #b25000); }
.lap-a-home-lab-flag-high, .lap-a-home-lab-flag-low { background: #fde2e1; color: var(--accent-red-dark, #d70015); }
.lap-a-home-event-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}
.lap-a-home-event-desc {
    font-size: 13px;
    color: var(--text-light, #8e8e93);
    margin-top: 3px;
}
.lap-a-home-empty {
    font-size: 13px;
    color: var(--text-light, #8e8e93);
}
.lap-a-home-share-cta {
    background: linear-gradient(135deg, var(--accent-purple, #af52de), var(--accent-indigo, #5856d6));
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}
.lap-a-home-share-cta-icon {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background: rgba(255,255,255,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lap-a-home-share-cta-title {
    font-size: 15px;
    font-weight: 600;
}
.lap-a-home-share-cta-sub {
    font-size: 12px;
    opacity: 0.9;
}

/* Share tab (v1.25) - restyled into cards matching the mockup: the
   "Include in report" checklist, two action cards (email/print,
   AI-ready export), the Documents section moved here from its own
   former tab, and the "Recent reports" log. The Email Recipients
   manager and the underlying report/print/AI/upload functions are
   unchanged - only their container markup/classes are new. */
.lap-a-share-checklist label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: normal;
    color: var(--text-color, #1c1c1e);
    padding: 5px 0;
}
.lap-a-share-checklist input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-green, #34c759);
}
.lap-a-share-period-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--light-bg, #f2f2f7);
    font-size: 13px;
}
.lap-a-share-action-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.lap-a-share-action-icon {
    width: 38px;
    height: 38px;
    border-radius: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lap-a-share-action-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy, #1c1c1e);
}
.lap-a-share-action-sub {
    font-size: 12px;
    color: var(--text-light, #8e8e93);
}
.lap-a-share-action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.lap-a-share-action-buttons .lap-a-btn {
    flex: 1;
    min-width: 140px;
}
.lap-a-share-ai-note {
    font-size: 11px;
    color: var(--text-light, #8e8e93);
    margin-top: 10px;
    background: #f9f4fd;
    border-radius: 8px;
    padding: 8px 10px;
}
.lap-a-report-log-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.lap-a-report-log-icon {
    width: 30px;
    height: 30px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lap-a-report-log-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--navy, #1c1c1e);
}
.lap-a-report-log-date {
    font-size: 11px;
    color: var(--text-light, #8e8e93);
}

@media (max-width: 480px) {
    .lap-a-home-vitals-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
}
