/* ==========================================
   Southbound Analytics

   Colors/fonts now come from css/style.css (loaded first on
   every page) — this file only adds Analytics-specific layout.
========================================== */

/* ==========================================
   Base
========================================== */

*{

    margin:0;

    padding:0;

    box-sizing:border-box;

}

body{

    font-family:
        Inter,
        Arial,
        sans-serif;

}

.analytics-page{

    width:min(1650px,95%);

    margin:auto;

    padding:

        40px
        0
        80px;

}

/* ==========================================
   Hero
========================================== */

.hero{

    background:

        linear-gradient(
            135deg,
            #C9AD84,
            #A68A62
        );

    border-radius:28px;

    padding:42px;

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:40px;

    margin-bottom:34px;

    box-shadow:var(--shadow);

}

.hero h1{

    font-size:62px;

    font-weight:800;

    margin-bottom:12px;

}

.hero p{

    font-size:19px;

    max-width:700px;

    opacity:.95;

    line-height:1.7;

}

.hero-right{

    display:grid;

    grid-template-columns:1fr;

    gap:18px;

}

.hero-stat{

    background:

        rgba(255,255,255,.12);

    backdrop-filter:blur(14px);

    border-radius:18px;

    padding:20px 24px;

    min-width:250px;

}

.hero-stat span{

    display:block;

    font-size:14px;

    letter-spacing:.08em;

    text-transform:uppercase;

    opacity:.8;

    margin-bottom:6px;

}

.hero-stat h2{

    font-size:34px;

    font-weight:800;

}
/* ==========================================
   Live Dashboard
========================================== */

.dashboard-grid{

    display:grid;

    grid-template-columns:

        repeat(
            auto-fit,
            minmax(260px,1fr)
        );

    gap:24px;

    margin-bottom:34px;

}

.dashboard-card{

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:var(--radius);

    padding:28px;

    box-shadow:var(--shadow);

    transition:.25s;

    position:relative;

    overflow:hidden;

}

.dashboard-card::before{

    content:"";

    position:absolute;

    left:0;

    top:0;

    width:5px;

    height:100%;

    background:var(--primary);

}

.dashboard-card:hover{

    transform:

        translateY(-5px);

    border-color:

        var(--primary);

}

.dashboard-card span{

    display:block;

    color:var(--muted);

    text-transform:uppercase;

    letter-spacing:.08em;

    font-size:13px;

    margin-bottom:10px;

}

.dashboard-card h2{

    font-size:42px;

    font-weight:800;

    margin-bottom:8px;

    line-height:1;

}

.dashboard-card small{

    color:var(--muted);

    font-size:15px;

    line-height:1.5;

}

/* ==========================================
   Performance Overview
========================================== */

.performance-grid{

    display:grid;

    grid-template-columns:

        repeat(
            4,
            1fr
        );

    gap:24px;

    margin-bottom:34px;

}

.performance-card{

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:var(--radius);

    padding:30px;

    text-align:center;

    box-shadow:var(--shadow);

    transition:.25s;

}

.performance-card:hover{

    transform:

        translateY(-4px);

    border-color:

        var(--primary);

}

.performance-card h3{

    font-size:58px;

    font-weight:800;

    margin-bottom:10px;

}

.performance-card p{

    color:var(--muted);

    font-size:15px;

}

.performance-card.good h3{

    color:var(--green);

}

.performance-card.warning h3{

    color:var(--yellow);

}

.performance-card.alert h3{

    color:var(--red);

}
/* ==========================================
   Analytics Panels
========================================== */

.analytics-grid{

    display:grid;

    grid-template-columns:

        2fr
        1fr;

    gap:28px;

    margin-bottom:34px;

}

.panel{

    background:var(--surface);

    border:1px solid var(--border);

    border-radius:var(--radius);

    padding:28px;

    box-shadow:var(--shadow);

    transition:.25s;

}

.panel:hover{

    border-color:var(--primary);

}

.panel-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:24px;

}

.panel-header h2{

    font-size:28px;

    font-weight:700;

}

.panel-header p{

    color:var(--muted);

    font-size:15px;

}

canvas{

    width:100% !important;

    height:360px !important;

}

/* ==========================================
   AI Insights
========================================== */

.insight-card{

    background:var(--surface-light);

    border-left:5px solid var(--primary);

    border-radius:18px;

    padding:18px 20px;

    margin-bottom:16px;

    transition:.2s;

}

.insight-card:hover{

    transform:translateX(4px);

}

.insight-card h4{

    margin-bottom:8px;

    font-size:17px;

}

.insight-card p{

    color:var(--muted);

    line-height:1.6;

    font-size:15px;

}

/* ==========================================
   Personal Records
========================================== */

.records-grid{

    display:grid;

    grid-template-columns:

        repeat(
            auto-fit,
            minmax(180px,1fr)
        );

    gap:20px;

}

.record{

    background:var(--surface-light);

    border-radius:20px;

    padding:24px;

    text-align:center;

    transition:.25s;

}

.record:hover{

    transform:

        translateY(-4px);

    background:#2E4A3A;

}

.record span{

    display:block;

    color:var(--muted);

    margin-bottom:10px;

    font-size:14px;

    text-transform:uppercase;

    letter-spacing:.08em;

}

.record h3{

    font-size:34px;

    font-weight:800;

}

/* ==========================================
   Mobile
========================================== */

@media(max-width:1200px){

    .performance-grid{

        grid-template-columns:

            repeat(
                2,
                1fr
            );

    }

    .analytics-grid{

        grid-template-columns:

            1fr;

    }

}

@media(max-width:850px){

    .hero{

        flex-direction:column;

        align-items:flex-start;

    }

    .hero h1{

        font-size:46px;

    }

    .dashboard-grid{

        grid-template-columns:

            1fr;

    }

}

@media(max-width:600px){

    .performance-grid{

        grid-template-columns:

            1fr;

    }

    .hero{

        padding:28px;

    }

    .hero h1{

        font-size:38px;

    }

    .panel{

        padding:22px;

    }

    canvas{

        height:260px !important;

    }

}
/* ==========================================
   Hero buttons
========================================== */

.hero-buttons{

    display:flex;

    gap:14px;

    margin-top:24px;

    flex-wrap:wrap;

}

/* ==========================================
   Upcoming Workouts
========================================== */

.upcoming-workout{

    display:flex;

    align-items:center;

    justify-content:space-between;

    gap:16px;

    padding:14px 4px;

    border-bottom:1px solid var(--border);

}

.upcoming-workout:last-child{

    border-bottom:none;

}

.upcoming-left{

    display:flex;

    flex-direction:column;

    gap:2px;

    min-width:90px;

}

.upcoming-left strong{

    font-size:14px;

}

.upcoming-left span{

    color:var(--muted);

    font-size:12.5px;

    text-transform:uppercase;

    letter-spacing:.06em;

}

.upcoming-middle{

    flex:1;

    color:var(--text-secondary);

    font-size:14.5px;

}

.upcoming-right{

    font-family:var(--font-mono);

    color:var(--primary);

    font-size:14.5px;

    white-space:nowrap;

}

/* ==========================================
   Personal Records — inline editing
========================================== */

.record-value{

    cursor:pointer;

}

.record-input{

    width:100%;

    background:var(--surface);

    border:1px solid var(--primary);

    border-radius:10px;

    padding:8px 10px;

    color:var(--text);

    font-family:var(--font-mono);

    font-size:20px;

    text-align:center;

    outline:none;

}

/* ==========================================
   Data Connections — de-emphasized on purpose.

   COROS has known server-side reliability problems (see
   js/corosStatus.js), so this section stays secondary: your own
   logged data above is the page's centerpiece, this is supplementary.
========================================== */

.data-connections{

    margin-top:56px;

    padding-top:32px;

    border-top:1px solid var(--border);

}

.data-connections-intro{

    margin-bottom:24px;

}

.data-connections-intro span{

    display:block;

    color:var(--muted);

    text-transform:uppercase;

    letter-spacing:.08em;

    font-size:12.5px;

    margin-bottom:6px;

}

.data-connections-intro h2{

    font-size:22px;

    font-weight:700;

    margin-bottom:6px;

}

.data-connections-intro p{

    color:var(--muted);

    font-size:14px;

    max-width:640px;

}

/* ==========================================
   Training Consistency heatmap — one cell per
   scheduled day, columns are weeks, rows Mon-Sun.
========================================== */

.heatmap-grid{

    display:flex;
    gap:4px;
    overflow-x:auto;
    padding-bottom:4px;

}

.heatmap-week{

    display:flex;
    flex-direction:column;
    gap:4px;

}

.heatmap-cell{

    width:18px;
    height:18px;
    border-radius:4px;
    background:var(--surface-light);
    border:1px solid var(--border);
    flex-shrink:0;

}

.heatmap-cell.done{

    background:var(--green);
    border-color:var(--green);

}

.heatmap-cell.done-rest{

    background:rgba(34,197,94,.35);
    border-color:rgba(34,197,94,.5);

}

.heatmap-cell.missed{

    background:var(--red);
    border-color:var(--red);

}

.heatmap-cell.rest{

    background:var(--surface-light);
    border-color:var(--border);

}

.heatmap-cell.future{

    background:transparent;
    border-color:var(--border);
    border-style:dashed;

}

.heatmap-legend{

    display:flex;
    flex-wrap:wrap;
    gap:20px;
    margin-top:16px;
    font-size:13px;
    color:var(--muted);

}

.heatmap-legend span{

    display:inline-flex;
    align-items:center;
    gap:8px;

}

.heatmap-legend .heatmap-cell{

    width:14px;
    height:14px;

}
