/* ===========================================================================
   Competition print report styles.
   Plain CSS (not Tailwind) so the report renders identically whether viewed
   on screen or sent to the printer. Linked from _Host.cshtml.
   Everything is scoped under .report-root to avoid leaking into the app.
   =========================================================================== */

.report-root {
    --rpt-ink: #111827;
    --rpt-muted: #6b7280;
    --rpt-line: #d1d5db;
    --rpt-line-strong: #9ca3af;
    --rpt-accent: #73922A; /* Flightline green */
    color: var(--rpt-ink);
    font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 10pt;
    line-height: 1.25;
}

/* --- On-screen presentation: show a centred A4-ish sheet ------------------ */
@media screen {
    .report-root {
        background: #e5e7eb;
        min-height: 100vh;
        padding: 24px 0;
    }
    .report-sheet {
        background: #fff;
        width: 210mm;
        max-width: calc(100% - 24px);
        margin: 0 auto;
        padding: 12mm 10mm;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    }
    .report-toolbar {
        position: sticky;
        top: 0;
        z-index: 10;
        display: flex;
        gap: 8px;
        justify-content: center;
        padding: 8px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(2px);
    }
}

/* --- Print presentation -------------------------------------------------- */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }
    html, body {
        background: #fff !important;
    }
    .report-root {
        background: #fff;
        padding: 0;
    }
    .report-sheet {
        width: auto;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }
    .no-print {
        display: none !important;
    }
    /* Repeat table headers on every printed page. */
    thead {
        display: table-header-group;
    }
    tr, td, th {
        page-break-inside: avoid;
    }
}

/* --- Shared structural helpers ------------------------------------------- */
.report-section {
    margin-bottom: 8mm;
}
/* Start a major section on a fresh page when printing. */
.page-break-before {
    break-before: page;
}
.avoid-break {
    break-inside: avoid;
}

.report-section-title {
    font-size: 13pt;
    font-weight: 700;
    color: var(--rpt-accent);
    border-bottom: 2px solid var(--rpt-accent);
    padding-bottom: 2px;
    margin-bottom: 4px;
}
.report-subtitle {
    font-size: 11pt;
    font-weight: 600;
    margin: 6px 0 2px;
}

/* --- Report header / cover ----------------------------------------------- */
.report-header {
    border-bottom: 3px solid var(--rpt-accent);
    padding-bottom: 6px;
    margin-bottom: 8px;
}
.report-header h1 {
    font-size: 20pt;
    font-weight: 800;
    margin: 0;
}
.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-top: 4px;
    color: var(--rpt-muted);
    font-size: 9pt;
}
.report-meta b {
    color: var(--rpt-ink);
    font-weight: 600;
}

/* --- Generic report tables ----------------------------------------------- */
.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
}
.rpt-table th,
.rpt-table td {
    border-bottom: 1px solid var(--rpt-line);
    padding: 2px 4px;
    text-align: left;
    vertical-align: top;
}
.rpt-table thead th {
    border-bottom: 1.5px solid var(--rpt-line-strong);
    font-weight: 600;
    background: #f3f4f6;
}
.rpt-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.rpt-table .ctr {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* --- Leaderboard table: economical 18-hole layout for A4 portrait --------- */
.lb-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 7.5pt;
    line-height: 1.1;
}
.lb-table th,
.lb-table td {
    border-bottom: 1px solid var(--rpt-line);
    padding: 1px 1px;
}
.lb-table thead th {
    background: #f3f4f6;
    border-bottom: 1.5px solid var(--rpt-line-strong);
    font-weight: 600;
}
.lb-table .lb-pos {
    width: 7mm;
    text-align: center;
}
.lb-table .lb-name {
    width: 44mm;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lb-table .lb-name .lb-sub {
    font-weight: 400;
    color: var(--rpt-muted);
}
.lb-table .lb-hc {
    width: 7mm;
    text-align: center;
}
.lb-table .lb-hole {
    width: 6mm;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
/* Visual divider between front 9 and back 9. */
.lb-table .lb-hole-turn {
    border-left: 1px solid var(--rpt-line-strong);
}
.lb-table .lb-total {
    width: 8mm;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border-left: 1px solid var(--rpt-line-strong);
}
.lb-table .lb-par-row td {
    color: var(--rpt-muted);
    font-style: italic;
    border-bottom: 1.5px solid var(--rpt-line-strong);
}

/* --- Callouts (e.g. Not Submitted to WHS) -------------------------------- */
.report-callout {
    border: 1.5px solid #b45309;
    background: #fffbeb;
    border-radius: 4px;
    padding: 6px 8px;
}
.report-callout .report-section-title {
    color: #b45309;
    border-color: #b45309;
}

.report-empty {
    color: var(--rpt-muted);
    font-style: italic;
    font-size: 9pt;
}
