/* ── Report Analysis Page ─────────────────────────────────────────── */

.reports-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation */
.rpt-nav {
    margin-bottom: 0.5rem;
}

.rpt-back-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
}

.rpt-back-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Title */
.rpt-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.5rem 0 1.5rem;
    line-height: 1.2;
}

.rpt-title-sub {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Stat cards row */
.rpt-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.rpt-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-alt);
    border-radius: 8px;
    min-width: 120px;
    flex: 1;
}

.rpt-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.rpt-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-align: center;
}

/* Charts grid (side-by-side on desktop) */
.rpt-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1rem 0;
}

/* Chart sections */
.rpt-chart-section {
    margin: 1rem 0;
}

.rpt-chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--text-muted);
}

.rpt-chart-wrap {
    position: relative;
    max-height: 300px;
}

.rpt-chart-small {
    max-height: 220px;
}

/* Dose distribution */
.rpt-dose-dist {
    margin: 1rem 0;
}

.rpt-dose-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.rpt-dose-stat strong {
    color: var(--text-primary, inherit);
}

/* Effect Profile comparison */
.rpt-ep-compare {
    margin: 1rem 0 1.5rem;
}

.rpt-ep-class {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

/* Combination links */
.rpt-combo-link {
    color: var(--accent);
    text-decoration: none;
}

.rpt-combo-link:hover {
    text-decoration: underline;
}

.rpt-combo-bar {
    background: var(--accent) !important;
    opacity: 0.6;
}

/* Collapsible override for reports page (base uses display:none) */
.reports-page .collapse-content {
    display: block;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s linear;
    padding: 0;
}

.reports-page .collapse-content.open {
    padding: 0.5rem 0;
}

/* External link footer */
.rpt-ext-link {
    text-align: center;
    margin: 2rem 0;
    padding: 1rem;
}

.rpt-erowid-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    display: inline-block;
    transition: background 0.2s, color 0.2s;
}

.rpt-erowid-link:hover {
    background: var(--accent);
    color: #fff;
}

/* Report link card (on substance page) */
.report-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-alt);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border-color, rgba(128,128,128,0.2));
    transition: border-color 0.2s, box-shadow 0.2s;
}

.report-link-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.report-link-info {
    display: flex;
    flex-direction: column;
}

.report-link-count {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
}

.report-link-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.report-link-arrow {
    font-size: 1.5rem;
    color: var(--accent);
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.report-link-card:hover .report-link-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* ── Section sub-heading ────────────────────────────────────── */
.rpt-sub-heading {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

/* ── Form Distribution ─────────────────────────────────────── */
.rpt-form-bar {
    background: rgba(180,130,255,0.6) !important;
}

/* ── Body Weight Section ───────────────────────────────────── */
.rpt-bw-section {
    margin: 1rem 0;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 700px) {
    .rpt-charts-grid {
        grid-template-columns: 1fr;
    }

    .rpt-stats-row {
        gap: 0.5rem;
    }

    .rpt-stat-card {
        min-width: 80px;
        padding: 0.75rem 1rem;
    }

    .rpt-stat-number {
        font-size: 1.2rem;
    }

    .rpt-title {
        font-size: 1.4rem;
    }

}

@media (max-width: 480px) {
    .rpt-stats-row {
        flex-direction: column;
    }

    .rpt-stat-card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .rpt-stat-label {
        text-align: right;
    }

    .rpt-dose-stats {
        flex-direction: column;
        gap: 0.25rem;
    }
}
