/* A.I. Reports — Report Protection Styles
   Scoped entirely to #airf-report (the generated report view) so the
   upload/manual-entry screen is completely unaffected. */

#airf-report {
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none; /* stops the iOS long-press "save image" menu */
}

/* Block right-click "save image as" and drag-out on any graphic rendered
   as an <img>. Recharts renders SVG so this mostly future-proofs against
   anything else you add later (e.g. a logo, an exported chart image). */
#airf-report img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* Blur-on-blur: toggled by airf-protect.js when the tab/window loses
   focus, or the devtools heuristic fires. This does NOT stop OS-level
   screenshots (PrtScn, full-screen capture) — those never blur the
   window — but it does interrupt snipping-tool flows that require
   switching focus to a selection overlay first. */
#airf-report.airf-blurred > *:not(.airf-unblur-btn):not(.airf-watermark) {
    filter: blur(18px);
    transition: filter 0.12s ease;
}

/* Capture-detected watermark — only ever added by airf-protect.js after
   the user clicks past a detected capture attempt (see the unblur
   button below). Never present on an ordinary page load. Built from
   plain tiled text elements rather than a generated image (see the JS
   comment on addCaptureWatermark for why). Positioned/sized in JS to sit
   exactly over the chart panel only, not the whole report — left/top/
   width/height are set inline per-instance, so only the shared visual
   styling lives here. */
.airf-watermark {
    position: absolute;
    z-index: 99999;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.38;
}
.airf-watermark-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    font-family: Arial, sans-serif;
    color: #d0d0d0;
    transform: rotate(-28deg);
    transform-origin: left top;
}
.airf-watermark-line1 {
    font-size: 14px;
    font-weight: 700;
}
.airf-watermark-line2 {
    font-size: 11px;
    font-style: italic;
    margin-top: 2px;
}

/* Manual "show report again" button — hidden unless the report is
   currently blurred. Clicking it clears the blur immediately; if the
   underlying cause (window still unfocused, Snipping Tool still open)
   is still true, airf-protect.js re-blurs on its next check regardless
   of this button, same as if the user hadn't clicked it. */
.airf-unblur-btn {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100000;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(20, 20, 20, 0.85);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    padding: 0;
}
#airf-report.airf-blurred .airf-unblur-btn {
    display: flex;
}

/* Kill native browser printing / "Save as PDF" of the report itself.
   Anything outside #airf-report on the page still prints normally. */
@media print {
    #airf-report {
        display: none !important;
    }
    body.airf-report-active::after {
        content: "Printing this report is disabled. Please view it online at ai-reports.co.uk.";
        display: block;
        padding: 60px 20px;
        text-align: center;
        font-family: Arial, sans-serif;
        font-size: 14px;
    }
}
